Copyright 2002 by aragost

com.aragost.araspect.evaluators
Class FieldEvaluator

java.lang.Object
  |
  +--com.aragost.araspect.evaluators.Evaluator
        |
        +--com.aragost.araspect.evaluators.FieldEvaluator
All Implemented Interfaces:
Updater

public class FieldEvaluator
extends Evaluator
implements Updater


Constructor Summary
FieldEvaluator()
           
 
Method Summary
 PathElement createPathElement(java.lang.String className, java.lang.String fieldName)
           
 java.lang.Object eval(java.lang.Object arg, PathElement elm)
          Evaluate a PathElement for the specified Object.
 java.lang.String id()
          Return a unique id for the receiver.
 java.lang.String prettyPrint(PathElement elm)
          Prettyprint the specified PathElement.
 void update(java.lang.Object object, PathElement elm, java.lang.String newValue)
          Update a attribute of an object from user input.
 
Methods inherited from class com.aragost.araspect.evaluators.Evaluator
get, getRegisteredEvaluators, register, register
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldEvaluator

public FieldEvaluator()
Method Detail

createPathElement

public PathElement createPathElement(java.lang.String className,
                                     java.lang.String fieldName)

id

public java.lang.String id()
Description copied from class: Evaluator
Return a unique id for the receiver. Only one Evaluator should return the same id.

Specified by:
id in class Evaluator
Returns:
String the id.
See Also:
Evaluator.id()

eval

public java.lang.Object eval(java.lang.Object arg,
                             PathElement elm)
                      throws EvaluationException
Description copied from class: Evaluator
Evaluate a PathElement for the specified Object. The receiver is assumed to be the Evaluator specified by the evaluatorId() of the PathElement.

Specified by:
eval in class Evaluator
Parameters:
arg -
elm -
Returns:
Object
Throws:
EvaluationException
See Also:
Evaluator.eval(Object, PathElement)

update

public void update(java.lang.Object object,
                   PathElement elm,
                   java.lang.String newValue)
            throws EvaluationException
Description copied from interface: Updater
Update a attribute of an object from user input. That means that a single attribute of the object will be changed to a new value.

Specified by:
update in interface Updater
Parameters:
object - The object that will be updated
elm - A PathElement that describe the attribute to change
newValue - The newValue of the attribute. This value has to be converted to the right type.
Throws:
EvaluationException
See Also:
Updater.update(Object, PathElement, String)

prettyPrint

public java.lang.String prettyPrint(PathElement elm)
Description copied from class: Evaluator
Prettyprint the specified PathElement.

Overrides:
prettyPrint in class Evaluator
Parameters:
elm - DOCUMENT ME!
Returns:
DOCUMENT ME!
See Also:
Evaluator.prettyPrint(PathElement)

Copyright 2002 by aragost