water.api
Class Parse.Preview

java.lang.Object
  extended by water.Iced
      extended by water.api.RequestArguments.Argument
          extended by water.api.Parse.Preview
All Implemented Interfaces:
java.lang.Cloneable, Request.Filter, Freezable
Enclosing class:
Parse

public class Parse.Preview
extends RequestArguments.Argument


Field Summary
 
Fields inherited from class water.api.RequestArguments.Argument
_displayName, _field, _hideInQuery, _name, _prerequisites, _readOnly, _requestHelp, _required
 
Method Summary
protected  java.lang.Object defaultValue()
          Returns the default value of the argument.
protected  java.lang.String jsRefresh(java.lang.String callbackName)
          Returns the javascript code that will be executed when the query is loaded that associates the given callback JS function with the on change event of the input.
protected  java.lang.String jsValue()
          Returns the javascript code that will be executed when the value of the argument is to be determined.
protected  java.lang.Object parse(java.lang.String input)
          Override this method to provide parsing of the input string to the Java expected value.
protected  java.lang.String queryDescription()
          Returns the query description.
protected  java.lang.String queryElement()
          Returns the HTML elements of the argument query only.
 
Methods inherited from class water.api.RequestArguments.Argument
addPrerequisite, check, disable, disable, disabled, errors, jsAddons, originalValue, query, queryAddons, queryComment, record, refreshOnChange, requestHelp, reset, run, setRefreshOnChange, specified, valid, value
 
Methods inherited from class water.Iced
clone, frozenType, init, newInstance, read, toDocField, write, writeJSON, writeJSONFields
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

queryElement

protected java.lang.String queryElement()
Description copied from class: RequestArguments.Argument
Returns the HTML elements of the argument query only. This should return the elements in HTML that will be used to enter the value. For instance the input text, selection, etc.

Specified by:
queryElement in class RequestArguments.Argument

parse

protected java.lang.Object parse(java.lang.String input)
                          throws java.lang.IllegalArgumentException
Description copied from class: RequestArguments.Argument
Override this method to provide parsing of the input string to the Java expected value. The input is guaranteed to be non-empty when this method is called and all prerequisities are guaranteed to be valid before this method is called.

Specified by:
parse in class RequestArguments.Argument
Throws:
java.lang.IllegalArgumentException

defaultValue

protected java.lang.Object defaultValue()
Description copied from class: RequestArguments.Argument
Returns the default value of the argument. Note that the method will be called also on required arguments, in which case it is ok return null. It is kept abstract because defining a proper default value might be tricky and in many case you do not want it to be null. Overriding it always makes you think:)

Specified by:
defaultValue in class RequestArguments.Argument

queryDescription

protected java.lang.String queryDescription()
Description copied from class: RequestArguments.Argument
Returns the query description. This is a concise description of a correct value for the argument. generally used as a placeholder in the html query elements.

Specified by:
queryDescription in class RequestArguments.Argument

jsRefresh

protected java.lang.String jsRefresh(java.lang.String callbackName)
Description copied from class: RequestArguments.Argument
Returns the javascript code that will be executed when the query is loaded that associates the given callback JS function with the on change event of the input. This method is only called if the element should refresh the webpage upon its change.

Specified by:
jsRefresh in class RequestArguments.Argument

jsValue

protected java.lang.String jsValue()
Description copied from class: RequestArguments.Argument
Returns the javascript code that will be executed when the value of the argument is to be determined. It must contain a return statement, that returns the string that should be sent back to the request for the given arhument.

Specified by:
jsValue in class RequestArguments.Argument