|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.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 page${this[componentName].componentMethod(args...)} for a method contained within named component${this.method(args...)} for a method contained within the enclosing page, identical to 4 above${project.method(args...)} for a method contained within the project${comp.method(args...)} for a method contained within the component${this} for a reference to the page${comp} for a reference to the componentwhere 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.8 $
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 XProject |
currentProject
|
protected XExceptionHandler |
exceptionHandler
|
protected java.lang.Object |
provider
|
protected java.lang.Object |
result
|
| Constructor Summary | |
|---|---|
XDefaultAttributeEvaluator(XProject project)
Create a new evaluator |
|
| Method Summary | |
|---|---|
java.lang.Object |
evaluateAttribute(java.lang.Object instance,
java.lang.String attributeValue)
Get the value of an attribute. |
XMethodReference |
getMethodReference(java.lang.Object instance,
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 |
java.lang.Object |
getObject()
Get the current provider object. |
java.lang.Object |
getResult()
Explicitly get the result of an evaluation. |
void |
setCurrentProject(XProject project)
Set the current project and complete any initialization that depends on the project reference/instance. |
void |
setExceptionHandler(XExceptionHandler eh)
Set an exception handler for processing exceptions |
void |
setResult(java.lang.Object value)
Explicitly set the result of an evaluation. |
| 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 java.lang.Object provider
protected XProject currentProject
protected XExceptionHandler exceptionHandler
protected java.lang.Object result
| Constructor Detail |
|---|
public XDefaultAttributeEvaluator(XProject project)
currentProject - the current projectproject - the current or owning project| Method Detail |
|---|
public void setCurrentProject(XProject project)
setCurrentProject in interface XAttributeEvaluatorproject - the current or owning projectpublic void setExceptionHandler(XExceptionHandler eh)
setExceptionHandler in interface XAttributeEvaluatoreh - the exception handlerpublic void setResult(java.lang.Object value)
setResult in interface XAttributeEvaluatorthe - new result valuepublic java.lang.Object getResult()
getResult in interface XAttributeEvaluator
public java.lang.Object evaluateAttribute(java.lang.Object instance,
java.lang.String attributeValue)
evaluateAttribute in interface XAttributeEvaluatorinstance - the page or instance that provides the methods/field for the evaluatorattributeValue - the raw value of the attribute
public XMethodReference getMethodReference(java.lang.String attributeValue)
getMethodReference in interface XAttributeEvaluatorattributeValue - the method name
public XMethodReference getMethodReference(java.lang.Object instance,
java.lang.String attributeValue)
getMethodReference in interface XAttributeEvaluatorinstnace - the page or object from that provides the methods or fields referenced in the evaluationattributeValue - the attribute to be evaluated
public java.lang.Object getObject()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||