org.inria.ns.reflex.processor.asl
Class TextAction.Matcher

java.lang.Object
  extended by org.inria.ns.reflex.processor.asl.ItemMatcher
      extended by org.inria.ns.reflex.processor.asl.TextAction.Matcher
All Implemented Interfaces:
Ignorable, Reducible
Direct Known Subclasses:
TextAction.InlineType.WrappedTypeMatcher, TextAction.Pattern.PatternTextMatcher, TextAction.Value.ValueTextMatcher
Enclosing class:
TextAction

public abstract class TextAction.Matcher
extends ItemMatcher
implements Ignorable

A matcher that indicates if an attribute value or a text content matches :

When involved in a type definition, it is used to produce items of the data model. Such items are ignorable, that is to say not use to build the data model.


Field Summary
 
Fields inherited from class org.inria.ns.reflex.processor.asl.ItemMatcher
FOUND, NOT_FOUND
 
Constructor Summary
TextAction.Matcher()
           
 
Method Summary
 AbstractAction getAction()
          Return the TextAction that has created this material item.
 QName getItemName(DataSet dataSet)
          Return the name of the item to create.
 Object getItemValue(DataSet dataSet)
          Return the value of the item to create.
 boolean isIgnorable()
          Indicates if this matcher is ignorable.
 TypedData matches(Object o, DataSet dataSet)
          Return true if this matcher matches the given text, false otherwise.
abstract  TypedData matches(String text, DataSet dataSet)
          Return true if this matcher matches the given text, false otherwise.
 
Methods inherited from class org.inria.ns.reflex.processor.asl.ItemMatcher
canUse, getExceptions, getInterimStep, getMaxInit, getMaxRest, getMinInit, getMinRest, mustUse, reportError, reset, runInterim, setBoundaries, setInterimStep, use
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextAction.Matcher

public TextAction.Matcher()
Method Detail

isIgnorable

public boolean isIgnorable()
Indicates if this matcher is ignorable.

Specified by:
isIgnorable in interface Ignorable
Returns:
true if no item must be created, false otherwise.

getItemName

public QName getItemName(DataSet dataSet)
                  throws XPathException
Return the name of the item to create.

Parameters:
dataSet - The set of datas used when the action is running.
Returns:
The name of the item to create, that may be null.
Throws:
XPathException

getItemValue

public Object getItemValue(DataSet dataSet)
                    throws XPathException
Return the value of the item to create.

Parameters:
dataSet - The set of datas used when the action is running.
Returns:
The value of the item to create, that may be null.
Throws:
XPathException

matches

public TypedData matches(Object o,
                         DataSet dataSet)
Return true if this matcher matches the given text, false otherwise.

Specified by:
matches in class ItemMatcher
Parameters:
o - The object 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)

matches

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

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 can't be computed.
See Also:
ItemMatcher.matches(Object,org.inria.ns.reflex.processor.DataSet)

getAction

public AbstractAction getAction()
Return the TextAction that has created this material item.

Specified by:
getAction in class ItemMatcher
Returns:
The action that has created this material item.