Class StyleKey
- java.lang.Object
-
- 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 aBandStyleSheet
or anElementStyleSheet
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
Fields Modifier and Type Field Description int
identifier
A unique int-key for the stylekey.String
name
The name of the style key.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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()
static List<StyleKey>
getDefinedStyleKeysList()
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.
-
-
-
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.
-
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 byjava.util.Hashtable
.
-
isTransient
public boolean isTransient()
-
toString
public String toString()
Returns a string representation of the object.
-
clone
public Object clone() throws CloneNotSupportedException
- Overrides:
clone
in classObject
- 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)
-
-