Save This Page
Home » cocoon-2.1.11-src » org.apache.cocoon.components.modules » input » [javadoc | source]
org.apache.cocoon.components.modules.input
public class: SimpleMappingMetaModule [javadoc | source]
java.lang.Object
   org.apache.avalon.framework.logger.AbstractLogEnabled
      org.apache.cocoon.components.modules.input.AbstractInputModule
         org.apache.cocoon.components.modules.input.AbstractMetaModule
            org.apache.cocoon.components.modules.input.SimpleMappingMetaModule

All Implemented Interfaces:
    org.apache.avalon.framework.thread.ThreadSafe, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.activity.Disposable, InputModule, org.apache.avalon.framework.configuration.Configurable

Meta module that obtains values from an other module and by replacing the requested attribute name with another name. This is done first through a replacement table and may additionally prepend or append a string. Replacement works in both ways, it is applied to the returned attribute names as well.

Example configuration:

<prefix>cocoon.</prefix>
<suffix>.attr</suffix>
<mapping in="foo" out="bar"/>
<mapping in="yuk" out="yeeha"/>
Will map a parameter "foo" to the real one named "cocoon.bar.attr". If parameters "coocoon.yeeha.attr" and "shopping.cart" exist, the iterator will return "yeeha". "shopping.cart" does not contain the pre-/ suffix and thus is dropped.

Similarily, rm-prefix and rm-suffix will be removed from the attribute name.

Nested Class Summary:
protected static class  SimpleMappingMetaModule.Mapping   
Field Summary
 String prefix     
 String suffix     
 String rmPrefix     
 String rmSuffix     
 SimpleMappingMetaModule.Mapping mapping     
Fields inherited from org.apache.cocoon.components.modules.input.AbstractMetaModule:
manager,  inputSelector,  input,  defaultInput,  inputConf,  initialized,  INPUT_MODULE_SELECTOR
Fields inherited from org.apache.cocoon.components.modules.input.AbstractInputModule:
returnNames,  settings
Method from org.apache.cocoon.components.modules.input.SimpleMappingMetaModule Summary:
configure,   getAttribute,   getAttributeNames,   getAttributeValues
Methods from org.apache.cocoon.components.modules.input.AbstractMetaModule:
compose,   dispose,   getNames,   getNames,   getValue,   getValue,   getValue,   getValue,   getValues,   getValues,   getValues,   getValues,   lazy_initialize,   obtainModule,   releaseModule
Methods from org.apache.cocoon.components.modules.input.AbstractInputModule:
configure,   dispose,   getAttribute,   getAttributeNames,   getAttributeValues
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.cocoon.components.modules.input.SimpleMappingMetaModule Detail:
 public  void configure(Configuration config) throws ConfigurationException 
 public Object getAttribute(String name,
    Configuration modeConf,
    Map objectModel) throws ConfigurationException 
 public Iterator getAttributeNames(Configuration modeConf,
    Map objectModel) throws ConfigurationException 
 public Object[] getAttributeValues(String name,
    Configuration modeConf,
    Map objectModel) throws ConfigurationException