org.ceryle.wiki.plugin.query
Class Term

java.lang.Object
  extended by org.ceryle.wiki.plugin.query.Term
All Implemented Interfaces:
Operand
Direct Known Subclasses:
Property

public class Term
extends Object
implements Operand

A Term is part of a QueryItem's formal Expression that corresponds to a wiki page name. A term of an expression evaluates to true if it matches the page name begin evaluated.

Author:
John Volkar (john.volkar at gmail.com)

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ceryle.wiki.plugin.query.Operand
Operand.NullOperand
 
Field Summary
static Term ALL_PAGES
          A canonical instance of the "all pages" Term.
static String ALL_PAGES_REGEX
          The "all pages" query regular expression.
 
Fields inherited from interface org.ceryle.wiki.plugin.query.Operand
NULL
 
Constructor Summary
Term(String pageName)
          Constructor, takes bracketed page name.
 
Method Summary
 boolean evaluateOperand(Modifier modifier, ReferenceInfoProvider refInfoProvider, String pageName)
          Evaluates the operand, returns the truth value.
 String getPageName()
          Return the unbracketed page name.
 String toString()
          Returns the bracketed page name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALL_PAGES_REGEX

public static final String ALL_PAGES_REGEX
The "all pages" query regular expression. The value is "[.*]".

See Also:
Constant Field Values

ALL_PAGES

public static Term ALL_PAGES
A canonical instance of the "all pages" Term.

Constructor Detail

Term

public Term(String pageName)
Constructor, takes bracketed page name. This is forgiving: if the provided name does not begin and end with square brackets, they will be added as necessary.

Parameters:
pageName - the wiki page name
Method Detail

getPageName

public String getPageName()
Return the unbracketed page name.


evaluateOperand

public boolean evaluateOperand(Modifier modifier,
                               ReferenceInfoProvider refInfoProvider,
                               String pageName)
                        throws QueryException
Description copied from interface: Operand
Evaluates the operand, returns the truth value.

Specified by:
evaluateOperand in interface Operand
Throws:
QueryException
See Also:
Operand

toString

public String toString()
Returns the bracketed page name.

Overrides:
toString in class Object


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