Interface Visitor<T>

All Known Implementing Classes:
ModificationVisitor

public interface Visitor<T>
A type visitor.

This code will calculate a specific value of type T from a type based on its structure:

JSType type = …;
 T value = type.visit(new Visitor<T>() {
   …
 });
  • Method Details

    • caseNoType

      T caseNoType()
      Bottom type's case.
    • caseEnumElementType

      T caseEnumElementType(EnumElementType type)
      Enum element type's case.
    • caseAllType

      T caseAllType()
      All type's case.
    • caseBooleanType

      T caseBooleanType()
      Boolean value type's case.
    • caseNoObjectType

      T caseNoObjectType()
      Bottom Object type's case.
    • caseFunctionType

      T caseFunctionType(FunctionType type)
      Function type's case.
    • caseObjectType

      T caseObjectType(ObjectType type)
      Object type's case.
    • caseUnknownType

      T caseUnknownType()
      Unknown type's case.
    • caseNullType

      T caseNullType()
      Null type's case.
    • caseNumberType

      T caseNumberType()
      Number value type's case.
    • caseStringType

      T caseStringType()
      String value type's case.
    • caseVoidType

      T caseVoidType()
      Void type's case.
    • caseUnionType

      T caseUnionType(UnionType type)
      Union type's case.
    • caseTemplatizedType

      T caseTemplatizedType(TemplatizedType type)
      Templatized type's case.
    • caseTemplateType

      T caseTemplateType(TemplateType templateType)
      Template type's case.