Package com.google.javascript.rhino
Class JSTypeExpression
- java.lang.Object
-
- com.google.javascript.rhino.JSTypeExpression
-
- All Implemented Interfaces:
java.io.Serializable
public final class JSTypeExpression extends java.lang.Object implements java.io.SerializableRepresents a type expression as a miniature Rhino AST, so that the type expression can be evaluated later.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JSTypeExpression(Node root, java.lang.String sourceName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)JSTypeevaluate(StaticScope<JSType> scope, JSTypeRegistry registry)Evaluates the type expression into aJSTypeobject.NodegetRoot()inthashCode()booleanisOptionalArg()booleanisVarArgs()static JSTypeExpressionmakeOptionalArg(JSTypeExpression expr)Make the given type expression into an optional type expression, if possible.
-
-
-
Constructor Detail
-
JSTypeExpression
public JSTypeExpression(Node root, java.lang.String sourceName)
-
-
Method Detail
-
makeOptionalArg
public static JSTypeExpression makeOptionalArg(JSTypeExpression expr)
Make the given type expression into an optional type expression, if possible.
-
isOptionalArg
public boolean isOptionalArg()
- Returns:
- Whether this expression denotes an optional
@param.
-
isVarArgs
public boolean isVarArgs()
- Returns:
- Whether this expression denotes a rest args
@param.
-
evaluate
public JSType evaluate(StaticScope<JSType> scope, JSTypeRegistry registry)
Evaluates the type expression into aJSTypeobject.
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getRoot
public Node getRoot()
- Returns:
- The source for this type expression. Note that it will not contain an expression if there's an @override tag.
-
-