org.jvnet.annox.model
Class XAnnotation

java.lang.Object
  extended by org.jvnet.annox.model.XAnnotation

public class XAnnotation
extends Object

Defines an xannotation.

Author:
Aleksei Valikov

Field Summary
static XAnnotation[] EMPTY_ARRAY
          Empty array of annotations.
 
Constructor Summary
XAnnotation(Class<? extends Annotation> annotationClass, XAnnotationField<?>... fields)
          Constructs an xannotation for the given annotation class.
 
Method Summary
<T> T
accept(XAnnotationVisitor<T> visitor)
          Accepts the annotation visitor.
 boolean equals(Object obj)
           
 Class<? extends Annotation> getAnnotationClass()
          Returns the annotation class.
 List<XAnnotationField<?>> getFieldsList()
          Returns the list of the fields.
 Map<String,XAnnotationField<?>> getFieldsMap()
          Returns the map of the fields.
 Annotation getResult()
          Returns the instance of the annotation for this xannotation.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_ARRAY

public static XAnnotation[] EMPTY_ARRAY
Empty array of annotations.

Constructor Detail

XAnnotation

public XAnnotation(Class<? extends Annotation> annotationClass,
                   XAnnotationField<?>... fields)
            throws IllegalArgumentException
Constructs an xannotation for the given annotation class.

Parameters:
annotationClass - annotation class, must not be null
fields - fields of the xannotation.
Throws:
IllegalArgumentException - If annotation class is null, some required annotation fields are missing or some annotation fields have mismatching types.
Method Detail

getAnnotationClass

public Class<? extends Annotation> getAnnotationClass()
Returns the annotation class.

Returns:
annotation class.

getFieldsList

public List<XAnnotationField<?>> getFieldsList()
Returns the list of the fields.

Returns:
list of the fields.

getFieldsMap

public Map<String,XAnnotationField<?>> getFieldsMap()
Returns the map of the fields.

Returns:
map of the fields.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

getResult

public Annotation getResult()
Returns the instance of the annotation for this xannotation.

Returns:
Instance of the annotation for this xannotation.

accept

public <T> T accept(XAnnotationVisitor<T> visitor)
Accepts the annotation visitor.

Type Parameters:
T - Visitor result type.
Parameters:
visitor - visitor.
Returns:
Result of the visit.


Copyright © 2006-2011 Highsource. All Rights Reserved.