Class ParseFilterAction

  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.ParseFilterAction
All Implemented Interfaces:
Computable, Executable, Presentable, NamespaceContextFactory

public class ParseFilterAction
extends AbstractSetAction

The <xcl:parse-filter> element parses the external filter specified in the source attribute. The source filters are those specified in the XCL specification.

The compiled filter can then be referred using <xcl:filter> :

  <!--compile a filter-->
  <xcl:parse-filter name="myFilter" source="file:///path/to/filter.xml"/>
  <!--parse the XML input-->
  <xcl:parse name="input" source="file:///path/to/input.xml" type="SAX"/>
  <!--connect the input to the parsed filter-->
  <xcl:filter name="output" filter="{ $myFilter }" source="{ $input }"/>
  <!--connect $output to the next filter or stylesheet-->

Passing parameters to hard-coded filters

It is possible to pass parameters to hard-coded filters :

  <!--compile a filter-->
  <xcl:parse-filter name="myFilter" source="res:org.inria.ns.reflex.xml.filter.helpers.Tokenizer">
      <param name="pattern" value=",\s*"/>
  <!--read the input with the filter-->
  <xcl:filter name="output" filter="{ $myFilter }" source="file:///path/to/input.txt"/>
  <!--connect $output to the next filter or stylesheet-->

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
Fields inherited from class org.inria.ns.reflex.processor.core.AbstractAction
actions, parent, processorInstance
Constructor Summary
ParseFilterAction(Expression source, Element element, AbstractAction parent)
          Create a new instance of ParseFilterAction.
Method Summary
 Object getComputedValue(DataSet dataSet)
          Return the computed value of the property, by parsing a filter.
static AbstractAction unmarshal(AbstractAction parent, Element element)
          XML unmarshaller for ParseFilterAction.
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


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

source - The source of the filter to parse, that will be the value of the property, as an Expression.
element - The element from which the action has been unmarshalled. Used for namespace prefix resolution when performing XPath expressions.
parent - The action depending from.
UnmarshalException - When the "name" attribute is not a valid value template.
Method Detail


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

parent - The action depending from
element - The XML element to unmarshall.
The ParseFilterAction created.
UnmarshalException - When the element and its content is not those expected.


public Object getComputedValue(DataSet dataSet)
                        throws ExecutionException,
Return the computed value of the property, by parsing a filter.

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