Class FunctionBuilder
java.lang.Object
com.google.javascript.rhino.jstype.FunctionBuilder
A builder class for function and arrow types.
If you need to build an interface constructor,
use
JSTypeRegistry.createInterfaceType(java.lang.String, com.google.javascript.rhino.Node)
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Construct a new function type.copyFromOtherFunction
(FunctionType otherType) Copies all the information from another function type.Make this a constructor.setIsConstructor
(boolean isConstructor) Set whether this is a constructor.withInferredReturnType
(JSType returnType) Sets an inferred return type.Set the name of the function type.withParams
(FunctionParamBuilder params) Set the parameters of the function type from a FunctionParamBuilder.withParamsNode
(Node parametersNode) Set the parameters of the function type with a specially-formatted node.withReturnType
(JSType returnType) Set the return type.withReturnType
(JSType returnType, boolean inferred) Set the return type and whether it's inferred.withSourceNode
(Node sourceNode) Set the source node of the function type.withTemplateKeys
(com.google.common.collect.ImmutableList<TemplateType> templateKeys) Set the template name.withTypeOfThis
(JSType typeOfThis) Set the "this" type.
-
Constructor Details
-
FunctionBuilder
-
-
Method Details
-
withName
Set the name of the function type. -
withSourceNode
Set the source node of the function type. -
withParams
Set the parameters of the function type from a FunctionParamBuilder. -
withParamsNode
Set the parameters of the function type with a specially-formatted node. -
withReturnType
Set the return type. -
withReturnType
Set the return type and whether it's inferred. -
withInferredReturnType
Sets an inferred return type. -
withTypeOfThis
Set the "this" type. -
withTemplateKeys
public FunctionBuilder withTemplateKeys(com.google.common.collect.ImmutableList<TemplateType> templateKeys) Set the template name. -
forConstructor
Make this a constructor. -
setIsConstructor
Set whether this is a constructor. -
copyFromOtherFunction
Copies all the information from another function type. -
build
Construct a new function type.
-