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.Elementdelegateprivate booleanisThrowableprivate MessageMethodmethodprivate javax.lang.model.type.TypeMirrorresolvedTypeprivate javax.lang.model.type.TypeMirrorreturnTypeprivate ThrowableTypethrowableType-
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.TypeMirrorasType()booleanequals(java.lang.Object obj)javax.lang.model.element.ElementgetDelegate()The element to delegate the default methods to.inthashCode()private voidinit()booleanisThrowable()Checks to see if the return type is an exception, extends Throwable or the value of aSupplieris a Throwable type.java.lang.Stringname()Returns the qualified class name of the return type.javax.lang.model.type.TypeMirrorresolvedType()Checks this type to see if there are any type arguments.ThrowableTypethrowableReturnType()Returns the exception return type ifReturnType.isThrowable()returnstrue.java.lang.StringtoString()-
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: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
-
isThrowable
public boolean isThrowable()
Description copied from interface:ReturnTypeChecks to see if the return type is an exception, extends Throwable or the value of aSupplieris a Throwable type.- Specified by:
isThrowablein interfaceReturnType- Returns:
trueif the return type is an exception, otherwisefalse.- See Also:
ReturnType.resolvedType()
-
name
public java.lang.String name()
Description copied from interface:ReturnTypeReturns the qualified class name of the return type.- Specified by:
namein interfaceReturnType- Returns:
- the qualified class name fo the return type.
-
throwableReturnType
public ThrowableType throwableReturnType()
Description copied from interface:ReturnTypeReturns the exception return type ifReturnType.isThrowable()returnstrue. Otherwisenullis returned.- Specified by:
throwableReturnTypein interfaceReturnType- Returns:
- an exception return type, otherwise
null.
-
resolvedType
public javax.lang.model.type.TypeMirror resolvedType()
Description copied from interface:ReturnTypeChecks 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
Supplierreturn type.- Specified by:
resolvedTypein interfaceReturnType- Returns:
- the resolved return type
-
init
private void init()
-
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
-
-