org.inria.ns.reflex.processor.asl
Class TextAction.Value.ValueTextMatcher

java.lang.Object
  extended by org.inria.ns.reflex.processor.asl.ItemMatcher
      extended by org.inria.ns.reflex.processor.asl.TextAction.Matcher
          extended by org.inria.ns.reflex.processor.asl.TextAction.Value.ValueTextMatcher
All Implemented Interfaces:
Ignorable, Reducible
Enclosing class:
TextAction.Value

public class TextAction.Value.ValueTextMatcher
extends TextAction.Matcher

A text matcher on a value.


Field Summary
 
Fields inherited from class org.inria.ns.reflex.processor.asl.ItemMatcher
FOUND, NOT_FOUND
 
Constructor Summary
TextAction.Value.ValueTextMatcher()
           
 
Method Summary
 Object getItemValue(DataSet dataSet)
          Return the string value used to match the text.
 String getValue(DataSet dataSet)
          Return the value used to match the text.
 TypedData matches(String text, DataSet dataSet)
          Return true if this matcher matches the given text, false otherwise.
 ValidationError reportError(Element element, Node candidate)
          Raise an error.
 String toString()
          Return the value expression.
 
Methods inherited from class org.inria.ns.reflex.processor.asl.TextAction.Matcher
getAction, getItemName, isIgnorable, matches
 
Methods inherited from class org.inria.ns.reflex.processor.asl.ItemMatcher
canUse, getExceptions, getInterimStep, getMaxInit, getMaxRest, getMinInit, getMinRest, mustUse, reset, runInterim, setBoundaries, setInterimStep, use
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextAction.Value.ValueTextMatcher

public TextAction.Value.ValueTextMatcher()
Method Detail

toString

public String toString()
Return the value expression.

Overrides:
toString in class Object
Returns:
"#=val"

getValue

public String getValue(DataSet dataSet)
                throws XPathException
Return the value used to match the text.

Parameters:
dataSet - The data set to use.
Returns:
The value used to match the text.
Throws:
XPathException - If the value can't be computed.

getItemValue

public Object getItemValue(DataSet dataSet)
                    throws XPathException
Return the string value used to match the text.

Overrides:
getItemValue in class TextAction.Matcher
Parameters:
dataSet - The set of datas used when the action is running.
Returns:
The value used to match the text.
Throws:
XPathException
See Also:
getValue(DataSet), TextAction.Matcher.getItemValue(org.inria.ns.reflex.processor.DataSet)

matches

public TypedData matches(String text,
                         DataSet dataSet)
                  throws XPathException
Return true if this matcher matches the given text, false otherwise.

Specified by:
matches in class TextAction.Matcher
Parameters:
text - The text to test.
dataSet - The set of datas used when the matcher is matching.
Returns:
FOUND if the object matches this material and carries no data, a TypedData if the object matches this material and carries a data, NOT_FOUND otherwise.
Throws:
XPathException - If the matcher's value can't be computed.
See Also:
ItemMatcher.matches(Object,org.inria.ns.reflex.processor.DataSet)

reportError

public ValidationError reportError(Element element,
                                   Node candidate)
Raise an error. This method is used by the SchemaClientHandler when a candidate material failed to match whereas it is expected.

Specified by:
reportError in class ItemMatcher
Parameters:
element - The element in fault.
candidate - The candidate node that cause the fault.
Returns:
The validation error raised.