private static class ThrowableTypeFactory.AptThrowableType extends AbstractMessageObjectType implements ThrowableType
Modifier and Type | Field and Description |
---|---|
private boolean |
defaultConstructor |
private boolean |
isChecked |
private boolean |
stringAndThrowableConstructor |
private boolean |
stringConstructor |
protected javax.lang.model.type.TypeMirror |
stringType |
private boolean |
throwableAndStringConstructor |
private boolean |
throwableConstructor |
protected javax.lang.model.type.TypeMirror |
throwableType |
private javax.lang.model.type.TypeMirror |
type |
elements, typeMirror, types
Modifier | Constructor and Description |
---|---|
private |
AptThrowableType(javax.lang.model.util.Elements elements,
javax.lang.model.util.Types types,
javax.lang.model.type.TypeMirror type)
Creates a new descriptor that is not primitive.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ThrowableType o) |
java.util.Set<Parameter> |
constructionParameters()
The parameters needed to construct the throwable, if not using the default constructor.
|
boolean |
equals(java.lang.Object obj) |
boolean |
hasDefaultConstructor()
Checks to see the throwable has a default constructor.
|
int |
hashCode() |
boolean |
hasStringAndThrowableConstructor()
Checks to see if the throwable has a string and throwable (
Throwable(String, Throwable) ) constructor. |
boolean |
hasStringConstructor()
Checks to see if the throwable has a string (
Throwable(String) ) constructor. |
boolean |
hasThrowableAndStringConstructor()
Checks to see if the throwable has a throwable and string (
Throwable(Throwable, String) ) constructor. |
boolean |
hasThrowableConstructor()
Checks to see if the throwable has a string and throwable (
Throwable(String, Throwable) ) 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 |
isChecked()
Checks if the throwable is a checked exception.
|
java.lang.String |
name()
Returns the qualified class name of the return type.
|
javax.lang.model.type.TypeMirror |
reference()
The object used to extract information for the message logger or message bundle, if applicable.
|
java.lang.String |
toString() |
boolean |
useConstructionParameters()
Checks to see if the throwable has and can use a custom constructor.
|
isAssignableFrom, isSameAs, isSubtypeOf, type
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isAssignableFrom, isSameAs, isSubtypeOf, type
private final javax.lang.model.type.TypeMirror type
private final boolean isChecked
private boolean defaultConstructor
private boolean stringConstructor
private boolean throwableConstructor
private boolean stringAndThrowableConstructor
private boolean throwableAndStringConstructor
protected final javax.lang.model.type.TypeMirror stringType
protected final javax.lang.model.type.TypeMirror throwableType
private AptThrowableType(javax.lang.model.util.Elements elements, javax.lang.model.util.Types types, javax.lang.model.type.TypeMirror type)
types
- the type utilities from the annotation processor.elements
- the element utilities from the annotation processor.type
- the class name of the return type.protected final void init()
protected void init(java.util.List<? extends javax.lang.model.element.VariableElement> params)
params
- the parameters to be processed.public boolean hasDefaultConstructor()
ThrowableType
hasDefaultConstructor
in interface ThrowableType
true
if the throwable has a default constructor, otherwise false
.public boolean hasStringAndThrowableConstructor()
ThrowableType
Throwable(String, Throwable)
) constructor.hasStringAndThrowableConstructor
in interface ThrowableType
true
if the throwable has both a string and throwable constructor, otherwise false
.public boolean hasStringConstructor()
ThrowableType
Throwable(String)
) constructor.
If true
, Throwable.initCause(Throwable)
can be used to set the throwable.hasStringConstructor
in interface ThrowableType
true
if the throwable has a string constructor, otherwise false
.public boolean hasThrowableAndStringConstructor()
ThrowableType
Throwable(Throwable, String)
) constructor.hasThrowableAndStringConstructor
in interface ThrowableType
true
if the throwable has both a throwable and string constructor, otherwise false
.public boolean hasThrowableConstructor()
ThrowableType
Throwable(String, Throwable)
) constructor.hasThrowableConstructor
in interface ThrowableType
true
if the throwable has a throwable constructor, otherwise false
.public boolean useConstructionParameters()
ThrowableType
true
, the constructor parameters can be retrieved from the ThrowableType.constructionParameters()
method.useConstructionParameters
in interface ThrowableType
true
if the throwable has a custom constructor that can be used, otherwise false
.public java.util.Set<Parameter> constructionParameters()
ThrowableType
constructionParameters
in interface ThrowableType
public boolean isChecked()
ThrowableType
true
is
returned, otherwise false
.isChecked
in interface ThrowableType
true
if the throwable is a checked exception, otherwise false
.public java.lang.String name()
ThrowableType
name
in interface MessageObject
name
in interface ThrowableType
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public javax.lang.model.type.TypeMirror reference()
MessageObject
ExecutableElement
might be returned.reference
in interface MessageObject
public int compareTo(ThrowableType o)
compareTo
in interface java.lang.Comparable<ThrowableType>