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 Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final Elementprivate final booleanprivate booleanprivate booleanprotected final TypeMirrorprivate booleanprivate booleanprotected final TypeMirrorprivate final TypeMirrorFields inherited from class AbstractClassType
elements, processingEnv, typeMirror, types -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateAptThrowableType(ProcessingEnvironment processingEnv, TypeMirror type) Creates a new descriptor that is not primitive. -
Method Summary
Modifier and TypeMethodDescriptionasType()intThe parameters needed to construct the throwable, if not using the default constructor.booleanThe element to delegate the default methods to.booleanChecks to see the throwable has a default constructor.inthashCode()booleanChecks to see if the throwable has a string and throwable (Throwable(String, Throwable)) constructor.booleanChecks to see if the throwable has a string (Throwable(String)) constructor.booleanChecks to see if the throwable has a throwable and string (Throwable(Throwable, String)) constructor.booleanChecks to see if the throwable has a string and throwable (Throwable(String, Throwable)) constructor.protected voidinit()Initializes the object.protected voidinit(List<? extends VariableElement> params) Allows for additional processing of parameters.booleanChecks if the throwable is a checked exception.name()Returns the qualified class name of the return type.toString()booleanChecks to see if the throwable has and can use a custom constructor.Methods inherited from class AbstractClassType
isAssignableFrom, isSameAs, isSubtypeOfMethods inherited from interface ClassType
isAssignableFrom, isSameAs, isSubtypeOfMethods inherited from interface DelegatingElement
accept, getAnnotation, getAnnotationMirrors, getAnnotationsByType, getEnclosedElements, getEnclosingElement, getKind, getModifiers, getSimpleName, isAnnotatedWithMethods inherited from interface ThrowableType
causeSetInConstructor
-
Field Details
-
type
-
isChecked
private final boolean isChecked -
delegate
-
defaultConstructor
private boolean defaultConstructor -
stringConstructor
private boolean stringConstructor -
throwableConstructor
private boolean throwableConstructor -
stringAndThrowableConstructor
private boolean stringAndThrowableConstructor -
throwableAndStringConstructor
private boolean throwableAndStringConstructor -
stringType
-
throwableType
-
-
Constructor Details
-
AptThrowableType
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
Allows for additional processing of parameters.- Parameters:
params- the parameters to be processed.
-
getDelegate
Description copied from interface:DelegatingElementThe element to delegate the default methods to.- Specified by:
getDelegatein interfaceDelegatingElement- Returns:
- the delegate
-
asType
- Specified by:
asTypein interfaceDelegatingElement- Specified by:
asTypein interfaceElement
-
hasDefaultConstructor
public boolean hasDefaultConstructor()Description copied from interface:ThrowableTypeChecks to see the throwable has a default constructor.- Specified by:
hasDefaultConstructorin interfaceThrowableType- Returns:
trueif the throwable has a default constructor, otherwisefalse.
-
hasStringAndThrowableConstructor
public boolean hasStringAndThrowableConstructor()Description copied from interface:ThrowableTypeChecks to see if the throwable has a string and throwable (Throwable(String, Throwable)) constructor.- Specified by:
hasStringAndThrowableConstructorin interfaceThrowableType- Returns:
trueif the throwable has both a string and throwable constructor, otherwisefalse.
-
hasStringConstructor
public boolean hasStringConstructor()Description copied from interface:ThrowableTypeChecks to see if the throwable has a string (Throwable(String)) constructor. Iftrue,Throwable.initCause(Throwable)can be used to set the throwable.- Specified by:
hasStringConstructorin interfaceThrowableType- Returns:
trueif the throwable has a string constructor, otherwisefalse.
-
hasThrowableAndStringConstructor
public boolean hasThrowableAndStringConstructor()Description copied from interface:ThrowableTypeChecks to see if the throwable has a throwable and string (Throwable(Throwable, String)) constructor.- Specified by:
hasThrowableAndStringConstructorin interfaceThrowableType- Returns:
trueif the throwable has both a throwable and string constructor, otherwisefalse.
-
hasThrowableConstructor
public boolean hasThrowableConstructor()Description copied from interface:ThrowableTypeChecks to see if the throwable has a string and throwable (Throwable(String, Throwable)) constructor.- Specified by:
hasThrowableConstructorin interfaceThrowableType- Returns:
trueif the throwable has a throwable constructor, otherwisefalse.
-
useConstructionParameters
public boolean useConstructionParameters()Description copied from interface:ThrowableTypeChecks to see if the throwable has and can use a custom constructor. Iftrue, the constructor parameters can be retrieved from theThrowableType.constructionParameters()method.- Specified by:
useConstructionParametersin interfaceThrowableType- Returns:
trueif the throwable has a custom constructor that can be used, otherwisefalse.
-
constructionParameters
Description copied from interface:ThrowableTypeThe 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:
constructionParametersin interfaceThrowableType- Returns:
- a set of construction parameters or an empty set.
-
isChecked
public boolean isChecked()Description copied from interface:ThrowableTypeChecks if the throwable is a checked exception. If the throwable is a checked exception,trueis returned, otherwisefalse.- Specified by:
isCheckedin interfaceThrowableType- Returns:
trueif the throwable is a checked exception, otherwisefalse.
-
name
Description copied from interface:ThrowableTypeReturns the qualified class name of the return type.- Specified by:
namein interfaceThrowableType- Returns:
- the qualified class name fo the return type.
-
hashCode
-
equals
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<ThrowableType>
-