public final class FunctionBuilder extends Object
JSTypeRegistry.createInterfaceType(java.lang.String, com.google.javascript.rhino.Node, com.google.common.collect.ImmutableList<com.google.javascript.rhino.jstype.TemplateType>, boolean)
.Constructor and Description |
---|
FunctionBuilder(JSTypeRegistry registry) |
Modifier and Type | Method and Description |
---|---|
FunctionType |
build()
Construct a new function type.
|
FunctionBuilder |
copyFromOtherFunction(FunctionType otherType)
Copies all the information from another function type.
|
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 |
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 |
withTemplateKeys(com.google.common.collect.ImmutableList<TemplateType> templateKeys)
Set the template name.
|
FunctionBuilder |
withTypeOfThis(JSType typeOfThis)
Set the "this" type.
|
public FunctionBuilder(JSTypeRegistry registry)
public FunctionBuilder withName(String name)
public FunctionBuilder withSourceNode(Node sourceNode)
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(JSType typeOfThis)
public FunctionBuilder withTemplateKeys(com.google.common.collect.ImmutableList<TemplateType> templateKeys)
public FunctionBuilder setIsConstructor(boolean isConstructor)
public FunctionBuilder copyFromOtherFunction(FunctionType otherType)
public FunctionType build()
Copyright © 2009–2023 Google. All rights reserved.