org.eclipse.jst.jsf.core.tagmatcher
Class TagMatchingAlgorithm

java.lang.Object
  extended by org.eclipse.jst.jsf.core.tagmatcher.TagMatchingAlgorithm
Direct Known Subclasses:
XPathMatchingAlgorithm

public abstract class TagMatchingAlgorithm
extends java.lang.Object

An algorithm that can be applied at a particular DOM node. The result may be expressed as a boolean or a set of matching nodes. The following are equivalent: false and empty set true and non-empty set Concrete implementations must be idempotent on evaluate(): 1) evaluate(node) must always return the same set if called repeatedly on the same node in the same DOM tree. 2) evaluate must be able to be called on any number of nodes in order and always produce the same result independent of what was called before and in what order.

Provisional API - subject to change


Method Summary
 AxiomaticSet evaluate(org.w3c.dom.Node applyTo)
           
 void initialize()
          Called exactly once to initialize any pre-evaluation setup for the expression set for the algorithm.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initialize

public final void initialize()
Called exactly once to initialize any pre-evaluation setup for the expression set for the algorithm. This is public to allow the client control when this initialization occurs in case it is expensive. evaluate() will call this method automatically if it has never been called

Throws:
InvalidExpressionException - if the underlying algorithm throws an exception during init
java.lang.IllegalStateException - if it has already been determined that the expression is invalid.

evaluate

public final AxiomaticSet evaluate(org.w3c.dom.Node applyTo)
Parameters:
applyTo -
Returns:
the set matching the configured expression applied to applyTo using the algorithm represented by this instance.
Throws:
InvalidExpressionException - of a problem occurs initializing the expression
EvaluationException - if the internal algorithm throws an exception while evaluating.
java.lang.IllegalStateException - if evaluate is called again once InvalidExpressionException has already been thrown.