public final class FunctionTypeBuilder extends Object
FunctionType and DeclaredFunctionType.
The builder is called during both JSDoc parsing and type inference, and
these parts use different warning systems, so expect the context to handle
the exception appropriately.| Constructor and Description |
|---|
FunctionTypeBuilder(JSTypes commonTypes) |
| Modifier and Type | Method and Description |
|---|---|
FunctionTypeBuilder |
addAbstract(boolean isAbstract) |
FunctionTypeBuilder |
addLoose() |
FunctionTypeBuilder |
addNominalType(JSType t) |
FunctionTypeBuilder |
addOptFormal(JSType t) |
FunctionTypeBuilder |
addOuterVarPrecondition(String name,
JSType t) |
FunctionTypeBuilder |
addPlaceholderFormal()
Used when the order of required/optional/rest formals in a function jsdoc is wrong.
|
FunctionTypeBuilder |
addReceiverType(JSType t) |
FunctionTypeBuilder |
addReqFormal(JSType t) |
FunctionTypeBuilder |
addReqFormalToFront(JSType t) |
FunctionTypeBuilder |
addRestFormals(JSType t) |
FunctionTypeBuilder |
addRetType(JSType t) |
FunctionTypeBuilder |
addTypeParameters(com.google.common.collect.ImmutableList<String> typeParameters) |
FunctionTypeBuilder |
appendTypeParameters(com.google.common.collect.ImmutableList<String> typeParameters) |
DeclaredFunctionType |
buildDeclaration() |
FunctionType |
buildFunction() |
public FunctionTypeBuilder(JSTypes commonTypes)
public FunctionTypeBuilder addPlaceholderFormal()
public FunctionTypeBuilder addReqFormal(JSType t)
public FunctionTypeBuilder addReqFormalToFront(JSType t)
public FunctionTypeBuilder addOptFormal(JSType t)
public FunctionTypeBuilder addOuterVarPrecondition(String name, JSType t)
public FunctionTypeBuilder addRestFormals(JSType t)
public FunctionTypeBuilder addRetType(JSType t)
public FunctionTypeBuilder addLoose()
public FunctionTypeBuilder addAbstract(boolean isAbstract)
public FunctionTypeBuilder addNominalType(JSType t)
public FunctionTypeBuilder addTypeParameters(com.google.common.collect.ImmutableList<String> typeParameters)
public FunctionTypeBuilder appendTypeParameters(com.google.common.collect.ImmutableList<String> typeParameters)
public FunctionTypeBuilder addReceiverType(JSType t)
public DeclaredFunctionType buildDeclaration()
public FunctionType buildFunction()
Copyright © 2009-2017 Google. All Rights Reserved.