org.speakright.core
Class FieldBinder

java.lang.Object
  extended by org.speakright.core.FieldBinder

public class FieldBinder
extends java.lang.Object

FieldBinder uses reflect to get the value of field's (aka. member variables) in a flow object. Used in prompt texts, like this "What {%subject%}".

Author:
Ian Rae

Constructor Summary
FieldBinder()
          Constructor
 
Method Summary
 boolean failed(SRError parent)
           
 java.lang.String getFieldValue(java.lang.String fieldName, IFlow flow)
          Get the value of the given fieldName, such as "m_main1Prompt".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldBinder

public FieldBinder()
Constructor

Method Detail

failed

public boolean failed(SRError parent)

getFieldValue

public java.lang.String getFieldValue(java.lang.String fieldName,
                                      IFlow flow)
Get the value of the given fieldName, such as "m_main1Prompt". If the field is an IModelItem then the item's formmater is used, otherwise toString is used.

Parameters:
fieldName - name of the field, usually starts with m_
flow - flow object in which the field is a member (or it can be in a base class of flow)
Returns:
value of the field