org.jvnet.annox.model
Class XAnnotationField<T>

java.lang.Object
  extended by org.jvnet.annox.model.XAnnotationField<T>
Type Parameters:
T - Type of the field.
Direct Known Subclasses:
XAnnotationField.XArrayField, XAnnotationField.XField

public abstract class XAnnotationField<T>
extends Object

Defines an annotation field.

Author:
Aleksei Valikov

Nested Class Summary
static class XAnnotationField.XAnnotation
           
static class XAnnotationField.XAnnotationArray
          Annotation array field.
static class XAnnotationField.XArrayField<T>
          Defines an array field.
static class XAnnotationField.XBoolean
           
static class XAnnotationField.XBooleanArray
           
static class XAnnotationField.XByte
           
static class XAnnotationField.XByteArray
           
static class XAnnotationField.XChar
           
static class XAnnotationField.XCharArray
           
static class XAnnotationField.XClass
           
static class XAnnotationField.XClassArray
           
static class XAnnotationField.XDouble
           
static class XAnnotationField.XDoubleArray
           
static class XAnnotationField.XEnum
           
static class XAnnotationField.XEnumArray
           
static class XAnnotationField.XField<T>
          Basic annotation field.
static class XAnnotationField.XFixedArrayField<T>
          Array field with fixed value.
static class XAnnotationField.XFixedField<T>
          Annotation field with a fixed value.
static class XAnnotationField.XFloat
           
static class XAnnotationField.XFloatArray
           
static class XAnnotationField.XInt
           
static class XAnnotationField.XIntArray
           
static class XAnnotationField.XLong
           
static class XAnnotationField.XLongArray
           
static class XAnnotationField.XShort
           
static class XAnnotationField.XShortArray
           
static class XAnnotationField.XString
           
static class XAnnotationField.XStringArray
           
 
Constructor Summary
XAnnotationField(String name)
          Constructrs an annotation field with the given name.
 
Method Summary
abstract
<P> P
accept(XAnnotationVisitor<P> visitor)
          Accepts the annotation visitor.
protected  Object getInternalValue()
          Returns the internal value of the field used for Object.hashCode(), Object.equals(Object) and Object.toString() operations.
 String getName()
          Returns the name of the field.
 Object getResult()
          Returns the result value of the field.
abstract  Class<?> getType()
          Return the type of the field.
abstract  T getValue()
          Returns the value of the field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 Object getInternalValue()
Returns the internal value of the field used for Object.hashCode(), Object.equals(Object) and Object.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(XAnnotationVisitor<P> visitor)
Accepts the annotation visitor.

Type Parameters:
P - Return type of the visitor.
Parameters:
visitor - visitor to accept.
Returns:
Result of the visit.


Copyright © 2006-2012 Highsource. All Rights Reserved.