private static class ParameterFactory.AptParameter extends AbstractMessageObjectType implements Parameter
Parameter.ParameterType
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
formatterClass |
private boolean |
isVarArgs |
private javax.lang.model.element.VariableElement |
param |
private java.lang.Class<?> |
paramClass |
private Parameter.ParameterType |
parameterType |
private Pos |
pos |
private java.lang.String |
qualifiedType |
private Transform |
transform |
elements, typeMirror, types
Constructor and Description |
---|
AptParameter(javax.lang.model.util.Elements elements,
javax.lang.model.util.Types types,
java.lang.String qualifiedType,
javax.lang.model.element.VariableElement param,
java.lang.String formatterClass,
boolean isVarArgs)
Only allow construction from within the parent class.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Parameter other) |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
formatterClass()
The formatter class, or
null if there is none. |
int |
hashCode() |
boolean |
isArray()
Returns
true if the type is an array, otherwise false . |
boolean |
isPrimitive()
Returns
true if the type is a primitive type, otherwise false . |
boolean |
isVarArgs()
Returns
true if the parameter is a var args parameter, otherwise false . |
java.lang.String |
name()
The variable name of the parameter.
|
java.lang.Class<?> |
paramClass()
Returns the class if the parameter is annotated with
Param . |
Parameter.ParameterType |
parameterType()
Returns the
parameter type of the parameter. |
Pos |
pos()
The position annotation if this the
Parameter.parameterType() is Parameter.ParameterType.POS . |
javax.lang.model.element.VariableElement |
reference()
The object used to extract information for the message logger or message bundle, if applicable.
|
java.lang.String |
targetName()
Returns the name of the target field or method.
|
java.lang.String |
toString() |
Transform |
transform()
The transform type if this the
Parameter.parameterType() is Parameter.ParameterType.TRANSFORM . |
java.lang.String |
type()
Returns the qualified type name of the object.
|
isAssignableFrom, isSameAs, isSubtypeOf
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isAssignableFrom, isSameAs, isSubtypeOf
private final javax.lang.model.element.VariableElement param
private final java.lang.String qualifiedType
private final java.lang.String formatterClass
private final java.lang.Class<?> paramClass
private final boolean isVarArgs
private final Parameter.ParameterType parameterType
private final Transform transform
private final Pos pos
AptParameter(javax.lang.model.util.Elements elements, javax.lang.model.util.Types types, java.lang.String qualifiedType, javax.lang.model.element.VariableElement param, java.lang.String formatterClass, boolean isVarArgs)
elements
- the element utilities from the annotation processor.types
- the type utilities from the annotation processor.qualifiedType
- the qualified type name of the parameter.param
- the parameter.formatterClass
- the formatter class, or null
if noneisVarArgs
- true
if this is a vararg parameter, otherwise false
.public java.lang.String type()
MessageObjectType
Object.class.getName()
type
in interface MessageObjectType
type
in interface Parameter
type
in class AbstractMessageObjectType
public java.lang.String formatterClass()
Parameter
null
if there is none.formatterClass
in interface Parameter
public java.lang.String name()
Parameter
name
in interface MessageObject
name
in interface Parameter
public boolean isArray()
Parameter
true
if the type is an array, otherwise false
.public boolean isPrimitive()
Parameter
true
if the type is a primitive type, otherwise false
.isPrimitive
in interface Parameter
true
if primitive type, otherwise false
public boolean isVarArgs()
Parameter
true
if the parameter is a var args parameter, otherwise false
.public Parameter.ParameterType parameterType()
Parameter
parameter type
of the parameter.parameterType
in interface Parameter
public java.lang.Class<?> paramClass()
Parameter
Param
.
If the annotation is not present, null
is returned.paramClass
in interface Parameter
null
.public java.lang.String targetName()
Parameter
Parameter.parameterType()
returns
Parameter.ParameterType.FIELD
, the target name is the name of the field to set on the
return type
. If no target name is defined an empty String
is
returned.targetName
in interface Parameter
public Transform transform()
Parameter
Parameter.parameterType()
is Parameter.ParameterType.TRANSFORM
.public Pos pos()
Parameter
Parameter.parameterType()
is Parameter.ParameterType.POS
.
This works the same way the formatter
positional characters work.
String.format("Numeric value %1$d (%1$x)"); @Message(""Numeric value %d (%x)"") void logNumericValue(@Pos(1) int value);
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int compareTo(Parameter other)
compareTo
in interface java.lang.Comparable<Parameter>
public java.lang.String toString()
toString
in class java.lang.Object
public javax.lang.model.element.VariableElement reference()
MessageObject
ExecutableElement
might be returned.reference
in interface MessageObject