org.graffiti.attributes
Class AttributeTypesManager

java.lang.Object
  extended by 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: 5779 $

Constructor Summary
AttributeTypesManager()
          Constructs a new AttributeTypesManager.
 
Method Summary
 void addAttributeType(Class<?> c)
          Adds a given Attribute 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<String,Class<?>> getAttributeTypes()
          Returns a map of all known Attribute types.
 void pluginAdded(GenericPlugin plugin, PluginDescription desc)
          Called by the plugin manager, iff a plugin has been added.
 void setAttributeTypes(Map<String,Class<?>> newAttrTypes)
          Sets the map of known Attribute types.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeTypesManager

public AttributeTypesManager()
Constructs a new AttributeTypesManager. Loads the default Attribute classes from the package org.graffiti.attributes.

Method Detail

getAttributeInstance

public Object getAttributeInstance(String attrName,
                                   String id)
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

public void setAttributeTypes(Map<String,Class<?>> newAttrTypes)
Sets the map of known Attribute types.

Parameters:
newAttrTypes - the newAttribute types map.
Throws:
IllegalArgumentException - DOCUMENT ME!

getAttributeTypes

public Map<String,Class<?>> getAttributeTypes()
Returns a map of all known Attribute types.

Returns:
a map of all known Attribute types.

addAttributeType

public void addAttributeType(Class<?> c)
Adds a given Attribute type class to the list of attribute types.

Parameters:
c - the attribute class to add.
Throws:
IllegalArgumentException - DOCUMENT ME!

pluginAdded

public void pluginAdded(GenericPlugin plugin,
                        PluginDescription desc)
Called by the plugin manager, iff a plugin has been added.

Specified by:
pluginAdded in interface PluginManagerListener
Parameters:
plugin - the added plugin.
desc - the description of the new plugin.


Generated at 2012-05-30 11:00:36 PM CEST