org.oddjob.designer.factory
Class DesignFactoryBean

java.lang.Object
  extended byorg.oddjob.designer.factory.DesignFactoryBean

public class DesignFactoryBean
extends java.lang.Object

A factory which can create DesignComponents and DesignElements.


Field Summary
static org.apache.log4j.Logger logger
           
static java.lang.String UNKNOWN_TAG
           
 
Constructor Summary
DesignFactoryBean(java.io.InputStream in)
          Constructor.
 
Method Summary
 void addConfiguredCompDef(ComponentDefinition compdef)
          Called during parsing of the XML with each ComponentDefinition.
 void addConfiguredTypeDef(TypeDefinition typedef)
          Called during parsing of the XML with each TypeDefinition.
 java.lang.String[] allTypes()
           
 SimpleHierarchy childActions(java.lang.Object subject, java.lang.String element)
          Returns a hierarchy of ComponentAction objects which can be used in a hierarchical menu structure for creating and adding components.
 ObjectFactory componentFactory()
          Creates a ObjectFactory which creates components.
 DesignComponent createComponent(java.lang.String name)
          Create a component for the given name.
 DesignElementType createType(java.lang.String name)
          Creat a type for the given type name.
 java.lang.String[] supportedTypes(java.lang.Class type)
          Return supported child type for a given type.
 java.lang.String[] supportedTypes(TypeDefinition typedef)
           
 ObjectFactory valueFactory()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static org.apache.log4j.Logger logger

UNKNOWN_TAG

public static final java.lang.String UNKNOWN_TAG
See Also:
Constant Field Values
Constructor Detail

DesignFactoryBean

public DesignFactoryBean(java.io.InputStream in)
Constructor. Loads the factory.

Method Detail

addConfiguredCompDef

public void addConfiguredCompDef(ComponentDefinition compdef)
Called during parsing of the XML with each ComponentDefinition.

Parameters:
compdef - A ComponentDefinition.

addConfiguredTypeDef

public void addConfiguredTypeDef(TypeDefinition typedef)
Called during parsing of the XML with each TypeDefinition.


childActions

public SimpleHierarchy childActions(java.lang.Object subject,
                                    java.lang.String element)
Returns a hierarchy of ComponentAction objects which can be used in a hierarchical menu structure for creating and adding components.

Parameters:
subject - The object the new component will be added to.
element - The element name the child appears under.
Returns:
A SimpleHierarchy of ComponentAction objects.

createComponent

public DesignComponent createComponent(java.lang.String name)
                                throws ArooaException
Create a component for the given name.

Parameters:
name - The name of the tag identifiying the component.
Returns:
A created component. Never null.
Throws:
ArooaException - If the component can't be created.

componentFactory

public ObjectFactory componentFactory()
Creates a ObjectFactory which creates components.

Returns:
An ObjectFactory.

supportedTypes

public java.lang.String[] supportedTypes(java.lang.Class type)
Return supported child type for a given type.

Parameters:
type - The type.
Returns:
A list of supported types.

supportedTypes

public java.lang.String[] supportedTypes(TypeDefinition typedef)

allTypes

public java.lang.String[] allTypes()

createType

public DesignElementType createType(java.lang.String name)
                             throws ArooaException
Creat a type for the given type name.

Parameters:
name - The type name.
Returns:
The created type.
Throws:
ArooaException - If the type can't be created.

valueFactory

public ObjectFactory valueFactory()