public interface ReferenceTypeDeclaration extends TypeDeclaration, TypeParametrizable
Modifier and Type | Method and Description |
---|---|
default ReferenceTypeDeclaration |
asReferenceType() |
default boolean |
canBeAssignedTo(ReferenceTypeDeclaration other)
Can we assign instances of the type defined by this declaration to variables having the type defined
by the given type?
|
default java.util.Optional<TypeParameterDeclaration> |
findTypeParameter(java.lang.String name)
Find the closest TypeParameterDeclaration with the given name.
|
default java.util.List<ReferenceType> |
getAllAncestors()
The list of all the ancestors of the current declaration, direct and indirect.
|
java.util.List<FieldDeclaration> |
getAllFields()
Return a list of all fields, either declared in this declaration or inherited.
|
java.util.Set<MethodUsage> |
getAllMethods()
Return a list of all the methods declared of this type declaration, either declared or inherited.
|
default java.util.List<FieldDeclaration> |
getAllNonStaticFields()
Return a list of all the non static fields, either declared or inherited.
|
default java.util.List<FieldDeclaration> |
getAllStaticFields()
Return a list of all the static fields, either declared or inherited.
|
java.util.List<ReferenceType> |
getAncestors()
The list of all the direct ancestors of the current declaration.
|
default java.util.List<FieldDeclaration> |
getDeclaredFields()
Return a list of all the fields declared in this type.
|
java.util.Set<MethodDeclaration> |
getDeclaredMethods()
Return a list of all the methods declared in this type declaration.
|
default FieldDeclaration |
getField(java.lang.String name)
Note that the type of the field should be expressed using the type variables of this particular type.
|
default FieldDeclaration |
getVisibleField(java.lang.String name)
Consider only field or inherited field which is not private.
|
default java.util.List<FieldDeclaration> |
getVisibleFields()
Return a list of all fields declared and the inherited ones which are not private.
|
default boolean |
hasAnnotation(java.lang.String qualifiedName)
Has the type at least one annotation declared or inherited having the specified qualified name?
|
boolean |
hasDirectlyAnnotation(java.lang.String qualifiedName)
Has the type at least one annotation declared having the specified qualified name?
|
default boolean |
hasField(java.lang.String name)
Has this type a field with the given name?
|
default boolean |
hasVisibleField(java.lang.String name)
Either a declared field or inherited field which is not private.
|
boolean |
isAssignableBy(ReferenceTypeDeclaration other)
Can we assign instances of the given type to variables having the type defined
by this declaration?
|
boolean |
isAssignableBy(Type type)
Can we assign instances of the given type to variables having the type defined
by this declaration?
|
boolean |
isFunctionalInterface()
This means that the type has a functional method.
|
asClass, asEnum, asInterface, asType, asTypeParameter, containerType, getClassName, getId, getInternalType, getPackageName, getQualifiedName, hasInternalType, internalTypes, isClass, isEnum, isInterface, isType, isTypeParameter
asField, asMethod, asParameter, getName, hasName, isField, isMethod, isParameter
getTypeParameters
default ReferenceTypeDeclaration asReferenceType()
asReferenceType
in interface TypeDeclaration
java.util.List<ReferenceType> getAncestors()
class A implements Comparable<String> {}
In this case the ancestor is Comparable<String>
default java.util.List<ReferenceType> getAllAncestors()
default FieldDeclaration getField(java.lang.String name)
class Foo
class Bar extends Foo
When calling getField("field") on Foo I should get a FieldDeclaration with type E, while calling it on
Bar I should get a FieldDeclaration with type String.
default FieldDeclaration getVisibleField(java.lang.String name)
default boolean hasField(java.lang.String name)
default boolean hasVisibleField(java.lang.String name)
java.util.List<FieldDeclaration> getAllFields()
default java.util.List<FieldDeclaration> getVisibleFields()
default java.util.List<FieldDeclaration> getAllNonStaticFields()
default java.util.List<FieldDeclaration> getAllStaticFields()
default java.util.List<FieldDeclaration> getDeclaredFields()
java.util.Set<MethodDeclaration> getDeclaredMethods()
java.util.Set<MethodUsage> getAllMethods()
boolean isAssignableBy(Type type)
default boolean canBeAssignedTo(ReferenceTypeDeclaration other)
boolean isAssignableBy(ReferenceTypeDeclaration other)
boolean hasDirectlyAnnotation(java.lang.String qualifiedName)
default boolean hasAnnotation(java.lang.String qualifiedName)
boolean isFunctionalInterface()
default java.util.Optional<TypeParameterDeclaration> findTypeParameter(java.lang.String name)
TypeParametrizable
findTypeParameter
in interface TypeParametrizable