public final class FunctionBuilder
extends java.lang.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 |
forConstructor()
Make this a constructor.
|
FunctionBuilder |
forInterface()
Make this an interface.
|
FunctionBuilder |
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.
|
FunctionBuilder |
withInferredReturnType(JSType returnType)
Sets an inferred return type.
|
FunctionBuilder |
withIsAbstract(boolean isAbstract)
Mark abstract method.
|
FunctionBuilder |
withName(java.lang.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 |
withPrototypeBasedOn(ObjectType setPrototypeBasedOn)
Set the prototype property of a constructor.
|
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 |
withTemplateKeys(TemplateType... templateKeys)
Set the template name.
|
FunctionBuilder |
withTypeOfThis(JSType typeOfThis)
Set the "this" type.
|
public FunctionBuilder(JSTypeRegistry registry)
public FunctionBuilder withName(java.lang.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 withTemplateKeys(TemplateType... templateKeys)
public FunctionBuilder withConstructorTemplateKeys(java.lang.Iterable<TemplateType> constructorOnlyKeys)
withTemplateKeys(com.google.common.collect.ImmutableList<com.google.javascript.rhino.jstype.TemplateType>).public FunctionBuilder forConstructor()
public FunctionBuilder forInterface()
public FunctionBuilder withIsAbstract(boolean isAbstract)
public FunctionBuilder withPrototypeBasedOn(ObjectType setPrototypeBasedOn)
public FunctionBuilder copyFromOtherFunction(FunctionType otherType)
public FunctionType build()
Copyright © 2009-2018 Google. All Rights Reserved.