org.apache.cocoon.components.source.impl
Class XPathSourceInspector

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.source.impl.XPathSourceInspector
All Implemented Interfaces:
Component, LogEnabled, Parameterizable, Serviceable, ThreadSafe, SourceInspector

public class XPathSourceInspector
extends AbstractLogEnabled
implements SourceInspector, Serviceable, Parameterizable, ThreadSafe

This source inspector inspects XML files with a xpath expression.

Version:
$Id: XPathSourceInspector.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Field Summary
static String DEFAULT_PROPERTY_NAME
          The default property name exposed by this SourceInspector.
static String DEFAULT_PROPERTY_NS
          The default namespace uri of the property exposed by this SourceInspector.
 
Fields inherited from interface org.apache.cocoon.components.source.SourceInspector
ROLE
 
Constructor Summary
XPathSourceInspector()
           
 
Method Summary
 SourceProperty[] getSourceProperties(Source source)
          Gets all the SourceProperties associated with the given Source.
 SourceProperty getSourceProperty(Source source, String namespace, String name)
          Gets the SourceProperty associated with the given Source identified by the requested namespace and name.
 SourceValidity getValidity(Source source)
          Returns NOPValidity
 boolean handlesProperty(String namespace, String name)
          Check if this inspector handles the property of the given type.
 void parameterize(Parameters params)
           
 void service(ServiceManager manager)
           
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PROPERTY_NS

public static final String DEFAULT_PROPERTY_NS
The default namespace uri of the property exposed by this SourceInspector.

The value is http://apache.org/cocoon/inspector/xpath/1.0.

See Also:
Constant Field Values

DEFAULT_PROPERTY_NAME

public static final String DEFAULT_PROPERTY_NAME
The default property name exposed by this SourceInspector.

The value is result .

See Also:
Constant Field Values
Constructor Detail

XPathSourceInspector

public XPathSourceInspector()
Method Detail

service

public void service(ServiceManager manager)
Specified by:
service in interface Serviceable

parameterize

public void parameterize(Parameters params)
                  throws ParameterException
Specified by:
parameterize in interface Parameterizable
Throws:
ParameterException

getSourceProperty

public SourceProperty getSourceProperty(Source source,
                                        String namespace,
                                        String name)
                                 throws SourceException
Description copied from interface: SourceInspector
Gets the SourceProperty associated with the given Source identified by the requested namespace and name.

Specified by:
getSourceProperty in interface SourceInspector
Parameters:
source - the source for which to compute the property
namespace - the namespace of the property
name - the name of the property
Returns:
the SourceProperty associated with the Source, null if the inspector does not provide this property.
Throws:
SourceException

getSourceProperties

public SourceProperty[] getSourceProperties(Source source)
                                     throws SourceException
Description copied from interface: SourceInspector
Gets all the SourceProperties associated with the given Source.

Specified by:
getSourceProperties in interface SourceInspector
Parameters:
source - the Source for wich to compute the property.
Returns:
the collection of all SourceProperties that could be computed by this SourceInspector.
Throws:
SourceException

handlesProperty

public boolean handlesProperty(String namespace,
                               String name)
Description copied from interface: SourceInspector
Check if this inspector handles the property of the given type.

Specified by:
handlesProperty in interface SourceInspector
Parameters:
namespace - the namespace of the property
name - the name of the property
Returns:
true if this inspector handles properties of the given type else false.

getValidity

public SourceValidity getValidity(Source source)
Returns NOPValidity

Specified by:
getValidity in interface SourceInspector
Parameters:
source - the Source for which to calculate the validity its properties, null if the source properties are not cacheable.


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