|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.javascript.rhino.jstype.FunctionBuilder
public final class 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 | |
---|---|
FunctionBuilder(JSTypeRegistry registry)
|
Method Summary | |
---|---|
FunctionType |
build()
Construct a new function type. |
FunctionBuilder |
copyFromOtherFunction(FunctionType otherType)
Copies all the information from another function type. |
FunctionBuilder |
forConstructor()
Make this a constructor. |
FunctionBuilder |
setIsConstructor(boolean isConstructor)
Set whether this is a constructor. |
FunctionBuilder |
withInferredReturnType(JSType returnType)
Sets an inferred return type. |
FunctionBuilder |
withName(String name)
Set the name of the function type. |
FunctionBuilder |
withParams(FunctionParamBuilder params)
Set the parameters of the function type from a FunctionParamBuilder. |
FunctionBuilder |
withParamsNode(Node parametersNode)
Set the parameters of the function type with a specially-formatted node. |
FunctionBuilder |
withReturnType(JSType returnType)
Set the return type. |
FunctionBuilder |
withReturnType(JSType returnType,
boolean inferred)
Set the return type and whether it's inferred. |
FunctionBuilder |
withSourceNode(Node sourceNode)
Set the source node of the function type. |
FunctionBuilder |
withTemplateName(String templateTypeName)
Set the template name. |
FunctionBuilder |
withTypeOfThis(ObjectType typeOfThis)
Set the "this" type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FunctionBuilder(JSTypeRegistry registry)
Method Detail |
---|
public FunctionBuilder withName(String name)
public FunctionBuilder withSourceNode(Node sourceNode)
public FunctionBuilder withParams(FunctionParamBuilder params)
public FunctionBuilder withParamsNode(Node parametersNode)
public FunctionBuilder withReturnType(JSType returnType)
public FunctionBuilder withReturnType(JSType returnType, boolean inferred)
public FunctionBuilder withInferredReturnType(JSType returnType)
public FunctionBuilder withTypeOfThis(ObjectType typeOfThis)
public FunctionBuilder withTemplateName(String templateTypeName)
public FunctionBuilder forConstructor()
public FunctionBuilder setIsConstructor(boolean isConstructor)
public FunctionBuilder copyFromOtherFunction(FunctionType otherType)
public FunctionType build()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |