org.inria.ns.reflex.processor.xcl
Class AbstractFilterAction

java.lang.Object
  extended by org.inria.ns.reflex.processor.core.AbstractAction
      extended by org.inria.ns.reflex.processor.core.AbstractSetAction
          extended by org.inria.ns.reflex.processor.xcl.AbstractFilterAction
All Implemented Interfaces:
Computable, Executable, Presentable, NamespaceContextFactory
Direct Known Subclasses:
FilterAction

public abstract class AbstractFilterAction
extends AbstractSetAction

Allow to define XML filters.

Author:
Philippe Poulard

Nested Class Summary
 
Nested classes/interfaces inherited from class org.inria.ns.reflex.processor.core.AbstractAction
AbstractAction.ParameterAdapter, AbstractAction.UselessAction
 
Field Summary
 
Fields inherited from class org.inria.ns.reflex.processor.core.AbstractSetAction
NO_VALUE
 
Fields inherited from class org.inria.ns.reflex.processor.core.AbstractAction
actions, parent, processorInstance
 
Constructor Summary
AbstractFilterAction(Expression source, Element element, AbstractAction parent)
          Create a new AbstractFilterAction.
 
Method Summary
 Object getComputedValue(DataSet dataSet)
          Return either a SAX filter that applies XPath patterns on a SAX source or a text source, or a list of nodes filtered from a DOM sources.
static void setGuard(XMLContext.Guard guard)
          Set a guard to this class ; the guard enable the creation of new SAX and DOM contexts.
static AbstractAction unmarshal(AbstractAction parent, Element element)
          XML unmarshaller for AbstractFilterAction.
 
Methods inherited from class org.inria.ns.reflex.processor.core.AbstractSetAction
addProperty, getComputedName, getName, getValue, runAction, scope, unmarshalScope
 
Methods inherited from class org.inria.ns.reflex.processor.core.AbstractAction
addAction, addFallbackAction, createContext, getCanonicalPath, getFallbackAction, getLocalFallbackAction, getLogger, getNamespaceContext, getNode, getParent, recover, recover, removeFallbackAction, reorganize, run, runActions, toPrettyString, toPrettyString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractFilterAction

public AbstractFilterAction(Expression source,
                            Element element,
                            AbstractAction parent)
                     throws XMLException
Create a new AbstractFilterAction.

Parameters:
source - The source to filter : a DOM node, a SAX reader, or a file, or null. null means : process the current object.
node - The node from which the action has been unmarshalled. Used for namespace prefix resolution when performing XPath expressions.
parent - The action depending from.
Throws:
XMLException
Method Detail

setGuard

public static void setGuard(XMLContext.Guard guard)
Set a guard to this class ; the guard enable the creation of new SAX and DOM contexts.

Parameters:
guard - The non-null guard.

unmarshal

public static AbstractAction unmarshal(AbstractAction parent,
                                       Element element)
                                throws XMLException
XML unmarshaller for AbstractFilterAction.

Parameters:
parent - The action depending from
element - The XML element to unmarshall.
Returns:
The XIncludeFilterAction created.
Throws:
UnmarshalException - When the element and its content is not those expected.
XMLException

getComputedValue

public Object getComputedValue(DataSet dataSet)
                        throws ExecutionException,
                               XPathException
Return either a SAX filter that applies XPath patterns on a SAX source or a text source, or a list of nodes filtered from a DOM sources.

As usual, SAX processes are deferred until they are consumed.

Specified by:
getComputedValue in interface Computable
Specified by:
getComputedValue in class AbstractSetAction
Parameters:
dataSet - The set of datas used when the name is computed.
Returns:
The computed value of the property.
Throws:
ExecutionException - If the computation can't be performed.
XPathException