|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.xoetrope.optional.scripts.ScriptAttributeEvaluator
public class ScriptAttributeEvaluator
Evaluates a script attribute by passing the scripts
following the prefix 'script:' to the ScriptEngine.
The scripts can be an a function that was predifined
in the page Scripts tag or a script that is just being
defined.
eg. script:myFunction(); given that myFunction
was define in the page Scripts tag.
eg. script:out.println('Hello World'); the script
is just being defined.
Copyright (c) Xoetrope Ltd., 2002-2007
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 |
instance
|
protected java.lang.Object |
result
|
protected ScriptEngine |
scriptEngine
|
| Constructor Summary | |
|---|---|
ScriptAttributeEvaluator()
Create a new instance of the 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 value of an attribute by evaluating a method reference |
java.lang.Object |
getObject()
Get the current page. |
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 instance
protected XExceptionHandler exceptionHandler
protected java.lang.Object result
protected XProject currentProject
protected ScriptEngine scriptEngine
| Constructor Detail |
|---|
public ScriptAttributeEvaluator()
| Method Detail |
|---|
public void setCurrentProject(XProject project)
setCurrentProject in interface XAttributeEvaluatorproject - the current or owning project
public java.lang.Object evaluateAttribute(java.lang.Object instance,
java.lang.String attributeValue)
evaluateAttribute in interface XAttributeEvaluatorpage - the page being loadedattributeValue - 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 XAttributeEvaluatorinstance - the current page or object that provides the methods or fields used in the evaluationattributeValue - the method name
public java.lang.Object getObject()
public 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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||