private static class ReturnTypeFactory.AptReturnType extends AbstractMessageObjectType implements ReturnType
ReturnType.VoidReturnType
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,javax.lang.model.type.TypeMirror> |
fields |
private MessageMethod |
method |
private java.util.Map<java.lang.String,javax.lang.model.type.TypeMirror> |
methods |
private javax.lang.model.type.TypeMirror |
returnType |
private ThrowableType |
throwableType |
elements, typeMirror, types
VOID
Constructor and Description |
---|
AptReturnType(javax.lang.model.util.Elements elements,
javax.lang.model.util.Types types,
javax.lang.model.type.TypeMirror returnType,
MessageMethod method) |
Modifier and Type | Method and Description |
---|---|
private boolean |
checkType(Parameter parameter,
javax.lang.model.type.TypeMirror type) |
boolean |
equals(java.lang.Object obj) |
boolean |
hasFieldFor(Parameter parameter)
Checks to see if the return type has a field with the name with the same name and type as the
parameter . |
int |
hashCode() |
boolean |
hasMethodFor(Parameter parameter)
Checks to see if the return type has a method with the name with the same name and parameter type as the
parameter . |
private void |
init() |
boolean |
isPrimitive()
Indicates whether or not the return type is a primitive.
|
boolean |
isThrowable()
Checks to see if the return type is an exception, extends Throwable.
|
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.
|
ThrowableType |
throwableReturnType()
Returns the exception return type if
ReturnType.isThrowable() returns true . |
java.lang.String |
toString() |
private java.lang.String |
unbox(Parameter parameter) |
isAssignableFrom, isSameAs, isSubtypeOf, type
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isAssignableFrom, isSameAs, isSubtypeOf, type
private final java.util.Map<java.lang.String,javax.lang.model.type.TypeMirror> fields
private final java.util.Map<java.lang.String,javax.lang.model.type.TypeMirror> methods
private final javax.lang.model.type.TypeMirror returnType
private final MessageMethod method
private ThrowableType throwableType
AptReturnType(javax.lang.model.util.Elements elements, javax.lang.model.util.Types types, javax.lang.model.type.TypeMirror returnType, MessageMethod method)
public boolean hasFieldFor(Parameter parameter)
ReturnType
parameter
.hasFieldFor
in interface ReturnType
parameter
- the parameter to check.true
if the field exists, is accessible, mutable and is assignable from the type otherwise
false
.public boolean hasMethodFor(Parameter parameter)
ReturnType
parameter
.hasMethodFor
in interface ReturnType
parameter
- the parameter to check.true
if the method exists, is accessible and its parameter is assignable from the type, otherwise
false
.public boolean isThrowable()
ReturnType
isThrowable
in interface ReturnType
true
if the return type is an exception, otherwise
false
.public boolean isPrimitive()
ReturnType
isPrimitive
in interface ReturnType
true
if a primitive, otherwise false
.public java.lang.String name()
ReturnType
name
in interface MessageObject
name
in interface ReturnType
public ThrowableType throwableReturnType()
ReturnType
ReturnType.isThrowable()
returns true
. Otherwise null
is
returned.throwableReturnType
in interface ReturnType
null
.private void init()
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
private boolean checkType(Parameter parameter, javax.lang.model.type.TypeMirror type)
private java.lang.String unbox(Parameter parameter)