Package org.jboss.logging.processor.apt
Class ReturnTypeFactory.AptReturnType
- java.lang.Object
-
- org.jboss.logging.processor.apt.AbstractClassType
-
- org.jboss.logging.processor.apt.ReturnTypeFactory.AptReturnType
-
- All Implemented Interfaces:
javax.lang.model.AnnotatedConstruct
,javax.lang.model.element.Element
,ClassType
,DelegatingElement
,ReturnType
- Enclosing class:
- ReturnTypeFactory
private static class ReturnTypeFactory.AptReturnType extends AbstractClassType implements ReturnType
Implementation of return type.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.lang.model.element.Element
delegate
private boolean
isThrowable
private MessageMethod
method
private javax.lang.model.type.TypeMirror
resolvedType
private javax.lang.model.type.TypeMirror
returnType
private ThrowableType
throwableType
-
Fields inherited from class org.jboss.logging.processor.apt.AbstractClassType
elements, processingEnv, typeMirror, types
-
-
Constructor Summary
Constructors Constructor Description AptReturnType(javax.annotation.processing.ProcessingEnvironment processingEnv, javax.lang.model.type.TypeMirror returnType, MessageMethod method)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.lang.model.type.TypeMirror
asType()
boolean
equals(java.lang.Object obj)
javax.lang.model.element.Element
getDelegate()
The element to delegate the default methods to.int
hashCode()
private void
init()
boolean
isThrowable()
Checks to see if the return type is an exception, extends Throwable or the value of aSupplier
is a Throwable type.java.lang.String
name()
Returns the qualified class name of the return type.javax.lang.model.type.TypeMirror
resolvedType()
Checks this type to see if there are any type arguments.ThrowableType
throwableReturnType()
Returns the exception return type ifReturnType.isThrowable()
returnstrue
.java.lang.String
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
-
returnType
private final javax.lang.model.type.TypeMirror returnType
-
method
private final MessageMethod method
-
delegate
private final javax.lang.model.element.Element delegate
-
resolvedType
private final javax.lang.model.type.TypeMirror resolvedType
-
isThrowable
private final boolean isThrowable
-
throwableType
private ThrowableType throwableType
-
-
Constructor Detail
-
AptReturnType
AptReturnType(javax.annotation.processing.ProcessingEnvironment processingEnv, javax.lang.model.type.TypeMirror returnType, MessageMethod method)
-
-
Method Detail
-
getDelegate
public javax.lang.model.element.Element getDelegate()
Description copied from interface:DelegatingElement
The element to delegate the default methods to.- Specified by:
getDelegate
in interfaceDelegatingElement
- Returns:
- the delegate
-
asType
public javax.lang.model.type.TypeMirror asType()
- Specified by:
asType
in interfaceDelegatingElement
- Specified by:
asType
in interfacejavax.lang.model.element.Element
-
isThrowable
public boolean isThrowable()
Description copied from interface:ReturnType
Checks to see if the return type is an exception, extends Throwable or the value of aSupplier
is a Throwable type.- Specified by:
isThrowable
in interfaceReturnType
- Returns:
true
if the return type is an exception, otherwisefalse
.- See Also:
ReturnType.resolvedType()
-
name
public java.lang.String name()
Description copied from interface:ReturnType
Returns the qualified class name of the return type.- Specified by:
name
in interfaceReturnType
- Returns:
- the qualified class name fo the return type.
-
throwableReturnType
public ThrowableType throwableReturnType()
Description copied from interface:ReturnType
Returns the exception return type ifReturnType.isThrowable()
returnstrue
. Otherwisenull
is returned.- Specified by:
throwableReturnType
in interfaceReturnType
- Returns:
- an exception return type, otherwise
null
.
-
resolvedType
public javax.lang.model.type.TypeMirror resolvedType()
Description copied from interface:ReturnType
Checks this type to see if there are any type arguments. If any type arguments are found the first type is returned and assumed to be the resolved type. Otherwise this type is returned.This is useful for the
Supplier
return type.- Specified by:
resolvedType
in interfaceReturnType
- Returns:
- the resolved return type
-
init
private void init()
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejavax.lang.model.element.Element
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfacejavax.lang.model.element.Element
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-