public static final class FunctionType.Builder
extends java.lang.Object
If you need to build an interface constructor, use JSTypeRegistry.createInterfaceType(java.lang.String, com.google.javascript.rhino.Node, com.google.common.collect.ImmutableList<com.google.javascript.rhino.jstype.TemplateType>, boolean).
| Modifier and Type | Method and Description |
|---|---|
FunctionType |
build()
Constructs a new function type.
|
FunctionType.Builder |
copyFromOtherFunction(FunctionType otherType)
Copies all the information from another function type.
|
FunctionType.Builder |
forConstructor()
Make this a constructor.
|
FunctionType.Builder |
forInterface()
Make this an interface.
|
FunctionType.Builder |
withClosurePrimitiveId(ClosurePrimitive id)
Sets the
ClosurePrimitive corresponding to this function |
FunctionType.Builder |
withConstructorTemplateKeys(java.lang.Iterable<TemplateType> constructorOnlyKeys)
Specifies a subset of the template keys that only apply to the constructor, and should be
removed from the instance type.
|
FunctionType.Builder |
withInferredReturnType(JSType returnType)
Sets an inferred return type.
|
FunctionType.Builder |
withIsAbstract(boolean isAbstract)
Mark abstract method.
|
FunctionType.Builder |
withName(java.lang.String name)
Set the name of the function type.
|
FunctionType.Builder |
withParamsNode(Node parametersNode)
Set the parameters of the function type with a specially-formatted node.
|
FunctionType.Builder |
withPrototypeBasedOn(ObjectType setPrototypeBasedOn)
Set the prototype property of a constructor.
|
FunctionType.Builder |
withReturnType(JSType returnType)
Set the return type.
|
FunctionType.Builder |
withReturnType(JSType returnType,
boolean inferred)
Set the return type and whether it's inferred.
|
FunctionType.Builder |
withSourceNode(Node sourceNode)
Set the source node of the function type.
|
FunctionType.Builder |
withTemplateKeys(com.google.common.collect.ImmutableList<TemplateType> templateKeys)
Set the template name.
|
FunctionType.Builder |
withTemplateKeys(TemplateType... templateKeys)
Set the template name.
|
FunctionType.Builder |
withTypeOfThis(JSType typeOfThis)
Set the "this" type.
|
public FunctionType.Builder withName(java.lang.String name)
public FunctionType.Builder withSourceNode(Node sourceNode)
public FunctionType.Builder withParamsNode(Node parametersNode)
public FunctionType.Builder withReturnType(JSType returnType)
public FunctionType.Builder withReturnType(JSType returnType, boolean inferred)
public FunctionType.Builder withInferredReturnType(JSType returnType)
public FunctionType.Builder withTypeOfThis(JSType typeOfThis)
public FunctionType.Builder withTemplateKeys(com.google.common.collect.ImmutableList<TemplateType> templateKeys)
public FunctionType.Builder withTemplateKeys(TemplateType... templateKeys)
public FunctionType.Builder withConstructorTemplateKeys(java.lang.Iterable<TemplateType> constructorOnlyKeys)
withTemplateKeys(com.google.common.collect.ImmutableList<com.google.javascript.rhino.jstype.TemplateType>).public FunctionType.Builder forConstructor()
public FunctionType.Builder forInterface()
public FunctionType.Builder withIsAbstract(boolean isAbstract)
public FunctionType.Builder withPrototypeBasedOn(ObjectType setPrototypeBasedOn)
public FunctionType.Builder withClosurePrimitiveId(ClosurePrimitive id)
ClosurePrimitive corresponding to this functionpublic FunctionType.Builder copyFromOtherFunction(FunctionType otherType)
public FunctionType build()
Copyright © 2009-2019 Google. All Rights Reserved.