Package org.jboss.logging.processor.apt
Class ThrowableTypeFactory.AptReturnThrowableType
- java.lang.Object
-
- org.jboss.logging.processor.apt.AbstractClassType
-
- org.jboss.logging.processor.apt.ThrowableTypeFactory.AptThrowableType
-
- org.jboss.logging.processor.apt.ThrowableTypeFactory.AptReturnThrowableType
-
- All Implemented Interfaces:
java.lang.Comparable<ThrowableType>
,javax.lang.model.AnnotatedConstruct
,javax.lang.model.element.Element
,ClassType
,DelegatingElement
,ThrowableType
- Enclosing class:
- ThrowableTypeFactory
private static class ThrowableTypeFactory.AptReturnThrowableType extends ThrowableTypeFactory.AptThrowableType
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
causeSet
private java.util.Set<Parameter>
constructionParameters
private MessageMethod
messageMethod
private boolean
useConstructionParameters
-
Fields inherited from class org.jboss.logging.processor.apt.ThrowableTypeFactory.AptThrowableType
stringType, throwableType
-
Fields inherited from class org.jboss.logging.processor.apt.AbstractClassType
elements, processingEnv, typeMirror, types
-
-
Constructor Summary
Constructors Modifier Constructor Description private
AptReturnThrowableType(javax.annotation.processing.ProcessingEnvironment processingEnv, MessageMethod messageMethod, javax.lang.model.type.TypeMirror type)
Creates a new descriptor that is not primitive.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
causeSetInConstructor()
Indicates whether or not the cause was set in the constructor.java.util.Set<Parameter>
constructionParameters()
The parameters needed to construct the throwable, if not using the default constructor.protected void
init()
Initializes the object.protected void
init(java.util.List<? extends javax.lang.model.element.VariableElement> params)
Allows for additional processing of parameters.boolean
useConstructionParameters()
Checks to see if the throwable has and can use a custom constructor.-
Methods inherited from class org.jboss.logging.processor.apt.ThrowableTypeFactory.AptThrowableType
asType, compareTo, equals, getDelegate, hasDefaultConstructor, hashCode, hasStringAndThrowableConstructor, hasStringConstructor, hasThrowableAndStringConstructor, hasThrowableConstructor, isChecked, name, toString
-
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
-
-
-
-
Field Detail
-
messageMethod
private final MessageMethod messageMethod
-
constructionParameters
private final java.util.Set<Parameter> constructionParameters
-
useConstructionParameters
private boolean useConstructionParameters
-
causeSet
private boolean causeSet
-
-
Constructor Detail
-
AptReturnThrowableType
private AptReturnThrowableType(javax.annotation.processing.ProcessingEnvironment processingEnv, MessageMethod messageMethod, javax.lang.model.type.TypeMirror type)
Creates a new descriptor that is not primitive.- Parameters:
processingEnv
- the annotation processing environment.messageMethod
- the message method.type
- the class name of the return type.
-
-
Method Detail
-
init
protected void init()
Description copied from class:ThrowableTypeFactory.AptThrowableType
Initializes the object.- Overrides:
init
in classThrowableTypeFactory.AptThrowableType
-
init
protected void init(java.util.List<? extends javax.lang.model.element.VariableElement> params)
Description copied from class:ThrowableTypeFactory.AptThrowableType
Allows for additional processing of parameters.- Overrides:
init
in classThrowableTypeFactory.AptThrowableType
- Parameters:
params
- the parameters to be processed.
-
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
- Overrides:
useConstructionParameters
in classThrowableTypeFactory.AptThrowableType
- Returns:
true
if the throwable has a custom constructor that can be used, otherwisefalse
.
-
causeSetInConstructor
public boolean causeSetInConstructor()
Description copied from interface:ThrowableType
Indicates whether or not the cause was set in the constructor.- Returns:
true
if the cause was set in the constructor,false
if theThrowable.initCause(Throwable)
should be executed
-
constructionParameters
public java.util.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 interfaceThrowableType
- Overrides:
constructionParameters
in classThrowableTypeFactory.AptThrowableType
- Returns:
- a set of construction parameters or an empty set.
-
-