Package org.jboss.logging.processor.apt
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 boolean
private final Element
private final boolean
private boolean
private boolean
protected final TypeMirror
private boolean
private boolean
protected final TypeMirror
private final TypeMirror
Fields inherited from class org.jboss.logging.processor.apt.AbstractClassType
elements, processingEnv, typeMirror, types
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
AptThrowableType
(ProcessingEnvironment processingEnv, TypeMirror type) Creates a new descriptor that is not primitive. -
Method Summary
Modifier and TypeMethodDescriptionasType()
int
The parameters needed to construct the throwable, if not using the default constructor.boolean
The element to delegate the default methods to.boolean
Checks to see the throwable has a default constructor.int
hashCode()
boolean
Checks to see if the throwable has a string and throwable (Throwable(String, Throwable)
) constructor.boolean
Checks to see if the throwable has a string (Throwable(String)
) constructor.boolean
Checks to see if the throwable has a throwable and string (Throwable(Throwable, String)
) constructor.boolean
Checks to see if the throwable has a string and throwable (Throwable(String, Throwable)
) constructor.protected void
init()
Initializes the object.protected void
init
(List<? extends VariableElement> params) Allows for additional processing of parameters.boolean
Checks if the throwable is a checked exception.name()
Returns the qualified class name of the return type.toString()
boolean
Checks to see if the throwable has and can use a custom constructor.Methods inherited from class org.jboss.logging.processor.apt.AbstractClassType
isAssignableFrom, isSameAs, isSubtypeOf
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jboss.logging.processor.model.ClassType
isAssignableFrom, isSameAs, isSubtypeOf
Methods inherited from interface org.jboss.logging.processor.model.DelegatingElement
accept, getAnnotation, getAnnotationMirrors, getAnnotationsByType, getEnclosedElements, getEnclosingElement, getKind, getModifiers, getSimpleName, isAnnotatedWith
Methods inherited from interface org.jboss.logging.processor.model.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:DelegatingElement
The element to delegate the default methods to.- Specified by:
getDelegate
in interfaceDelegatingElement
- Returns:
- the delegate
-
asType
- Specified by:
asType
in interfaceDelegatingElement
- Specified by:
asType
in interfaceElement
-
hasDefaultConstructor
public boolean hasDefaultConstructor()Description copied from interface:ThrowableType
Checks to see the throwable has a default constructor.- Specified by:
hasDefaultConstructor
in interfaceThrowableType
- Returns:
true
if the throwable has a default constructor, otherwisefalse
.
-
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 interfaceThrowableType
- Returns:
true
if the throwable has both a string and throwable constructor, otherwisefalse
.
-
hasStringConstructor
public boolean hasStringConstructor()Description copied from interface:ThrowableType
Checks to see if the throwable has a string (Throwable(String)
) constructor. Iftrue
,Throwable.initCause(Throwable)
can be used to set the throwable.- Specified by:
hasStringConstructor
in interfaceThrowableType
- Returns:
true
if the throwable has a string constructor, otherwisefalse
.
-
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 interfaceThrowableType
- Returns:
true
if the throwable has both a throwable and string constructor, otherwisefalse
.
-
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 interfaceThrowableType
- Returns:
true
if the throwable has a throwable constructor, otherwisefalse
.
-
useConstructionParameters
public boolean useConstructionParameters()Description copied from interface:ThrowableType
Checks 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:
useConstructionParameters
in interfaceThrowableType
- Returns:
true
if the throwable has a custom constructor that can be used, otherwisefalse
.
-
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 interfaceThrowableType
- 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, otherwisefalse
.- Specified by:
isChecked
in interfaceThrowableType
- Returns:
true
if the throwable is a checked exception, otherwisefalse
.
-
name
Description copied from interface:ThrowableType
Returns the qualified class name of the return type.- Specified by:
name
in interfaceThrowableType
- Returns:
- the qualified class name fo the return type.
-
hashCode
public int hashCode() -
equals
-
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ThrowableType>
-