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, isSubtypeOfclone, finalize, getClass, notify, notifyAll, wait, wait, waitisAssignableFrom, isSameAs, isSubtypeOfprivate 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()
MessageObjectTypeObject.class.getName()type in interface MessageObjectTypetype in interface Parametertype in class AbstractMessageObjectTypepublic java.lang.String formatterClass()
Parameternull if there is none.formatterClass in interface Parameterpublic java.lang.String name()
Parametername in interface MessageObjectname in interface Parameterpublic boolean isArray()
Parametertrue if the type is an array, otherwise false.public boolean isPrimitive()
Parametertrue if the type is a primitive type, otherwise false.isPrimitive in interface Parametertrue if primitive type, otherwise falsepublic boolean isVarArgs()
Parametertrue if the parameter is a var args parameter, otherwise false.public Parameter.ParameterType parameterType()
Parameterparameter type of the parameter.parameterType in interface Parameterpublic java.lang.Class<?> paramClass()
ParameterParam.
If the annotation is not present, null is returned.paramClass in interface Parameternull.public java.lang.String targetName()
ParameterParameter.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 Parameterpublic Transform transform()
ParameterParameter.parameterType() is Parameter.ParameterType.TRANSFORM.public Pos pos()
ParameterParameter.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.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int compareTo(Parameter other)
compareTo in interface java.lang.Comparable<Parameter>public java.lang.String toString()
toString in class java.lang.Objectpublic javax.lang.model.element.VariableElement reference()
MessageObjectExecutableElement
might be returned.reference in interface MessageObject