Class AbstractStyleKeyFactory
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.modules.parser.ext.factory.stylekey.AbstractStyleKeyFactory
-
- All Implemented Interfaces:
Serializable
,StyleKeyFactory
- Direct Known Subclasses:
DefaultStyleKeyFactory
,PageableLayoutStyleKeyFactory
public abstract class AbstractStyleKeyFactory extends Object implements StyleKeyFactory
An abstract class for implementing theStyleKeyFactory
interface.- Author:
- Thomas Morgner.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractStyleKeyFactory()
Creates a new factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addKey(StyleKey key)
Registers a key.Object
createBasicObject(StyleKey k, String value, Class c, ClassFactory fc)
Creates an object.boolean
equals(Object o)
Indicated whether an other object is equal to this one.Iterator
getRegisteredKeys()
Returns an iterator that provides access to the registered keys.StyleKey
getStyleKey(String name)
Returns the key with the given name.int
hashCode()
Computes an hashcode for this factory.protected void
loadFromClass(Class c)
Loads all public static stylekeys which are declared in the given class.
-
-
-
Method Detail
-
addKey
public void addKey(StyleKey key)
Registers a key.- Parameters:
key
- the key.
-
getStyleKey
public StyleKey getStyleKey(String name)
Returns the key with the given name.- Specified by:
getStyleKey
in interfaceStyleKeyFactory
- Parameters:
name
- the name.- Returns:
- The key.
-
createBasicObject
public Object createBasicObject(StyleKey k, String value, Class c, ClassFactory fc)
Creates an object.- Specified by:
createBasicObject
in interfaceStyleKeyFactory
- Parameters:
k
- the style key.value
- the value.c
- the class.fc
- the class factory used to create the basic object.- Returns:
- The object.
-
loadFromClass
protected void loadFromClass(Class c)
Loads all public static stylekeys which are declared in the given class.- Parameters:
c
- the class from where to load the stylekeys.- Throws:
SecurityException
- if the current security settings deny class access.
-
getRegisteredKeys
public Iterator getRegisteredKeys()
Returns an iterator that provides access to the registered keys.- Specified by:
getRegisteredKeys
in interfaceStyleKeyFactory
- Returns:
- The iterator.
-
equals
public boolean equals(Object o)
Indicated whether an other object is equal to this one.- Overrides:
equals
in classObject
- Parameters:
o
- the other object.- Returns:
- true, if the object is equal, false otherwise.
- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
Computes an hashcode for this factory.- Overrides:
hashCode
in classObject
- Returns:
- the hashcode.
- See Also:
Object.hashCode()
-
-