Class JSTypeExpression

java.lang.Object
com.google.javascript.rhino.JSTypeExpression
All Implemented Interfaces:
Serializable

public final class JSTypeExpression extends Object implements Serializable
Represents a type expression as a miniature Rhino AST, so that the type expression can be evaluated later.
See Also:
  • Constructor Details

    • JSTypeExpression

      public JSTypeExpression(Node root, String sourceName)
  • Method Details

    • 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 a JSType object.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class 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.