public class FunctionParamBuilder extends Object
Constructor and Description |
---|
FunctionParamBuilder(JSTypeRegistry registry) |
Modifier and Type | Method and Description |
---|---|
boolean |
addOptionalParams(JSType... types)
Add optional parameters of the given type to the end of the param list.
|
boolean |
addRequiredParams(JSType... types)
Add parameters of the given type to the end of the param list.
|
boolean |
addVarArgs(JSType type)
Add variable arguments to the end of the parameter list.
|
Node |
build() |
boolean |
hasVarArgs() |
Node |
newOptionalParameterFromNode(Node n)
Copies the parameter specification from the given node,
but makes sure it's optional.
|
Node |
newParameterFromNode(Node n)
Copies the parameter specification from the given node.
|
public FunctionParamBuilder(JSTypeRegistry registry)
public boolean addRequiredParams(JSType... types)
public boolean addOptionalParams(JSType... types)
types
- Types for each optional parameter. The builder will make them
undefine-able.public boolean addVarArgs(JSType type)
public Node newParameterFromNode(Node n)
public Node newOptionalParameterFromNode(Node n)
public Node build()
public boolean hasVarArgs()
Copyright © 2009–2023 Google. All rights reserved.