org.pentaho.reporting.engine.classic.core.style
Class StyleKey

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.style.StyleKey
All Implemented Interfaces:
Serializable, Cloneable

public final class StyleKey
extends Object
implements Serializable, Cloneable

A style key represents a (key, class) pair. Style keys are used to access style attributes defined in a BandStyleSheet or an ElementStyleSheet

Note that this class also defines a static Hashtable in which all defined keys are stored.

Author:
Thomas Morgner
See Also:
BandStyleKeys, ElementStyleSheet, Serialized Form

Field Summary
 int identifier
          A unique int-key for the stylekey.
 String name
          The name of the style key.
 
Method Summary
static void assertNoNullEntries()
           
 Object clone()
           
 boolean equals(Object o)
          Indicates whether some other object is "equal to" this one.
static int getDefinedStyleKeyCount()
           
static StyleKey[] getDefinedStyleKeys()
           
 int getIdentifier()
           
 String getName()
          Returns the name of the key.
static StyleKey getStyleKey(String name)
          Returns the key with the specified name.
static StyleKey getStyleKey(String name, Class valueType)
          Returns the key with the specified name.
static StyleKey getStyleKey(String name, Class valueType, boolean trans, boolean inheritable)
          Returns the key with the specified name.
 Class getValueType()
          Returns the class of the value for this key.
 int hashCode()
          Returns a hash code value for the object.
 boolean isInheritable()
           
 boolean isTransient()
           
static void lock()
           
static void registerClass(Class c)
           
static void registerDefaults()
           
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public final String name
The name of the style key.


identifier

public final int identifier
A unique int-key for the stylekey.

Method Detail

getName

public String getName()
Returns the name of the key.

Returns:
the name.

getValueType

public Class getValueType()
Returns the class of the value for this key.

Returns:
the class.

getStyleKey

public static StyleKey getStyleKey(String name,
                                   Class valueType)
Returns the key with the specified name. The given type is not checked against a possibly alredy defined definition, it is assumed that the type is only given for a new key definition.

Parameters:
name - the name.
valueType - the class.
Returns:
the style key.

getStyleKey

public static StyleKey getStyleKey(String name,
                                   Class valueType,
                                   boolean trans,
                                   boolean inheritable)
Returns the key with the specified name. The given type is not checked against a possibly alredy defined definition, it is assumed that the type is only given for a new key definition.

Parameters:
name - the name.
valueType - the class.
inheritable - a flag indicating whether the value will be inherited from parent bands to child elements.
trans - a flag indicating whether the style property should be saved. Transient properties are temporary artifacts and should not be stored in report definitions.
Returns:
the style key.

lock

public static void lock()

getStyleKey

public static StyleKey getStyleKey(String name)
Returns the key with the specified name.

Parameters:
name - the name.
Returns:
the style key.

equals

public boolean equals(Object o)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class Object
Parameters:
o - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

hashCode

public int hashCode()
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.

isTransient

public boolean isTransient()

toString

public String toString()
Returns a string representation of the object.

Overrides:
toString in class Object
Returns:
a string representation of the object.

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

isInheritable

public boolean isInheritable()

getIdentifier

public int getIdentifier()

getDefinedStyleKeyCount

public static int getDefinedStyleKeyCount()

getDefinedStyleKeys

public static StyleKey[] getDefinedStyleKeys()

assertNoNullEntries

public static void assertNoNullEntries()

registerDefaults

public static void registerDefaults()

registerClass

public static void registerClass(Class c)