public 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 |
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() |
JSType |
buildType() |
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()
public JSType buildType()
Copyright © 2009-2014 Google. All Rights Reserved.