org.inria.ns.reflex.xml.filter
Interface RunnableRuleBasedFilter

All Superinterfaces:
Filter, RuleBasedFilter
All Known Implementing Classes:
AbstractFilter, DOMFilter

public interface RunnableRuleBasedFilter
extends RuleBasedFilter

A RunnableRuleBasedFilter can apply rules and forward nodes to the next step by itself.

Author:
Philippe Poulard

Method Summary
 void applyFilter(Object node)
          Apply the filter on a node : test if a rule is appliable.
 void applyRules(Object node, DataSet dataSet)
          Run the <xcl:apply-rules> element.
 void forward(QName[] names, Executable action, DataSet dataSet)
          Run a <xcl:forward> element.
 void ignore(Object node)
          Ignore the current node : the node must not be part of the result, its children must be ignored too.
 
Methods inherited from interface org.inria.ns.reflex.xml.filter.RuleBasedFilter
getFilterContextFactory, getRules, normalize
 

Method Detail

applyFilter

void applyFilter(Object node)
                 throws PatternEvaluationException,
                        ExecutionException
Apply the filter on a node : test if a rule is appliable.

***

The candidate rules are the rules held by this filter + the default rules.

If no user-specific rule is appliable, the default rule is applied.

***

Parameters:
node - The candidate node.
Throws:
ExecutionException
PatternEvaluationException
See Also:
Rule, Rule.DEFAULT_RULES, Node, SAXNode

applyRules

void applyRules(Object node,
                DataSet dataSet)
                throws ExecutionException
Run the <xcl:apply-rules> element.

Apply the rules on the current node :

  1. propagate the node,
  2. invoke applyFilter(Object) for its children.

A concrete implementation depends on the nature of the input (DOM or SAX).

Parameters:
node - The node to propagate.
channels - The list of channels to forward to, or null if the main channel have to be used.
Throws:
ExecutionException - Propagation from applyFilter(Object).
See Also:
Node, SAXNode

forward

void forward(QName[] names,
             Executable action,
             DataSet dataSet)
             throws ExecutionException
Run a <xcl:forward> element.

A concrete implementation depends on the nature of the input (DOM or SAX).

Parameters:
names - The name of the channels to forward to, or null to forward to the main channel. In the list of channel names, the main channel can be named with "#main".
action - The action to perform before : may build some XML content to forward.
dataSet - The set of datas used.
Throws:
ExecutionException - If the action can't be performed.

ignore

void ignore(Object node)
            throws ExecutionException
Ignore the current node :
  1. the node must not be part of the result,
  2. its children must be ignored too.

This method is invoked automatically if no <xcl:apply-rules> element has been encountered.

A concrete implementation depends on the nature of the input (DOM or SAX).

Parameters:
node - The node to ignore.
Throws:
ExecutionException - Propagation from applyFilter(Object).
See Also:
Node, SAXNode