Interface TypeInfo

All Superinterfaces:
Annotated, Prototype.Api
All Known Implementing Classes:
TypeInfo.BuilderBase.TypeInfoImpl

public interface TypeInfo extends Prototype.Api
Represents the model object for a type.
See Also:
  • Method Details

    • builder

      static TypeInfo.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      static TypeInfo.Builder builder(TypeInfo instance)
      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • typeName

      TypeName typeName()
      The type name.
      Returns:
      the type name
    • description

      Optional<String> description()
      Description, such as javadoc, if available.
      Returns:
      description of this element
    • typeKind

      @Deprecated(forRemoval=true, since="4.1.0") String typeKind()
      Deprecated, for removal: This API element is subject to removal in a future version.
      use kind() instead
      The type element kind.

      Such as

      Returns:
      the type element kind.
      See Also:
    • kind

      ElementKind kind()
      Returns:
      element kind of this type
    • elementInfo

      List<TypedElementInfo> elementInfo()
      The elements that make up the type that are relevant for processing.
      Returns:
      the elements that make up the type that are relevant for processing
    • otherElementInfo

      List<TypedElementInfo> otherElementInfo()
      The elements that make up this type that are considered "other", or being skipped because they are irrelevant to processing.
      Returns:
      the elements that still make up the type, but are otherwise deemed irrelevant for processing
    • referencedTypeNamesToAnnotations

      Map<TypeName,List<Annotation>> referencedTypeNamesToAnnotations()
      Any Map, List, Set, or method that has TypeNameBlueprint.typeArguments() will be analyzed and any type arguments will have its annotations added here. Note that this only applies to non-built-in types.
      Returns:
      all referenced types
    • hasMetaAnnotation

      default boolean hasMetaAnnotation(TypeName annotation, TypeName metaAnnotation)
      Check if an annotation type has a specific meta annotation.
      Parameters:
      annotation - annotation to check meta annotation for
      metaAnnotation - meta annotation type
      Returns:
      whether the meta annotation is present on the annotation
    • hasMetaAnnotation

      default boolean hasMetaAnnotation(TypeName annotation, TypeName metaAnnotation, boolean inherited)
      Check if an annotation type has a specific meta annotation.
      Parameters:
      annotation - annotation to check meta annotation for
      metaAnnotation - meta annotation type
      inherited - whether to include meta annotations of meta annotations
      Returns:
      whether the meta annotation is present on the annotation
    • metaAnnotation

      default Optional<Annotation> metaAnnotation(TypeName annotation, TypeName metaAnnotation)
      Find a meta annotation.
      Parameters:
      annotation - annotation to check meta annotation for
      metaAnnotation - meta annotation type
      Returns:
      meta annotation, or empty if not defined
    • metaAnnotation

      default Optional<Annotation> metaAnnotation(TypeName annotation, TypeName metaAnnotation, boolean inherited)
      Find a meta annotation.
      Parameters:
      annotation - annotation to check meta annotation for
      metaAnnotation - meta annotation type
      inherited - whether to include meta annotations of meta annotations
      Returns:
      meta annotation, or empty if not defined
    • referencedModuleNames

      Map<TypeName,String> referencedModuleNames()
      Populated if the (external) module name containing the type is known.
      Returns:
      type names to its associated defining module name
    • superTypeInfo

      Optional<TypeInfo> superTypeInfo()
      The parent/super class for this type info.
      Returns:
      the super type
    • interfaceTypeInfo

      List<TypeInfo> interfaceTypeInfo()
      The interface classes for this type info.
      Returns:
      the interface type info
    • modifiers

      @Deprecated(forRemoval=true, since="4.1.0") Set<String> modifiers()
      Deprecated, for removal: This API element is subject to removal in a future version.
      use elementModifiers() instead
      Element modifiers.
      Returns:
      element modifiers
      See Also:
    • elementModifiers

      Set<Modifier> elementModifiers()
      Type modifiers.
      Returns:
      set of modifiers that are present on the type (and that we understand)
      See Also:
    • accessModifier

      AccessModifier accessModifier()
      Access modifier.
      Returns:
      access modifier
    • module

      Optional<String> module()
      Module of this type, if available.
      Returns:
      module name
    • originatingElement

      Optional<Object> originatingElement()
      The element used to create this instance. The type of the object depends on the environment we are in - it may be an TypeElement in annotation processing, or a ClassInfo when using classpath scanning.
      Returns:
      originating element
    • moduleNameOf

      default Optional<String> moduleNameOf(TypeName typeName)
      Uses referencedModuleNames() to determine if the module name is known for the given type.
      Parameters:
      typeName - the type name to lookup
      Returns:
      the module name if it is known