Interface TypeDeclaration

All Superinterfaces:
AnnotationTarget, Declaration, Element, MemberDeclaration, NamedElement, Type
All Known Subinterfaces:
AnnotationTypeDeclaration, ClassDeclaration, EnumerationTypeDeclaration, InterfaceDeclaration, MutableAnnotationTypeDeclaration, MutableClassDeclaration, MutableEnumerationTypeDeclaration, MutableInterfaceDeclaration, MutableTypeDeclaration

@Beta public interface TypeDeclaration extends Type, MemberDeclaration
Author:
Sven Efftinge
  • Method Details

    • getDeclaredMembers

      Iterable<? extends MemberDeclaration> getDeclaredMembers()
      Returns:
      the members directly declared and contained in the type declaration
    • getDeclaredMethods

      Iterable<? extends MethodDeclaration> getDeclaredMethods()
      Returns:
      the methods directly declared and contained in the type declaration
    • getDeclaredFields

      Iterable<? extends FieldDeclaration> getDeclaredFields()
      Returns:
      the fields directly declared and contained in the type declaration
    • getDeclaredConstructors

      Iterable<? extends ConstructorDeclaration> getDeclaredConstructors()
      Returns:
      the constructors directly declared and contained in the type declaration
    • getDeclaredClasses

      Iterable<? extends ClassDeclaration> getDeclaredClasses()
      Returns:
      the classes directly declared and contained in the type declaration
    • getDeclaredInterfaces

      Iterable<? extends InterfaceDeclaration> getDeclaredInterfaces()
      Returns:
      the interfaces directly declared and contained in the type declaration
    • getDeclaredEnumerationTypes

      Iterable<? extends EnumerationTypeDeclaration> getDeclaredEnumerationTypes()
      Returns:
      the enumeration types directly declared and contained in this type declaration
      Since:
      2.8
    • getDeclaredAnnotationTypes

      Iterable<? extends AnnotationTypeDeclaration> getDeclaredAnnotationTypes()
      Returns:
      the annotation types directly declared and contained in this type declaration
      Since:
      2.8
    • getDeclaredTypes

      Iterable<? extends TypeDeclaration> getDeclaredTypes()
      Returns:
      the types directly declared and contained in this type declaration
      Since:
      2.8
    • findDeclaredField

      FieldDeclaration findDeclaredField(String name)
      Parameters:
      name - of the feature
      Returns:
      the declared field with the given name or null of no such field exists.
    • findDeclaredType

      TypeDeclaration findDeclaredType(String name)
      Parameters:
      name - of the nested type
      Returns:
      the declared, nested type with the given name or null of no such type exists.
      Since:
      2.8
    • findDeclaredMethod

      MethodDeclaration findDeclaredMethod(String name, TypeReference... parameterTypes)
      Parameters:
      name - of the method
      parameterTypes - - the types of the method
      Returns:
      the declared method with the given name and the specified parameter types or null if no such method exists.
    • findDeclaredConstructor

      ConstructorDeclaration findDeclaredConstructor(TypeReference... parameterTypes)
      Parameters:
      parameterTypes - - the parameter types of the constructor
      Returns:
      the declared constructor with the exact same parameter types or null if no such constructors exists.