org.inria.ns.reflex.processor.asl
Class TextAction.Pattern.PatternTextMatcher

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.Pattern.PatternTextMatcher
All Implemented Interfaces:
Ignorable, Reducible
Enclosing class:
TextAction.Pattern

public class TextAction.Pattern.PatternTextMatcher
extends TextAction.Matcher

A text matcher on a pattern.


Field Summary
 
Fields inherited from class org.inria.ns.reflex.processor.asl.ItemMatcher
FOUND, NOT_FOUND
 
Constructor Summary
TextAction.Pattern.PatternTextMatcher()
           
 
Method Summary
 Pattern getPattern()
          Return the pattern 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 regular expression.
 
Methods inherited from class org.inria.ns.reflex.processor.asl.TextAction.Matcher
getAction, getItemName, getItemValue, 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.Pattern.PatternTextMatcher

public TextAction.Pattern.PatternTextMatcher()
Method Detail

toString

public String toString()
Return the regular expression.

Overrides:
toString in class Object
Returns:
"#~regexp"

getPattern

public Pattern getPattern()
Return the pattern used to match the text.

Returns:
The pattern used to match the text.

matches

public TypedData matches(String text,
                         DataSet dataSet)
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.
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.