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:
java.lang.Comparable<ThrowableType>,javax.lang.model.AnnotatedConstruct,javax.lang.model.element.Element,ClassType,DelegatingElement,ThrowableType
- Direct Known Subclasses:
ThrowableTypeFactory.AptReturnThrowableType
- Enclosing class:
- ThrowableTypeFactory
private static class ThrowableTypeFactory.AptThrowableType extends AbstractClassType implements ThrowableType
-
-
Field Summary
Fields Modifier and Type Field Description private booleandefaultConstructorprivate javax.lang.model.element.Elementdelegateprivate booleanisCheckedprivate booleanstringAndThrowableConstructorprivate booleanstringConstructorprotected javax.lang.model.type.TypeMirrorstringTypeprivate booleanthrowableAndStringConstructorprivate booleanthrowableConstructorprotected javax.lang.model.type.TypeMirrorthrowableTypeprivate javax.lang.model.type.TypeMirrortype-
Fields inherited from class org.jboss.logging.processor.apt.AbstractClassType
elements, processingEnv, typeMirror, types
-
-
Constructor Summary
Constructors Modifier Constructor Description privateAptThrowableType(javax.annotation.processing.ProcessingEnvironment processingEnv, 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 javax.lang.model.type.TypeMirrorasType()intcompareTo(ThrowableType o)java.util.Set<Parameter>constructionParameters()The parameters needed to construct the throwable, if not using the default constructor.booleanequals(java.lang.Object obj)javax.lang.model.element.ElementgetDelegate()The element to delegate the default methods to.booleanhasDefaultConstructor()Checks to see the throwable has a default constructor.inthashCode()booleanhasStringAndThrowableConstructor()Checks to see if the throwable has a string and throwable (Throwable(String, Throwable)) constructor.booleanhasStringConstructor()Checks to see if the throwable has a string (Throwable(String)) constructor.booleanhasThrowableAndStringConstructor()Checks to see if the throwable has a throwable and string (Throwable(Throwable, String)) constructor.booleanhasThrowableConstructor()Checks to see if the throwable has a string and throwable (Throwable(String, Throwable)) constructor.protected voidinit()Initializes the object.protected voidinit(java.util.List<? extends javax.lang.model.element.VariableElement> params)Allows for additional processing of parameters.booleanisChecked()Checks if the throwable is a checked exception.java.lang.Stringname()Returns the qualified class name of the return type.java.lang.StringtoString()booleanuseConstructionParameters()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 Detail
-
type
private final javax.lang.model.type.TypeMirror type
-
isChecked
private final boolean isChecked
-
delegate
private final javax.lang.model.element.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 javax.lang.model.type.TypeMirror stringType
-
throwableType
protected final javax.lang.model.type.TypeMirror throwableType
-
-
Constructor Detail
-
AptThrowableType
private AptThrowableType(javax.annotation.processing.ProcessingEnvironment processingEnv, javax.lang.model.type.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 Detail
-
init
protected void init()
Initializes the object.
-
init
protected void init(java.util.List<? extends javax.lang.model.element.VariableElement> params)
Allows for additional processing of parameters.- Parameters:
params- the parameters to be processed.
-
getDelegate
public javax.lang.model.element.Element getDelegate()
Description copied from interface:DelegatingElementThe element to delegate the default methods to.- Specified by:
getDelegatein interfaceDelegatingElement- Returns:
- the delegate
-
asType
public javax.lang.model.type.TypeMirror asType()
- Specified by:
asTypein interfaceDelegatingElement- Specified by:
asTypein interfacejavax.lang.model.element.Element
-
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
public java.util.Set<Parameter> 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
public java.lang.String 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
public int hashCode()
- Specified by:
hashCodein interfacejavax.lang.model.element.Element- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin interfacejavax.lang.model.element.Element- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(ThrowableType o)
- Specified by:
compareToin interfacejava.lang.Comparable<ThrowableType>
-
-