org.outerj.xreporter.report.instance
Class Parameter

java.lang.Object
  extended byorg.outerj.xreporter.report.instance.InputField
      extended byorg.outerj.xreporter.report.instance.Parameter

public class Parameter
extends InputField


Field Summary
protected  ParameterDefinition definition
           
protected  java.lang.String enteredValue
           
protected  java.lang.String validationErrorMsg
           
protected  java.lang.Object value
           
 
Constructor Summary
Parameter(ParameterDefinition definition)
           
 
Method Summary
 int bind(java.sql.PreparedStatement statement, int start, ExecutionContext reportContext)
           
 void generateInfoSaxFragment(org.xml.sax.ContentHandler contentHandler, ExecutionContext executionContext, ResourceHandle resourceHandle)
          Similar to generateSaxFragment, but only contains the state of the inputfield, not other information like the datatype or validation errors.
 void generateSaxFragment(org.xml.sax.ContentHandler contentHandler, ExecutionContext executionContext, ResourceHandle resourceHandle)
          Generates a piece of SAX representing the state and metadata of this inputfield.
 DataType getDataType()
           
 java.lang.String getName()
           
 java.lang.Object getValue()
           
 boolean hasValue()
           
 boolean isValid()
           
 void readStoredEntry(UserEntryStore userEntryStore, User user, ResourceHandle resourceHandle)
          Allows an inputfield to initialize itself using a previously stored value.
 void reset()
           
 void storeEntry(UserEntryStore userEntryStore, User user)
          Allows an inputfield to store its value into the user entry store.
 void storeState(ReportState reportState)
           
 void submit(java.util.Map submitValues, ExecutionContext executionContext)
          Same as submit(values, executionContext, false).
 void submit(java.util.Map submitValues, ExecutionContext executionContext, boolean rawLocale)
          Submit (user input) values to this inputField.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

definition

protected ParameterDefinition definition

value

protected java.lang.Object value

enteredValue

protected java.lang.String enteredValue

validationErrorMsg

protected java.lang.String validationErrorMsg
Constructor Detail

Parameter

public Parameter(ParameterDefinition definition)
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in class InputField

generateSaxFragment

public void generateSaxFragment(org.xml.sax.ContentHandler contentHandler,
                                ExecutionContext executionContext,
                                ResourceHandle resourceHandle)
                         throws java.lang.Exception
Description copied from class: InputField
Generates a piece of SAX representing the state and metadata of this inputfield. For example, this could be its name, value, validation errors, information about the datatype. The methods startDocument and endDocument will not be called.

Specified by:
generateSaxFragment in class InputField
Throws:
java.lang.Exception

generateInfoSaxFragment

public void generateInfoSaxFragment(org.xml.sax.ContentHandler contentHandler,
                                    ExecutionContext executionContext,
                                    ResourceHandle resourceHandle)
                             throws org.xml.sax.SAXException
Description copied from class: InputField
Similar to generateSaxFragment, but only contains the state of the inputfield, not other information like the datatype or validation errors. Only inputfields that have a non-empty value will generate something here.

The purpose of this method is to include information about the InputFields on the output page. Hence this method should only be called after the containing step has been completed successfully.

Specified by:
generateInfoSaxFragment in class InputField
Throws:
org.xml.sax.SAXException

submit

public void submit(java.util.Map submitValues,
                   ExecutionContext executionContext,
                   boolean rawLocale)
Description copied from class: InputField
Submit (user input) values to this inputField. The Map can contain values for all inputFields, it is the responsiblity of the InputField implementation to take only the appropriate values from the map.

Specified by:
submit in class InputField
Parameters:
submitValues - a Map wherein the values are Strings.
rawLocale - ignore the user locale and use the built-in default locale

submit

public void submit(java.util.Map submitValues,
                   ExecutionContext executionContext)
Description copied from class: InputField
Same as submit(values, executionContext, false).

Specified by:
submit in class InputField

isValid

public boolean isValid()
Specified by:
isValid in class InputField
Returns:
true if this input field has a valid value or if it has no value and is not required to have one.

getValue

public java.lang.Object getValue()

hasValue

public boolean hasValue()
Specified by:
hasValue in class InputField
Returns:
true if this input field has a value.

getDataType

public DataType getDataType()
Specified by:
getDataType in class InputField

reset

public void reset()
Specified by:
reset in class InputField

bind

public int bind(java.sql.PreparedStatement statement,
                int start,
                ExecutionContext reportContext)
         throws java.sql.SQLException
Throws:
java.sql.SQLException

readStoredEntry

public void readStoredEntry(UserEntryStore userEntryStore,
                            User user,
                            ResourceHandle resourceHandle)
                     throws UserEntryStoreException
Description copied from class: InputField
Allows an inputfield to initialize itself using a previously stored value.

Specified by:
readStoredEntry in class InputField
Throws:
UserEntryStoreException

storeEntry

public void storeEntry(UserEntryStore userEntryStore,
                       User user)
                throws UserEntryStoreException
Description copied from class: InputField
Allows an inputfield to store its value into the user entry store.

Specified by:
storeEntry in class InputField
Throws:
UserEntryStoreException

storeState

public void storeState(ReportState reportState)
Specified by:
storeState in class InputField