Class XAnnotationField<T>
- java.lang.Object
-
- org.jvnet.jaxb.annox.model.annotation.field.XAnnotationField<T>
-
- Type Parameters:
T- Type of the field.
- Direct Known Subclasses:
XArrayAnnotationField,XSingleAnnotationField
public abstract class XAnnotationField<T> extends Object
Defines an annotation field.- Author:
- Aleksei Valikov
-
-
Constructor Summary
Constructors Constructor Description XAnnotationField(String name)Constructrs an annotation field with the given name.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract <P> Paccept(XAnnotationFieldVisitor<P> visitor)Accepts the annotation visitor.protected ObjectgetInternalValue()Returns the internal value of the field used forObject.hashCode(),Object.equals(Object)andObject.toString()operations.StringgetName()Returns the name of the field.ObjectgetResult()Returns the result value of the field.abstract Class<?>getType()Return the type of the field.abstract TgetValue()Returns the value of the field.
-
-
-
Constructor Detail
-
XAnnotationField
public XAnnotationField(String name)
Constructrs an annotation field with the given name.- Parameters:
name- name of the field.
-
-
Method Detail
-
getName
public String getName()
Returns the name of the field.- Returns:
- Name of the field.
-
getValue
public abstract T getValue()
Returns the value of the field.- Returns:
- Value of the field.
-
getInternalValue
protected final Object getInternalValue()
Returns the internal value of the field used forObject.hashCode(),Object.equals(Object)andObject.toString()operations. Defaults to the value of the field.- Returns:
- Returns the value of the field.
-
getResult
public Object getResult()
Returns the result value of the field. By default, returns the value of the field.- Returns:
- Result value of the field.
-
getType
public abstract Class<?> getType()
Return the type of the field.- Returns:
- Type of the field.
-
accept
public abstract <P> P accept(XAnnotationFieldVisitor<P> visitor)
Accepts the annotation visitor.- Type Parameters:
P- Return type of the visitor.- Parameters:
visitor- visitor to accept.- Returns:
- Result of the visit.
-
-