Package org.graffiti.attributes
Class AttributeTypesManager
java.lang.Object
org.graffiti.attributes.AttributeTypesManager
- All Implemented Interfaces:
PluginManagerListener
public class AttributeTypesManager extends Object implements PluginManagerListener
Provides a type manager for attributes. It contains the default attributes
from the package
org.graffiti.attributes
. Additional classes
implementing the org.graffiti.attributes.Attribute
-interface can
be added and then used in an arbitrary Attribute
hierarchy
associated with this AttributeTypesManager
.- Version:
- $Revision: 1.10 $
-
Constructor Summary
Constructors Constructor Description AttributeTypesManager()
Constructs a newAttributeTypesManager
. -
Method Summary
Modifier and Type Method Description void
addAttributeType(Class c)
Adds a givenAttribute
type class to the list of attribute types.Object
getAttributeInstance(String attrName, String id)
Returns an instance of the class that is associated with the name of the attribute.Map
getAttributeTypes()
Returns a map of all knownAttribute
types.void
pluginAdded(GenericPlugin plugin, PluginDescription desc)
Called by the plugin manager, iff a plugin has been added.void
setAttributeTypes(Map newAttrTypes)
Sets the map of knownAttribute
types.
-
Constructor Details
-
AttributeTypesManager
public AttributeTypesManager()Constructs a newAttributeTypesManager
. Loads the defaultAttribute
classes from the packageorg.graffiti.attributes
.
-
-
Method Details
-
getAttributeInstance
Returns an instance of the class that is associated with the name of the attribute.- Parameters:
attrName
- the name of the attribute type.id
- the id that is assigned to the new attribute.- Returns:
- an instance of the class that is associated with the name of the attribute.
-
setAttributeTypes
Sets the map of knownAttribute
types.- Parameters:
newAttrTypes
- the newAttribute
types map.- Throws:
IllegalArgumentException
- DOCUMENT ME!
-
getAttributeTypes
Returns a map of all knownAttribute
types.- Returns:
- a map of all known
Attribute
types.
-
addAttributeType
Adds a givenAttribute
type class to the list of attribute types.- Parameters:
c
- the attribute class to add.- Throws:
IllegalArgumentException
- DOCUMENT ME!
-
pluginAdded
Called by the plugin manager, iff a plugin has been added.- Specified by:
pluginAdded
in interfacePluginManagerListener
- Parameters:
plugin
- the added plugin.desc
- the description of the new plugin.
-