public class FunctionParamBuilder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private JSTypeRegistry |
registry |
private Node |
root |
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() |
private boolean |
hasOptionalOrVarArgs() |
boolean |
hasVarArgs() |
Node |
newOptionalParameterFromNode(Node n)
Copies the parameter specification from the given node,
but makes sure it's optional.
|
private Node |
newParameter(JSType type) |
Node |
newParameterFromNode(Node n)
Copies the parameter specification from the given node.
|
private final JSTypeRegistry registry
private final Node root
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()
private boolean hasOptionalOrVarArgs()
public boolean hasVarArgs()