Interface JavaType<T extends JavaType<T>>

All Superinterfaces:
AnnotationTarget<T>, Internal, JavaDocCapable<T>, Named, Origin<T>, Packaged<T>, VisibilityScoped
All Known Subinterfaces:
EnumConstant.ReadBody<O>, EnumConstantSource.Body, JavaAnnotation<O>, JavaAnnotationSource, JavaClass<O>, JavaClassSource, JavaEnum<O>, JavaEnumSource, JavaInterface<O>, JavaInterfaceSource, JavaPackageInfo<O>, JavaPackageInfoSource, JavaRecord<O>, JavaRecordSource, JavaSource<T>

public interface JavaType<T extends JavaType<T>> extends Packaged<T>, Named, VisibilityScoped, AnnotationTarget<T>, JavaDocCapable<T>
Represents a Java type.
Author:
Lincoln Baxter, III
  • Method Details

    • getCanonicalName

      String getCanonicalName()
      Return the canonical name of this JavaType instance. This is equivalent to calling Class.getCanonicalName()
    • getQualifiedName

      String getQualifiedName()
      Get the qualified-name of this JavaType instance, where the qualified-name contains both the Java package and simple class name of the type represented by this JavaType instance.

      For example, calling: getQualifiedName() is equivalent to calling "Packaged.getPackage() + "." + Named.getName()", which in turn is equivalent to calling: Class.getName()

    • getSyntaxErrors

      List<SyntaxError> getSyntaxErrors()
      Get a list of all SyntaxErrors detected in the current JavaType. Note that when errors are present, the class may still be modified, but changes may not be completely accurate.
    • hasSyntaxErrors

      boolean hasSyntaxErrors()
      Return whether or not this JavaType currently has any SyntaxError s.
    • isClass

      boolean isClass()
      Return true if this JavaType represents a JavaClass
    • isEnum

      boolean isEnum()
      Return true if this JavaType represents a JavaEnum
    • isInterface

      boolean isInterface()
      Return true if this JavaType represents a JavaClass interface.
    • isAnnotation

      boolean isAnnotation()
      Return true if this JavaType represents a JavaAnnotation
    • isRecord

      boolean isRecord()
      Return true if this JavaType represents a JavaRecord
    • getEnclosingType

      JavaType<?> getEnclosingType()
      Return the enclosing JavaType type in which this class is defined. If this class is a top-level type, and is not a nested type, this object will return itself.
    • toUnformattedString

      String toUnformattedString()
      Return the generated code without any formatting.