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 Details

    • AttributeTypesManager

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

    • 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 newAttrTypes)
      Sets the map of known Attribute types.
      Parameters:
      newAttrTypes - the newAttribute types map.
      Throws:
      IllegalArgumentException - DOCUMENT ME!
    • getAttributeTypes

      public Map 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.