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

java.lang.Object
  extended byorg.apache.cocoon.components.modules.input.InputModuleHelper

public class InputModuleHelper
extends Object

Version:
$Id: InputModuleHelper.html 1304280 2012-03-23 11:18:01Z ilgrosso $

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(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
 

Constructor Detail

InputModuleHelper

public InputModuleHelper()
Method Detail

setup

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

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

getAttribute

public Object getAttribute(Map objectModel,
                           Configuration conf,
                           String module,
                           String name,
                           Object deflt)
                    throws InputModuleException
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:
InputModuleException - if an error occurs

getAttribute

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

Throws:
InputModuleException

getAttributeValues

public Object[] getAttributeValues(Map objectModel,
                                   Configuration conf,
                                   String module,
                                   String name,
                                   Object[] deflt)
                            throws InputModuleException
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:
InputModuleException - if an error occurs

getAttributeValues

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

Throws:
InputModuleException

getAttributeNames

public Iterator getAttributeNames(Map objectModel,
                                  Configuration conf,
                                  String module)
                           throws InputModuleException
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:
InputModuleException - if an error occurs

getAttributeNames

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

Throws:
InputModuleException

releaseAll

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

Throws:
InputModuleException - if an error occurs


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.