org.inria.ns.reflex.xml.filter
Class FilterContext

java.lang.Object
  extended by org.inria.ns.reflex.xml.filter.FilterContext

public class FilterContext
extends Object

A context for a filter hold some informations about the way to process the last matched node.

As specialized filters can extend this class, the way to get a context filter is to use a factory.

Author:
Philippe Poulard
See Also:
AbstractFilter, FilterContextFactory

Field Summary
 boolean ignore
          Indicates if the content of the node will be ignored.
 boolean isForwarding
          Indicates if the current process consist on forwarding or not.
 
Method Summary
 Exception getError()
          Return the error that have been previously set to this context.
 RunnableRuleBasedFilter getFilter()
          Return the filter that creates this context.
 Object getMatchNode()
          Return the contextual node.
 boolean resetError()
          Reset the current error on this context or on its parent.
 void setError(Exception error)
          Set an error to this context.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ignore

public boolean ignore
Indicates if the content of the node will be ignored.

This flag is set to false by <xcl:apply-rules>.

See Also:
RunnableRuleBasedFilter.ignore(Object), ApplyRulesAction

isForwarding

public boolean isForwarding
Indicates if the current process consist on forwarding or not.

Within the <xcl:forward> element, the XML content produced is forwarded.

See Also:
ForwardAction
Method Detail

getMatchNode

public Object getMatchNode()
Return the contextual node.

Returns:
The node that a rule had matched.

getFilter

public RunnableRuleBasedFilter getFilter()
Return the filter that creates this context.

Returns:
The owner filter.

resetError

public boolean resetError()
Reset the current error on this context or on its parent.

This method is called by <xi:fallback> if an error has been set.

Returns:
true if there was an error, false otherwise.

setError

public void setError(Exception error)
Set an error to this context.

The error MUST be processed by <xi:fallback>. If <xi:fallback> is missing, it is a fatal error.

Parameters:
exception - The error.

getError

public Exception getError()
Return the error that have been previously set to this context.

Returns:
The error, maybe null.