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 voidaddAttributeType(Class c)Adds a givenAttributetype class to the list of attribute types.ObjectgetAttributeInstance(String attrName, String id)Returns an instance of the class that is associated with the name of the attribute.MapgetAttributeTypes()Returns a map of all knownAttributetypes.voidpluginAdded(GenericPlugin plugin, PluginDescription desc)Called by the plugin manager, iff a plugin has been added.voidsetAttributeTypes(Map newAttrTypes)Sets the map of knownAttributetypes.
-
Constructor Details
-
AttributeTypesManager
public AttributeTypesManager()Constructs a newAttributeTypesManager. Loads the defaultAttributeclasses 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 knownAttributetypes.- Parameters:
newAttrTypes- the newAttributetypes map.- Throws:
IllegalArgumentException- DOCUMENT ME!
-
getAttributeTypes
Returns a map of all knownAttributetypes.- Returns:
- a map of all known
Attributetypes.
-
addAttributeType
Adds a givenAttributetype 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:
pluginAddedin interfacePluginManagerListener- Parameters:
plugin- the added plugin.desc- the description of the new plugin.
-