org.ceryle.wiki.plugin.tag
Class TagManagerImpl.HasTagModifier

java.lang.Object
  extended by org.ceryle.wiki.plugin.query.operators.Operator
      extended by org.ceryle.wiki.plugin.query.operators.IsModifier
          extended by org.ceryle.wiki.plugin.tag.TagManagerImpl.HasTagModifier
All Implemented Interfaces:
Modifier
Enclosing class:
TagManagerImpl

public class TagManagerImpl.HasTagModifier
extends IsModifier
implements Modifier

A substitution for the IS Operator as a component of a query expression. Rather than match on wiki page name, this matches on whether the page contains a matching tag, using methods from the TagManager.

Author:
Murray Altheim

Field Summary
 
Fields inherited from class org.ceryle.wiki.plugin.query.operators.IsModifier
permitRegex
 
Fields inherited from class org.ceryle.wiki.plugin.query.operators.Operator
_ALL, _AND, _ANY, _BY, _FROM, _IS, _NOT, _NULL, _OR, _TO
 
Constructor Summary
TagManagerImpl.HasTagModifier(TagManager tagManager)
           
 
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.
 
Methods inherited from class org.ceryle.wiki.plugin.query.operators.IsModifier
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
 

Constructor Detail

TagManagerImpl.HasTagModifier

public TagManagerImpl.HasTagModifier(TagManager tagManager)
Method Detail

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.

Overrides:
evaluateOperator in class IsModifier
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.

This extends the method in IsModifier by returning a match on tag rather than page name if the TagManager is available.

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


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