org.jfree.report.modules.parser.ext.factory.stylekey
Class AbstractStyleKeyFactory

java.lang.Object
  |
  +--org.jfree.report.modules.parser.ext.factory.stylekey.AbstractStyleKeyFactory
Direct Known Subclasses:
DefaultStyleKeyFactory, PageableLayoutStyleKeyFactory

public abstract class AbstractStyleKeyFactory
extends java.lang.Object
implements StyleKeyFactory

An abstract class for implementing the StyleKeyFactory interface.

Author:
Thomas Morgner.
See Also:
Serialized Form

Field Summary
static java.lang.String OBJECT_FACTORY_TAG
          the parser configuration property name for this factory.
 
Constructor Summary
AbstractStyleKeyFactory()
          Creates a new factory.
 
Method Summary
 void addKey(StyleKey key)
          Registers a key.
 java.lang.Object createBasicObject(StyleKey k, java.lang.String value, java.lang.Class c, org.jfree.xml.factory.objects.ClassFactory fc)
          Creates an object.
 boolean equals(java.lang.Object o)
          Indicated whether an other object is equal to this one.
 java.util.Iterator getRegisteredKeys()
          Returns an iterator that provides access to the registered keys.
 StyleKey getStyleKey(java.lang.String name)
          Returns the key with the given name.
 int hashCode()
          Computes an hashcode for this factory.
protected  void loadFromClass(java.lang.Class c)
          Loads all public static stylekeys which are declared in the given class.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OBJECT_FACTORY_TAG

public static final java.lang.String OBJECT_FACTORY_TAG
the parser configuration property name for this factory.
Constructor Detail

AbstractStyleKeyFactory

public AbstractStyleKeyFactory()
Creates a new factory.
Method Detail

addKey

public void addKey(StyleKey key)
Registers a key.
Parameters:
key - the key.

getStyleKey

public StyleKey getStyleKey(java.lang.String name)
Returns the key with the given name.
Specified by:
getStyleKey in interface StyleKeyFactory
Parameters:
name - the name.
Returns:
The key.

createBasicObject

public java.lang.Object createBasicObject(StyleKey k,
                                          java.lang.String value,
                                          java.lang.Class c,
                                          org.jfree.xml.factory.objects.ClassFactory fc)
Creates an object.
Specified by:
createBasicObject in interface StyleKeyFactory
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(java.lang.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:
java.lang.SecurityException - if the current security settings deny class access.

getRegisteredKeys

public java.util.Iterator getRegisteredKeys()
Returns an iterator that provides access to the registered keys.
Specified by:
getRegisteredKeys in interface StyleKeyFactory
Returns:
The iterator.

equals

public boolean equals(java.lang.Object o)
Indicated whether an other object is equal to this one.
Overrides:
equals in class java.lang.Object
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 class java.lang.Object
Returns:
the hashcode.
See Also:
Object.hashCode()