org.openpermis.editor.policy.gui
Enum IconAnnotation

java.lang.Object
  extended by java.lang.Enum<IconAnnotation>
      extended by org.openpermis.editor.policy.gui.IconAnnotation
All Implemented Interfaces:
Serializable, Comparable<IconAnnotation>

public enum IconAnnotation
extends Enum<IconAnnotation>

Annotations for icons.

Since:
0.3.0

Enum Constant Summary
ADD
          Add annotation.
DELETE
          Delete annotation.
EDIT
          Edit annotation.
WARNING
          Warning sign annotation.
 
Field Summary
private static char END
          End character for annotations.
private  String key
          The annotation key.
private static String SEPARATOR
          Separator string for annotations.
private static char START
          Start character for annotations.
 
Method Summary
 String annotate(String iconKey)
          Annotates the specified icon key with this annotation.
static String[] decompose(String iconKey)
          Decomposes an annotated key into its parts.
(package private) static IconAnnotation[] getAnnotations(String iconKey)
          Returns an array of annotations defined in the specified icon key.
private static IconAnnotation getIconAnnotation(String annotation)
          Performs a lookup of an annotation.
 String getKey()
          Returns the lower case key of the icon annotation.
static String getKey(String iconKey)
          Returns the key portion of a possibly annotated icon key.
static boolean isAnnotated(String iconKey)
          Tests if an icon key is annotated.
(package private)  boolean isAnnotation(String annotation)
          Check if the specified annotation is string denotes the same annotation as this one.
(package private) static String[] split(String iconKey)
          Splits the icon key specified into a key and an annotation part.
 String toString()
           
static IconAnnotation valueOf(String name)
          Returns the enum constant of this type with the specified name.
static IconAnnotation[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ADD

public static final IconAnnotation ADD
Add annotation.

Since:
0.3.0

DELETE

public static final IconAnnotation DELETE
Delete annotation.

Since:
0.3.0

EDIT

public static final IconAnnotation EDIT
Edit annotation.

Since:
0.3.0

WARNING

public static final IconAnnotation WARNING
Warning sign annotation.

Since:
0.3.0
Field Detail

START

private static final char START
Start character for annotations.

Constant Field Value:
91
Since:
0.3.0

END

private static final char END
End character for annotations.

Constant Field Value:
93
Since:
0.3.0

SEPARATOR

private static final String SEPARATOR
Separator string for annotations.

Constant Field Value:
","
Since:
0.3.0

key

private final String key
The annotation key.

Since:
0.3.0
Method Detail

values

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

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

valueOf

public static IconAnnotation 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

isAnnotated

public static boolean isAnnotated(String iconKey)
Tests if an icon key is annotated.

Parameters:
iconKey - the icon key to test.
Returns:
true if the key is annotated, false otherwise.
Since:
0.3.0

split

static final String[] split(String iconKey)
Splits the icon key specified into a key and an annotation part.

Parameters:
iconKey - the icon key to split.
Returns:
an array consisting of the key and annotation part.
Since:
0.3.0

getIconAnnotation

private static final IconAnnotation getIconAnnotation(String annotation)
Performs a lookup of an annotation.

Parameters:
annotation - the annotation to lookup.
Returns:
the corresponding icon annotation.
Since:
0.3.0

getAnnotations

static IconAnnotation[] getAnnotations(String iconKey)
Returns an array of annotations defined in the specified icon key.

Parameters:
iconKey - the icon key for which to retrieve the annotations.
Returns:
the array of annotations, never null.
Throws:
IllegalArgumentException - if an unknown annotation is encountered.
Since:
0.3.0

getKey

public static String getKey(String iconKey)
Returns the key portion of a possibly annotated icon key.

Parameters:
iconKey - the icon key for which to retrieve the key portion.
Returns:
the key requested.
Since:
0.3.0

decompose

public static String[] decompose(String iconKey)
Decomposes an annotated key into its parts.

Parameters:
iconKey - the icon key to decompose.
Returns:
an array of individual keys.
Throws:
IllegalArgumentException - if an unknown annotation is encountered.
Since:
0.3.0

isAnnotation

boolean isAnnotation(String annotation)
Check if the specified annotation is string denotes the same annotation as this one.

Parameters:
annotation - the annotation to test.
Returns:
true if the annotation corresponds to this one, false otherwise.
Since:
0.3.0

annotate

public String annotate(String iconKey)
Annotates the specified icon key with this annotation.

Parameters:
iconKey - the icon key to annotate, must not be null.
Returns:
the annotated icon key.
Since:
0.3.0

getKey

public String getKey()
Returns the lower case key of the icon annotation.

Returns:
the lower case key of the icon annotation.
Since:
0.3.0

toString

public String toString()
Overrides:
toString in class Enum<IconAnnotation>
Since:
0.3.0


PERMIS Role Based Access Control 0.3.0 (Build 14)
2009/05/08 09:06:48
Copyright (c) 2002-2007 Ergon Informatik AG