org.apache.cocoon.components.modules.input
Class InputModuleHelper

java.lang.Object
  extended by org.apache.cocoon.components.modules.input.InputModuleHelper
Direct Known Subclasses:
XSPModuleHelper

public class InputModuleHelper
extends Object

Version:
$Id: InputModuleHelper.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Christian Haul

Field Summary
protected static String INPUT_MODULE_SELECTOR
           
 
Constructor Summary
InputModuleHelper()
           
 
Method Summary
 Object getAttribute(Map objectModel, Configuration conf, String module, String name, Object deflt)
          Get a single attribute value from a module.
 Object getAttribute(Map objectModel, String module, String name, Object deflt)
          Get a single attribute value from a module.
 Iterator getAttributeNames(Map objectModel, Configuration conf, String module)
          Get an iterator to a collection of attribute names from a module.
 Iterator getAttributeNames(Map objectModel, String module)
          Get an iterator to a collection of attribute names from a module.
 Object[] getAttributeValues(Map objectModel, Configuration conf, String module, String name, Object[] deflt)
          Get an array of values from a module.
 Object[] getAttributeValues(Map objectModel, String module, String name, Object[] deflt)
          Get an array of values from a module.
 void releaseAll()
          Releases all obtained module references.
 void setup(ComponentManager manager)
          Deprecated. Use the setup(ServiceManager) method instead
 void setup(ServiceManager manager)
          Initializes the instance for first use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INPUT_MODULE_SELECTOR

protected static final String INPUT_MODULE_SELECTOR
Constructor Detail

InputModuleHelper

public InputModuleHelper()
Method Detail

setup

public void setup(ComponentManager manager)
           throws RuntimeException
Deprecated. Use the setup(ServiceManager) method instead

Initializes the instance for first use. Stores references to component manager and component selector in instance

Parameters:
manager - a ComponentManager value
Throws:
RuntimeException - if an error occurs

setup

public void setup(ServiceManager manager)
           throws RuntimeException
Initializes the instance for first use. Stores references to service manager and service selector in instance

Parameters:
manager - a ServiceManager value
Throws:
RuntimeException - if an error occurs

getAttribute

public Object getAttribute(Map objectModel,
                           Configuration conf,
                           String module,
                           String name,
                           Object deflt)
                    throws RuntimeException
Get a single attribute value from a module. Uses cached reference if existing.

Parameters:
objectModel - a Map value
conf - a Configuration containing the module dynamic configuration (aka modeConf)
module - a String value holding the module name
name - a String value holding the attribute name
deflt - an Object value holding a default value
Returns:
an Object value
Throws:
RuntimeException - if an error occurs

getAttribute

public Object getAttribute(Map objectModel,
                           String module,
                           String name,
                           Object deflt)
                    throws RuntimeException
Get a single attribute value from a module. Same as getAttribute(Map, Configuration, String, String, Object) with a null configuration.

Throws:
RuntimeException

getAttributeValues

public Object[] getAttributeValues(Map objectModel,
                                   Configuration conf,
                                   String module,
                                   String name,
                                   Object[] deflt)
                            throws RuntimeException
Get an array of values from a module. Uses cached reference if existing.

Parameters:
objectModel - a Map value
conf - a Configuration containing the module dynamic configuration (aka modeConf)
module - a String value holding the module name
name - a String value holding the attribute name
deflt - an Object[] value holding a default value
Returns:
an Object[] value
Throws:
RuntimeException - if an error occurs

getAttributeValues

public Object[] getAttributeValues(Map objectModel,
                                   String module,
                                   String name,
                                   Object[] deflt)
                            throws RuntimeException
Get an array of values from a module. Same as getAttributeValues(Map, Configuration, String, String, Object[]) with a null configuration.

Throws:
RuntimeException

getAttributeNames

public Iterator getAttributeNames(Map objectModel,
                                  Configuration conf,
                                  String module)
                           throws RuntimeException
Get an iterator to a collection of attribute names from a module.

Parameters:
objectModel - a Map value
module - the module's name
Returns:
an Iterator value
Throws:
RuntimeException - if an error occurs

getAttributeNames

public Iterator getAttributeNames(Map objectModel,
                                  String module)
                           throws RuntimeException
Get an iterator to a collection of attribute names from a module. Same as getAttributeNames(Map, Configuration, String) with a null configuration.

Throws:
RuntimeException

releaseAll

public void releaseAll()
                throws RuntimeException
Releases all obtained module references.

Throws:
RuntimeException - if an error occurs


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.