org.ceryle.wiki.plugin.query.operators
Class IsModifier

java.lang.Object
  extended by org.ceryle.wiki.plugin.query.operators.Operator
      extended by org.ceryle.wiki.plugin.query.operators.IsModifier
All Implemented Interfaces:
Modifier
Direct Known Subclasses:
TagManagerImpl.HasTagModifier

public class IsModifier
extends Operator
implements Modifier

The IS Operator, a component of a query expression.

Author:
Murray Altheim (added regex matching), John Volkar (john.volkar at gmail.com)

Field Summary
static boolean permitRegex
          When true, permits Java-style regular expression matching (as supported directly by String.matches(String) on the page name.
 
Fields inherited from class org.ceryle.wiki.plugin.query.operators.Operator
_ALL, _AND, _ANY, _BY, _FROM, _IS, _NOT, _NULL, _OR, _TO
 
Constructor Summary
IsModifier()
           
 
Method Summary
 boolean applyModifier(ReferenceInfoProvider refInfoProvider, String candidateName, String termName)
          Evaluates to true if candidateName IS termName.
 boolean evaluateOperator(Operand left, Operand right, Modifier modifier, ReferenceInfoProvider refInfoProvider, String pageName)
          The left operand is expected to be Operand.NULL, evaluate the right using this as the modifier.
 boolean isInfix()
           
 
Methods inherited from class org.ceryle.wiki.plugin.query.operators.Operator
getName, isPrefix, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

permitRegex

public static boolean permitRegex
When true, permits Java-style regular expression matching (as supported directly by String.matches(String) on the page name. The default is true.

Constructor Detail

IsModifier

public IsModifier()
Method Detail

isInfix

public boolean isInfix()
Overrides:
isInfix in class Operator

evaluateOperator

public boolean evaluateOperator(Operand left,
                                Operand right,
                                Modifier modifier,
                                ReferenceInfoProvider refInfoProvider,
                                String pageName)
                         throws QueryException
The left operand is expected to be Operand.NULL, evaluate the right using this as the modifier.

Specified by:
evaluateOperator in class Operator
Throws:
QueryException
See Also:
Operator.evaluateOperator(Operand, Operand, Modifier, ReferenceInfoProvider, String)

applyModifier

public boolean applyModifier(ReferenceInfoProvider refInfoProvider,
                             String candidateName,
                             String termName)
Evaluates to true if candidateName IS termName. If regular expressions are permitted then the candidateName is evaluated against a regular expression match. If the regex pattern is invalid, returns the default behaviour of a direct, case-insensitive match.

Specified by:
applyModifier in interface Modifier
See Also:
permitRegex, Modifier.applyModifier(ReferenceInfoProvider, String, String)


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.