Class TurbineTypes

  • All Implemented Interfaces:
    javax.lang.model.util.Types

    public class TurbineTypes
    extends java.lang.Object
    implements javax.lang.model.util.Types
    An implementation of Types backed by turbine's TypeMirror.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.lang.model.element.Element asElement​(javax.lang.model.type.TypeMirror t)  
      javax.lang.model.type.TypeMirror asMemberOf​(javax.lang.model.type.DeclaredType containing, javax.lang.model.element.Element element)
      Returns the TypeMirror of the given element as a member of containing, or else null if it is not a member.
      @Nullable javax.lang.model.type.TypeMirror asMemberOfInternal​(javax.lang.model.type.DeclaredType containing, javax.lang.model.element.Element element)  
      javax.lang.model.element.TypeElement boxedClass​(javax.lang.model.type.PrimitiveType p)  
      javax.lang.model.type.TypeMirror capture​(javax.lang.model.type.TypeMirror typeMirror)  
      boolean contains​(javax.lang.model.type.TypeMirror a, javax.lang.model.type.TypeMirror b)  
      static Type.ClassTy deannotateClassTy​(Type.ClassTy ty)  
      com.google.common.collect.ImmutableList<Type> directSupertypes​(Type t)  
      java.util.List<? extends javax.lang.model.type.TypeMirror> directSupertypes​(javax.lang.model.type.TypeMirror m)  
      javax.lang.model.type.TypeMirror erasure​(javax.lang.model.type.TypeMirror typeMirror)  
      javax.lang.model.type.ArrayType getArrayType​(javax.lang.model.type.TypeMirror componentType)  
      javax.lang.model.type.DeclaredType getDeclaredType​(javax.lang.model.element.TypeElement typeElem, javax.lang.model.type.TypeMirror... typeArgs)  
      javax.lang.model.type.DeclaredType getDeclaredType​(javax.lang.model.type.DeclaredType containing, javax.lang.model.element.TypeElement typeElem, javax.lang.model.type.TypeMirror... typeArgs)  
      javax.lang.model.type.NoType getNoType​(javax.lang.model.type.TypeKind kind)  
      javax.lang.model.type.NullType getNullType()  
      javax.lang.model.type.PrimitiveType getPrimitiveType​(javax.lang.model.type.TypeKind kind)  
      javax.lang.model.type.WildcardType getWildcardType​(javax.lang.model.type.TypeMirror extendsBound, javax.lang.model.type.TypeMirror superBound)  
      boolean isAssignable​(javax.lang.model.type.TypeMirror a1, javax.lang.model.type.TypeMirror a2)  
      boolean isSameType​(javax.lang.model.type.TypeMirror a, javax.lang.model.type.TypeMirror b)  
      boolean isSubsignature​(javax.lang.model.type.ExecutableType m1, javax.lang.model.type.ExecutableType m2)  
      boolean isSubtype​(javax.lang.model.type.TypeMirror a, javax.lang.model.type.TypeMirror b)
      Returns true if type a is a subtype of type b.
      javax.lang.model.type.PrimitiveType unboxedType​(javax.lang.model.type.TypeMirror typeMirror)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TurbineTypes

        public TurbineTypes​(ModelFactory factory)
    • Method Detail

      • asElement

        public javax.lang.model.element.Element asElement​(javax.lang.model.type.TypeMirror t)
        Specified by:
        asElement in interface javax.lang.model.util.Types
      • isSameType

        public boolean isSameType​(javax.lang.model.type.TypeMirror a,
                                  javax.lang.model.type.TypeMirror b)
        Specified by:
        isSameType in interface javax.lang.model.util.Types
      • isSubtype

        public boolean isSubtype​(javax.lang.model.type.TypeMirror a,
                                 javax.lang.model.type.TypeMirror b)
        Returns true if type a is a subtype of type b. See JLS 4.1.0, 'subtyping'.
        Specified by:
        isSubtype in interface javax.lang.model.util.Types
      • isAssignable

        public boolean isAssignable​(javax.lang.model.type.TypeMirror a1,
                                    javax.lang.model.type.TypeMirror a2)
        Specified by:
        isAssignable in interface javax.lang.model.util.Types
      • contains

        public boolean contains​(javax.lang.model.type.TypeMirror a,
                                javax.lang.model.type.TypeMirror b)
        Specified by:
        contains in interface javax.lang.model.util.Types
      • isSubsignature

        public boolean isSubsignature​(javax.lang.model.type.ExecutableType m1,
                                      javax.lang.model.type.ExecutableType m2)
        Specified by:
        isSubsignature in interface javax.lang.model.util.Types
      • directSupertypes

        public java.util.List<? extends javax.lang.model.type.TypeMirror> directSupertypes​(javax.lang.model.type.TypeMirror m)
        Specified by:
        directSupertypes in interface javax.lang.model.util.Types
      • directSupertypes

        public com.google.common.collect.ImmutableList<Type> directSupertypes​(Type t)
      • erasure

        public javax.lang.model.type.TypeMirror erasure​(javax.lang.model.type.TypeMirror typeMirror)
        Specified by:
        erasure in interface javax.lang.model.util.Types
      • boxedClass

        public javax.lang.model.element.TypeElement boxedClass​(javax.lang.model.type.PrimitiveType p)
        Specified by:
        boxedClass in interface javax.lang.model.util.Types
      • unboxedType

        public javax.lang.model.type.PrimitiveType unboxedType​(javax.lang.model.type.TypeMirror typeMirror)
        Specified by:
        unboxedType in interface javax.lang.model.util.Types
      • capture

        public javax.lang.model.type.TypeMirror capture​(javax.lang.model.type.TypeMirror typeMirror)
        Specified by:
        capture in interface javax.lang.model.util.Types
      • getPrimitiveType

        public javax.lang.model.type.PrimitiveType getPrimitiveType​(javax.lang.model.type.TypeKind kind)
        Specified by:
        getPrimitiveType in interface javax.lang.model.util.Types
      • getNullType

        public javax.lang.model.type.NullType getNullType()
        Specified by:
        getNullType in interface javax.lang.model.util.Types
      • getNoType

        public javax.lang.model.type.NoType getNoType​(javax.lang.model.type.TypeKind kind)
        Specified by:
        getNoType in interface javax.lang.model.util.Types
      • getArrayType

        public javax.lang.model.type.ArrayType getArrayType​(javax.lang.model.type.TypeMirror componentType)
        Specified by:
        getArrayType in interface javax.lang.model.util.Types
      • getWildcardType

        public javax.lang.model.type.WildcardType getWildcardType​(javax.lang.model.type.TypeMirror extendsBound,
                                                                  javax.lang.model.type.TypeMirror superBound)
        Specified by:
        getWildcardType in interface javax.lang.model.util.Types
      • getDeclaredType

        public javax.lang.model.type.DeclaredType getDeclaredType​(javax.lang.model.element.TypeElement typeElem,
                                                                  javax.lang.model.type.TypeMirror... typeArgs)
        Specified by:
        getDeclaredType in interface javax.lang.model.util.Types
      • getDeclaredType

        public javax.lang.model.type.DeclaredType getDeclaredType​(javax.lang.model.type.DeclaredType containing,
                                                                  javax.lang.model.element.TypeElement typeElem,
                                                                  javax.lang.model.type.TypeMirror... typeArgs)
        Specified by:
        getDeclaredType in interface javax.lang.model.util.Types
      • asMemberOf

        public javax.lang.model.type.TypeMirror asMemberOf​(javax.lang.model.type.DeclaredType containing,
                                                           javax.lang.model.element.Element element)
        Returns the TypeMirror of the given element as a member of containing, or else null if it is not a member.

        e.g. given a class MyStringList that implements List<String>, the type of List.add would be add(String).

        Specified by:
        asMemberOf in interface javax.lang.model.util.Types
      • asMemberOfInternal

        public @Nullable javax.lang.model.type.TypeMirror asMemberOfInternal​(javax.lang.model.type.DeclaredType containing,
                                                                             javax.lang.model.element.Element element)