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() |
| Modifier and Type | Method and Description |
|---|---|
FunctionTypeBuilder |
addLoose() |
FunctionTypeBuilder |
addNominalType(NominalType cl) |
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(NominalType cl) |
FunctionTypeBuilder |
addReqFormal(JSType t) |
FunctionTypeBuilder |
addRestFormals(JSType t) |
FunctionTypeBuilder |
addRetType(JSType t) |
FunctionTypeBuilder |
addTypeParameters(com.google.common.collect.ImmutableList<String> typeParameters) |
DeclaredFunctionType |
buildDeclaration() |
FunctionType |
buildFunction() |
public FunctionTypeBuilder addPlaceholderFormal()
public FunctionTypeBuilder addReqFormal(JSType t) throws com.google.javascript.jscomp.newtypes.FunctionTypeBuilder.WrongParameterOrderException
com.google.javascript.jscomp.newtypes.FunctionTypeBuilder.WrongParameterOrderExceptionpublic FunctionTypeBuilder addOptFormal(JSType t) throws com.google.javascript.jscomp.newtypes.FunctionTypeBuilder.WrongParameterOrderException
com.google.javascript.jscomp.newtypes.FunctionTypeBuilder.WrongParameterOrderExceptionpublic FunctionTypeBuilder addOuterVarPrecondition(String name, JSType t)
public FunctionTypeBuilder addRestFormals(JSType t)
public FunctionTypeBuilder addRetType(JSType t)
public FunctionTypeBuilder addLoose()
public FunctionTypeBuilder addNominalType(NominalType cl)
public FunctionTypeBuilder addTypeParameters(com.google.common.collect.ImmutableList<String> typeParameters)
public FunctionTypeBuilder addReceiverType(NominalType cl)
public DeclaredFunctionType buildDeclaration()
public FunctionType buildFunction()
Copyright © 2009-2015 Google. All Rights Reserved.