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

java.lang.Object
  extended by org.apache.cocoon.components.modules.input.JXPathHelper

public class JXPathHelper
extends Object

Version:
$Id: JXPathHelper.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Christian Haul, Vadim Gritsenko

Method Summary
static Object getAttribute(String name, Configuration modeConf, JXPathHelperConfiguration setup, Object contextObj)
          Return the String value of the attribute or the Node found using the XPath expression.
static Iterator getAttributeNames(JXPathHelperConfiguration setup, Object contextObj)
           
static String getAttributeValue(String name, Configuration modeConf, JXPathHelperConfiguration setup, Object contextObj)
          Return the String value of the attribute or element identified in the XPath expression.
static Object[] getAttributeValues(String name, Configuration modeConf, JXPathHelperConfiguration setup, Object contextObj)
           
static JXPathHelperConfiguration setup(Configuration config)
          Configure component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setup

public static JXPathHelperConfiguration setup(Configuration config)
                                       throws ConfigurationException
Configure component. Preprocess list of packages, functions and namespaces to add to the JXPath context later. This method used in both AbstractJXPathModule and JXPathMetaModule to configure JXPath.

Parameters:
config - a Configuration value
Throws:
ConfigurationException - if an error occurs

getAttributeValue

public static String getAttributeValue(String name,
                                       Configuration modeConf,
                                       JXPathHelperConfiguration setup,
                                       Object contextObj)
                                throws ConfigurationException
Return the String value of the attribute or element identified in the XPath expression.

Parameters:
name - The XPath expression
modeConf - The Configuration.
setup - The JXPathHelperConfiguration.
contextObj - The root Element to search.
Returns:
The String value of the attribute or element identified.
Throws:
ConfigurationException - if an Exception occurs.

getAttribute

public static Object getAttribute(String name,
                                  Configuration modeConf,
                                  JXPathHelperConfiguration setup,
                                  Object contextObj)
                           throws ConfigurationException
Return the String value of the attribute or the Node found using the XPath expression.

Parameters:
name - The XPath expression
modeConf - The Configuration.
setup - The JXPathHelperConfiguration.
contextObj - The root Element to search.
Returns:
The String value of the attribute or the Element located.
Throws:
ConfigurationException - if an Exception occurs.

getAttributeValues

public static Object[] getAttributeValues(String name,
                                          Configuration modeConf,
                                          JXPathHelperConfiguration setup,
                                          Object contextObj)
                                   throws ConfigurationException
Throws:
ConfigurationException

getAttributeNames

public static Iterator getAttributeNames(JXPathHelperConfiguration setup,
                                         Object contextObj)
                                  throws ConfigurationException
Throws:
ConfigurationException


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