de.cau.cs.kieler.core.annotations
Enum AnnotationType

java.lang.Object
  extended by java.lang.Enum<AnnotationType>
      extended by de.cau.cs.kieler.core.annotations.AnnotationType
All Implemented Interfaces:
Comparable<AnnotationType>

public enum AnnotationType
extends Enum<AnnotationType>

Enumeration of annotation types and utility methods for conversion.

Rating red

Enum Constant Summary
BOOLEAN
          boolean annotation.
CONTAINMENT
          containment annotation.
FLOAT
          floating point annotation.
INT
          integer annotation.
NONE
          non-typed annotation.
REFERENCE
          reference annotation.
STRING
          string annotation.
TYPED_STRING
          typed string annotation.
 
Method Summary
 Annotation create()
          Create an annotation that corresponds to this annotation type.
static AnnotationType of(Annotation annotation)
          Determine the type of the given annotation.
static void setValue(Annotation annotation, Object value)
          Set a new annotation value from the given object.
static AnnotationType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static AnnotationType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NONE

public static final AnnotationType NONE
non-typed annotation.


STRING

public static final AnnotationType STRING
string annotation.


INT

public static final AnnotationType INT
integer annotation.


FLOAT

public static final AnnotationType FLOAT
floating point annotation.


BOOLEAN

public static final AnnotationType BOOLEAN
boolean annotation.


TYPED_STRING

public static final AnnotationType TYPED_STRING
typed string annotation.


REFERENCE

public static final AnnotationType REFERENCE
reference annotation.


CONTAINMENT

public static final AnnotationType CONTAINMENT
containment annotation.

Method Detail

values

public static AnnotationType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (AnnotationType c : AnnotationType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static AnnotationType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

of

public static AnnotationType of(Annotation annotation)
Determine the type of the given annotation.

Parameters:
annotation - an annotation
Returns:
the type of the annotation

setValue

public static void setValue(Annotation annotation,
                            Object value)
Set a new annotation value from the given object. If the value cannot be interpreted correctly, the method does nothing.

Parameters:
annotation - an annotation
value - a value in serialized or non-serialized form

create

public Annotation create()
Create an annotation that corresponds to this annotation type.

Returns:
a new annotation