org.ceryle.wiki.plugin.assertion
Class Property

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

public class Property
extends Term

A Property is part of a QueryItem's formal Expression that corresponds to a property name-value pairing. This extends Term, overriding its page checks. The value of a Property (within the Expression) evaluates to true if it contains non-null data for its name and value. The value is left as an Object so that it can contain potentially any kind of data.

Datatyping is planned but left for the future.

Author:
Murray Altheim

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ceryle.wiki.plugin.query.Operand
Operand.NullOperand
 
Field Summary
 
Fields inherited from class org.ceryle.wiki.plugin.query.Term
ALL_PAGES, ALL_PAGES_REGEX
 
Fields inherited from interface org.ceryle.wiki.plugin.query.Operand
NULL
 
Constructor Summary
Property(String name, Object value)
          Constructor, takes a String property name and value.
 
Method Summary
 boolean evaluateOperand(Modifier modifier, ReferenceInfoProvider refInfoProvider, String pageName)
          Overrides Term's method, returning true if this Property contains a non-null String.
 String getName()
          Return the property name.
 String getPageName()
          Overrides the superclass method, returning null.
 Object getValue()
          Return the property value.
 String toString()
          Return the property name and value as an equation name="value".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Property

public Property(String name,
                Object value)
Constructor, takes a String property name and value.

Parameters:
value -
Method Detail

evaluateOperand

public boolean evaluateOperand(Modifier modifier,
                               ReferenceInfoProvider refInfoProvider,
                               String pageName)
                        throws QueryException
Overrides Term's method, returning true if this Property contains a non-null String.

Specified by:
evaluateOperand in interface Operand
Overrides:
evaluateOperand in class Term
Throws:
QueryException
See Also:
Operand

getPageName

public String getPageName()
Overrides the superclass method, returning null. This method doesn't make sense for properties.

Overrides:
getPageName in class Term

getName

public String getName()
Return the property name. This returns the same thing as toString()


getValue

public Object getValue()
Return the property value.


toString

public String toString()
Return the property name and value as an equation name="value". If the value is not a String, its toString() method is used.

Overrides:
toString in class Term


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