org.oddjob.arooa.deploy
Class MappingsSwitch

java.lang.Object
  extended by org.oddjob.arooa.deploy.MappingsSwitch
All Implemented Interfaces:
ElementMappings

public class MappingsSwitch
extends Object
implements ElementMappings

Provide a consistent ElementMappings view for the two individual mappings that are loaded in an ArooaDescriptorBean.

Author:
rob

Constructor Summary
MappingsSwitch(ElementMappings componentMappings, ElementMappings valueMappings)
           
 
Method Summary
 DesignFactory designFor(ArooaElement element, InstantiationContext context)
          Provide a mapping from an element to the name of a java class that is a DesignFactory for the element.
 ArooaElement[] elementsFor(InstantiationContext context)
          Provide a list of all elements in this mapping that support the given context.
 MappingsContents getBeanDoc(ArooaType arooaType)
          Get the BeanDoc for this mapping.
 ArooaClass mappingFor(ArooaElement element, InstantiationContext context)
          Provide a mapping from an element to the name of a java class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappingsSwitch

public MappingsSwitch(ElementMappings componentMappings,
                      ElementMappings valueMappings)
Method Detail

mappingFor

public ArooaClass mappingFor(ArooaElement element,
                             InstantiationContext context)
Description copied from interface: ElementMappings
Provide a mapping from an element to the name of a java class.

Specified by:
mappingFor in interface ElementMappings
Parameters:
element - The element.
context - The InstantiationContext.
Returns:
The ArooaClass. Null if no mappings exists.

designFor

public DesignFactory designFor(ArooaElement element,
                               InstantiationContext context)
Description copied from interface: ElementMappings
Provide a mapping from an element to the name of a java class that is a DesignFactory for the element.

Specified by:
designFor in interface ElementMappings
Parameters:
element - The element.
context - The InstantiationContext.
Returns:
The DesignFactory. May be null.

elementsFor

public ArooaElement[] elementsFor(InstantiationContext context)
Description copied from interface: ElementMappings
Provide a list of all elements in this mapping that support the given context.

Specified by:
elementsFor in interface ElementMappings
Returns:
The elements. May be null.

getBeanDoc

public MappingsContents getBeanDoc(ArooaType arooaType)
Description copied from interface: ElementMappings
Get the BeanDoc for this mapping.

Specified by:
getBeanDoc in interface ElementMappings
Parameters:
arooaType - The type of Mapping.
Returns:
The BeanDoc. May be null.