|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.xoetrope.xui.evaluator.XDefaultAttributeEvaluator
public class XDefaultAttributeEvaluator
An attribute evaluator
An evaluated attribute's implementing method is by default in the owner page such that a reference like
${myMethod()}
would evaluate to a method in the current page with a signature like:
public void myMethod();
The attributes can also be defined in classes other than the current page or classes derived from XPage. The syntax for such expressions is as follows:
${mypackage.MyClass[referenceName].myMethod(args...)}
for a named object instance${mypackage.MyClass[].myMethod(args...)}
to create a new instance of the class on each evaluation${mypackage.MyClass.myMethod(args...)}
to invoke a static method${myMethod[referenceName](args...)}
for a method contained with the invoking pagewhere mypackage is the name of the Java package containing the class MyClass. The value of referenceName is a user defined value that identifies the instance of the class. The application instantiates an instance of the class when the expression is first encountered and thereafter maintains the instance with each subsequent call retrieving the same instance of the class.
The method call can contain zero or more arguments
Copyright (c) Xoetrope Ltd., 2002-2004
$Revision: 2.9 $
License: see License.txt
Field Summary | |
---|---|
protected java.util.Hashtable |
classInstances The collection of class instances that are known to implement the methods of evaluated attributes |
protected PageSupport |
currentPage |
Constructor Summary | |
---|---|
XDefaultAttributeEvaluator() |
Method Summary | |
---|---|
java.lang.Object |
evaluateAttribute(PageSupport page, java.lang.String attributeValue) Get the value of an attribute. |
PageSupport |
getCurrentPage() Get the current page. |
XMethodReference |
getMethodReference(PageSupport page, java.lang.String attributeValue) Get the value of an attribute by evaluating a method reference |
XMethodReference |
getMethodReference(java.lang.String attributeValue) Get the method reference for the methods named in the attribute |
void |
setCurrentProject(XProject currentProject) Set the current project and complete any initialization that depends on the project reference/instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Hashtable classInstances
protected PageSupport currentPage
Constructor Detail |
---|
public XDefaultAttributeEvaluator()
currentProject
- the current projectMethod Detail |
---|
public void setCurrentProject(XProject currentProject)
setCurrentProject
in interface XAttributeEvaluator
project
- the current or owning projectpublic java.lang.Object evaluateAttribute(PageSupport page, java.lang.String attributeValue)
evaluateAttribute
in interface XAttributeEvaluator
page
- the page being loadedattributeValue
- the raw value of the attributepublic XMethodReference getMethodReference(java.lang.String attributeValue)
getMethodReference
in interface XAttributeEvaluator
attributeValue
- the method namepublic XMethodReference getMethodReference(PageSupport page, java.lang.String attributeValue)
getMethodReference
in interface XAttributeEvaluator
page
- the page from which the evaluation is invokedattributeValue
- the attribute to be evaluatedpublic PageSupport getCurrentPage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |