Package org.jboss.logging.processor.apt
Class ParameterFactory.AptParameter
- java.lang.Object
-
- org.jboss.logging.processor.apt.AbstractClassType
-
- org.jboss.logging.processor.apt.ParameterFactory.AptParameter
-
- All Implemented Interfaces:
java.lang.Comparable<Parameter>
,javax.lang.model.AnnotatedConstruct
,javax.lang.model.element.Element
,ClassType
,DelegatingElement
,Parameter
- Enclosing class:
- ParameterFactory
private static class ParameterFactory.AptParameter extends AbstractClassType implements Parameter
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
formatterClass
private boolean
isFormatArg
private boolean
isVarArgs
private javax.lang.model.element.VariableElement
param
private java.lang.String
qualifiedType
-
Fields inherited from class org.jboss.logging.processor.apt.AbstractClassType
elements, processingEnv, typeMirror, types
-
-
Constructor Summary
Constructors Constructor Description AptParameter(javax.annotation.processing.ProcessingEnvironment processingEnv, java.lang.String qualifiedType, javax.lang.model.element.VariableElement param, java.lang.String formatterClass, boolean isVarArgs)
Only allow construction from within the parent class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Parameter other)
boolean
equals(java.lang.Object obj)
java.lang.String
formatterClass()
The formatter class, ornull
if there is none.javax.lang.model.element.Element
getDelegate()
The element to delegate the default methods to.int
hashCode()
boolean
isArray()
Returnstrue
if the type is an array, otherwisefalse
.boolean
isFormatParameter()
Indicates whether or not the parameter is used a format parameter for the message.boolean
isPrimitive()
Returnstrue
if the type is a primitive type, otherwisefalse
.boolean
isVarArgs()
Returnstrue
if the parameter is a var args parameter, otherwisefalse
.java.lang.String
name()
The variable name of the parameter.java.lang.String
targetName()
Returns the name of the target field or method.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, asType, getAnnotation, getAnnotationMirrors, getAnnotationsByType, getEnclosedElements, getEnclosingElement, getKind, getModifiers, getSimpleName, isAnnotatedWith
-
Methods inherited from interface org.jboss.logging.processor.model.Parameter
isMessageMethod
-
-
-
-
Constructor Detail
-
AptParameter
AptParameter(javax.annotation.processing.ProcessingEnvironment processingEnv, java.lang.String qualifiedType, javax.lang.model.element.VariableElement param, java.lang.String formatterClass, boolean isVarArgs)
Only allow construction from within the parent class.- Parameters:
processingEnv
- the annotation processing environment.qualifiedType
- the qualified type name of the parameter.param
- the parameter.formatterClass
- the formatter class, ornull
if noneisVarArgs
-true
if this is a vararg parameter, otherwisefalse
.
-
-
Method Detail
-
formatterClass
public java.lang.String formatterClass()
Description copied from interface:Parameter
The formatter class, ornull
if there is none.- Specified by:
formatterClass
in interfaceParameter
- Returns:
- the formatter class
-
name
public java.lang.String name()
Description copied from interface:Parameter
The variable name of the parameter.
-
isArray
public boolean isArray()
Description copied from interface:Parameter
Returnstrue
if the type is an array, otherwisefalse
.
-
isPrimitive
public boolean isPrimitive()
Description copied from interface:Parameter
Returnstrue
if the type is a primitive type, otherwisefalse
.- Specified by:
isPrimitive
in interfaceParameter
- Returns:
true
if primitive type, otherwisefalse
-
isVarArgs
public boolean isVarArgs()
Description copied from interface:Parameter
Returnstrue
if the parameter is a var args parameter, otherwisefalse
.
-
isFormatParameter
public boolean isFormatParameter()
Description copied from interface:Parameter
Indicates whether or not the parameter is used a format parameter for the message.- Specified by:
isFormatParameter
in interfaceParameter
- Returns:
true
if this parameter that should used as a format parameter for the message
-
targetName
public java.lang.String targetName()
Description copied from interface:Parameter
Returns the name of the target field or method. For example if the parameter is annotated with@Field
the target name is the name of the field to set on thereturn type
. If no target name is defined an empty String is returned.- Specified by:
targetName
in interfaceParameter
- Returns:
- the target field name, method name or an empty string.
-
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
-
compareTo
public int compareTo(Parameter other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Parameter>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
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
-
-