Class ThrowableTypeFactory.AptThrowableType

java.lang.Object
org.jboss.logging.processor.apt.AbstractClassType
org.jboss.logging.processor.apt.ThrowableTypeFactory.AptThrowableType
All Implemented Interfaces:
Comparable<ThrowableType>, AnnotatedConstruct, Element, ClassType, DelegatingElement, ThrowableType
Direct Known Subclasses:
ThrowableTypeFactory.AptReturnThrowableType
Enclosing class:
ThrowableTypeFactory

private static class ThrowableTypeFactory.AptThrowableType extends AbstractClassType implements ThrowableType
  • Field Details

    • type

      private final TypeMirror type
    • isChecked

      private final boolean isChecked
    • delegate

      private final Element delegate
    • defaultConstructor

      private boolean defaultConstructor
    • stringConstructor

      private boolean stringConstructor
    • throwableConstructor

      private boolean throwableConstructor
    • stringAndThrowableConstructor

      private boolean stringAndThrowableConstructor
    • throwableAndStringConstructor

      private boolean throwableAndStringConstructor
    • stringType

      protected final TypeMirror stringType
    • throwableType

      protected final TypeMirror throwableType
  • Constructor Details

    • AptThrowableType

      private AptThrowableType(ProcessingEnvironment processingEnv, TypeMirror type)
      Creates a new descriptor that is not primitive.
      Parameters:
      processingEnv - the annotation processing environment.
      type - the class name of the return type.
  • Method Details

    • init

      protected void init()
      Initializes the object.
    • init

      protected void init(List<? extends VariableElement> params)
      Allows for additional processing of parameters.
      Parameters:
      params - the parameters to be processed.
    • getDelegate

      public Element getDelegate()
      Description copied from interface: DelegatingElement
      The element to delegate the default methods to.
      Specified by:
      getDelegate in interface DelegatingElement
      Returns:
      the delegate
    • asType

      public TypeMirror asType()
      Specified by:
      asType in interface DelegatingElement
      Specified by:
      asType in interface Element
    • hasDefaultConstructor

      public boolean hasDefaultConstructor()
      Description copied from interface: ThrowableType
      Checks to see the throwable has a default constructor.
      Specified by:
      hasDefaultConstructor in interface ThrowableType
      Returns:
      true if the throwable has a default constructor, otherwise false.
    • hasStringAndThrowableConstructor

      public boolean hasStringAndThrowableConstructor()
      Description copied from interface: ThrowableType
      Checks to see if the throwable has a string and throwable (Throwable(String, Throwable)) constructor.
      Specified by:
      hasStringAndThrowableConstructor in interface ThrowableType
      Returns:
      true if the throwable has both a string and throwable constructor, otherwise false.
    • hasStringConstructor

      public boolean hasStringConstructor()
      Description copied from interface: ThrowableType
      Checks to see if the throwable has a string (Throwable(String)) constructor.

      If true, Throwable.initCause(Throwable) can be used to set the throwable.

      Specified by:
      hasStringConstructor in interface ThrowableType
      Returns:
      true if the throwable has a string constructor, otherwise false.
    • hasThrowableAndStringConstructor

      public boolean hasThrowableAndStringConstructor()
      Description copied from interface: ThrowableType
      Checks to see if the throwable has a throwable and string (Throwable(Throwable, String)) constructor.
      Specified by:
      hasThrowableAndStringConstructor in interface ThrowableType
      Returns:
      true if the throwable has both a throwable and string constructor, otherwise false.
    • hasThrowableConstructor

      public boolean hasThrowableConstructor()
      Description copied from interface: ThrowableType
      Checks to see if the throwable has a string and throwable (Throwable(String, Throwable)) constructor.
      Specified by:
      hasThrowableConstructor in interface ThrowableType
      Returns:
      true if the throwable has a throwable constructor, otherwise false.
    • useConstructionParameters

      public boolean useConstructionParameters()
      Description copied from interface: ThrowableType
      Checks to see if the throwable has and can use a custom constructor.

      If true, the constructor parameters can be retrieved from the ThrowableType.constructionParameters() method.

      Specified by:
      useConstructionParameters in interface ThrowableType
      Returns:
      true if the throwable has a custom constructor that can be used, otherwise false.
    • constructionParameters

      public Set<Parameter> constructionParameters()
      Description copied from interface: ThrowableType
      The parameters needed to construct the throwable, if not using the default constructor. If the default constructor should be used an empty set should be returned.

      The order the set is returned is the order in which the parameters must be in for the constructor.

      Specified by:
      constructionParameters in interface ThrowableType
      Returns:
      a set of construction parameters or an empty set.
    • isChecked

      public boolean isChecked()
      Description copied from interface: ThrowableType
      Checks if the throwable is a checked exception. If the throwable is a checked exception, true is returned, otherwise false.
      Specified by:
      isChecked in interface ThrowableType
      Returns:
      true if the throwable is a checked exception, otherwise false.
    • name

      public String name()
      Description copied from interface: ThrowableType
      Returns the qualified class name of the return type.
      Specified by:
      name in interface ThrowableType
      Returns:
      the qualified class name fo the return type.
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Element
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface Element
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(ThrowableType o)
      Specified by:
      compareTo in interface Comparable<ThrowableType>