|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwater.Iced
water.api.RequestArguments.Argument<T>
public abstract class RequestArguments.Argument<T>
Field Summary | |
---|---|
java.lang.String |
_displayName
Name of the argument. |
java.lang.reflect.Field |
_field
If argument has been created reflectively from a request field. |
boolean |
_hideInQuery
True if the argument should not appear in the automatically generated query. |
java.lang.String |
_name
Name of the argument. |
java.util.ArrayList<RequestArguments.Argument<T>> |
_prerequisites
List of all prerequisite arguments for the current argument. |
boolean |
_readOnly
True if the argument should be only read-only. |
java.lang.String |
_requestHelp
As with request's _requestHelp, this provides the extended help that will be displayed on the help and wiki pages. |
boolean |
_required
True if the argument is required, false if it may be skipped. |
Constructor Summary | |
---|---|
protected |
RequestArguments.Argument(java.lang.String name,
boolean required)
Creates the argument of given name. |
Method Summary | |
---|---|
protected void |
addPrerequisite(RequestArguments.Argument arg)
Adds the given argument as a prerequisite. |
void |
check(RequestQueries callInstance,
java.lang.String input)
Checks that the argument supplied is correct. |
protected abstract T |
defaultValue()
Returns the default value of the argument. |
void |
disable(java.lang.String reason)
Disables the argument with given reason. |
void |
disable(java.lang.String reason,
java.util.Properties args)
Disables the argument and makes its input value empty. |
boolean |
disabled()
Returns whether the argument is disabled or not. |
protected java.lang.String[] |
errors()
Returns a list of possible error strings, that could be thrown in an IllegalArgumentException. |
protected java.lang.String |
jsAddons()
If there is any additional javascript that should be dumped to the query page, it should be defined here. |
protected abstract 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 abstract java.lang.String |
jsValue()
Returns the javascript code that will be executed when the value of the argument is to be determined. |
java.lang.String |
originalValue()
Returns the input value submitted by the user, if specified. |
protected abstract T |
parse(java.lang.String input)
Override this method to provide parsing of the input string to the Java expected value. |
protected java.lang.String |
query()
Returns the html query for the given argument, including the full formatting. |
protected java.lang.String |
queryAddons()
Any query addons can be specified here. |
protected java.lang.String |
queryComment()
|
protected abstract java.lang.String |
queryDescription()
Returns the query description. |
protected abstract java.lang.String |
queryElement()
Returns the HTML elements of the argument query only. |
protected RequestArguments.Record<T> |
record()
Returns the thread local argument state record. |
boolean |
refreshOnChange()
Returns true if the argument refreshes the query automatically on its change. |
com.google.gson.JsonObject |
requestHelp()
Creates the request help page part for the given argument. |
void |
reset()
Resets the argument by creating it a new thread local state. |
boolean |
run(java.lang.Object value)
|
protected void |
setRefreshOnChange()
Makes the argument refresh the query page on its change automatically. |
boolean |
specified()
Returns true if the argument is specified by the user. |
boolean |
valid()
Returns true if the argument is valid. |
T |
value()
Returns the value of the argument. |
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 |
Field Detail |
---|
public java.lang.String _requestHelp
public boolean _hideInQuery
public boolean _readOnly
public java.lang.String _name
public java.lang.String _displayName
public boolean _required
public transient java.util.ArrayList<RequestArguments.Argument<T>> _prerequisites
public transient java.lang.reflect.Field _field
Constructor Detail |
---|
protected RequestArguments.Argument(java.lang.String name, boolean required)
Method Detail |
---|
public boolean run(java.lang.Object value)
run
in interface Request.Filter
protected abstract T parse(java.lang.String input) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
protected abstract T defaultValue()
protected abstract java.lang.String jsRefresh(java.lang.String callbackName)
protected abstract java.lang.String jsValue()
protected java.lang.String jsAddons()
protected abstract java.lang.String queryElement()
protected java.lang.String queryComment()
protected abstract java.lang.String queryDescription()
protected java.lang.String[] errors()
protected java.lang.String queryAddons()
protected java.lang.String query()
public final com.google.gson.JsonObject requestHelp()
protected final void addPrerequisite(RequestArguments.Argument arg)
protected final RequestArguments.Record<T> record()
public final void disable(java.lang.String reason)
public final void disable(java.lang.String reason, java.util.Properties args)
public final boolean disabled()
protected void setRefreshOnChange()
public boolean refreshOnChange()
public final boolean valid()
public final boolean specified()
public final T value()
public final java.lang.String originalValue()
public final void reset()
public void check(RequestQueries callInstance, java.lang.String input) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |