Class ResolvedReferenceType

    • Method Detail

      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isReferenceType

        public final boolean isReferenceType()
        Description copied from interface: ResolvedType
        Can this be seen as a ReferenceTypeUsage? In other words: is this a reference to a class, an interface or an enum?
        Specified by:
        isReferenceType in interface ResolvedType
      • transformTypeParameters

        public abstract ResolvedType transformTypeParameters​(ResolvedTypeTransformer transformer)
        Execute a transformation on all the type parameters of this element.
      • isAssignableBy

        public abstract boolean isAssignableBy​(ResolvedType other)
        This method checks if ThisType t = new OtherType() would compile.
        Specified by:
        isAssignableBy in interface ResolvedType
      • getAllAncestors

        public abstract java.util.List<ResolvedReferenceType> getAllAncestors()
        Return all ancestors, that means all superclasses and interfaces. This list should always include Object (unless this is a reference to Object). The type typeParametersValues should be expressed in terms of this type typeParametersValues.

        For example, given:

        class Foo<A, B> {} class Bar<C> extends Foo<C, String> {}

        a call to getAllAncestors on a reference to Bar having type parameter Boolean should include Foo<Boolean, String>.

      • getDirectAncestors

        public abstract java.util.List<ResolvedReferenceType> getDirectAncestors()
        Return direct ancestors, that means the superclasses and interfaces implemented directly. This list should include Object if the class has no other superclass or the interface is not extending another interface. There is an exception for Object itself.
      • getAllInterfacesAncestors

        public final java.util.List<ResolvedReferenceType> getAllInterfacesAncestors()
      • getGenericParameterByName

        public java.util.Optional<ResolvedType> getGenericParameterByName​(java.lang.String name)
        Get the type associated with the type parameter with the given name. It returns Optional.empty unless the type declaration declares a type parameter with the given name.
        Specified by:
        getGenericParameterByName in interface ResolvedTypeParameterValueProvider
      • typeParametersValues

        public java.util.List<ResolvedType> typeParametersValues()
        Get the values for all type parameters declared on this type. The list can be empty for raw types.
      • getTypeParametersMap

        public java.util.List<Pair<ResolvedTypeParameterDeclaration,​ResolvedType>> getTypeParametersMap()
        Get the values for all type parameters declared on this type. In case of raw types the values correspond to TypeVariables.
      • getFieldType

        public java.util.Optional<ResolvedType> getFieldType​(java.lang.String name)
        The type of the field could be different from the one in the corresponding FieldDeclaration because type variables would be solved.
      • hasName

        public boolean hasName()
        Has the TypeDeclaration a name? Anonymous classes do not have one.
      • getQualifiedName

        public java.lang.String getQualifiedName()
        Qualified name of the declaration.
      • getId

        public java.lang.String getId()
        Id of the declaration. It corresponds to the qualified name, unless for local classes.
      • getDeclaredMethods

        public abstract java.util.Set<MethodUsage> getDeclaredMethods()
        Methods declared on this type.
      • getDeclaredFields

        public abstract java.util.Set<ResolvedFieldDeclaration> getDeclaredFields()
        Fields declared on this type.
      • isRawType

        public boolean isRawType()
      • getAllMethods

        public java.util.List<ResolvedMethodDeclaration> getAllMethods()
        Get a list of all the methods available on this type. This list includes methods declared in this type and methods inherited. This list includes methods of all sort of visibility. However it does not include methods that have been overwritten.
      • getAllFieldsVisibleToInheritors

        public java.util.List<ResolvedFieldDeclaration> getAllFieldsVisibleToInheritors()
        Fields which are visible to inheritors. They include all inherited fields which are visible to this type plus all declared fields which are not private.
      • isCorrespondingBoxingType

        protected boolean isCorrespondingBoxingType​(java.lang.String typeName)
      • compareConsideringTypeParameters

        protected boolean compareConsideringTypeParameters​(ResolvedReferenceType other)