public abstract class RequestArguments.Argument<T> extends Iced implements Request.Filter
| Modifier and Type | Field and Description |
|---|---|
String |
_displayName
Name of the argument.
|
Field |
_field
If argument has been created reflectively from a request field.
|
boolean |
_gridable
Can be a grid search parameter.
|
boolean |
_hideInQuery
True if the argument should not appear in the automatically generated
query.
|
boolean |
_mustExist
For keys.
|
String |
_name
Name of the argument.
|
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.
|
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.
|
Request.Validator<T> |
_validator
Value validator.
|
| Modifier | Constructor and Description |
|---|---|
protected |
RequestArguments.Argument(String name,
boolean required)
Creates the argument of given name.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addPrerequisite(RequestArguments.Argument arg)
Adds the given argument as a prerequisite.
|
void |
check(RequestQueries callInstance,
String input)
Checks that the argument supplied is correct.
|
protected abstract T |
defaultValue()
Returns the default value of the argument.
|
void |
disable(String reason)
Disables the argument with given reason.
|
void |
disable(String reason,
Properties args)
Disables the argument and makes its input value empty.
|
boolean |
disabled()
Returns whether the argument is disabled or not.
|
protected String[] |
errors()
Returns a list of possible error strings, that could be thrown in an
IllegalArgumentException.
|
String |
getDisplayName() |
String |
getName() |
protected String |
jsAddons()
If there is any additional javascript that should be dumped to the
query page, it should be defined here.
|
protected abstract String |
jsRefresh(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 String |
jsValue()
Returns the javascript code that will be executed when the value of
the argument is to be determined.
|
String |
originalValue()
Returns the input value submitted by the user, if specified.
|
protected abstract T |
parse(String input)
Override this method to provide parsing of the input string to the Java
expected value.
|
protected String |
query()
Returns the html query for the given argument, including the full
formatting.
|
protected String |
queryAddons()
Any query addons can be specified here.
|
protected String |
queryComment() |
protected abstract String |
queryDescription()
Returns the query description.
|
protected abstract 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.
|
dontweave.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(Object value) |
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.
|
clone, frozenType, init, newInstance, read, toDocField, write, writeJSON, writeJSONFieldspublic String _requestHelp
public boolean _hideInQuery
public boolean _readOnly
public boolean _gridable
public boolean _mustExist
public Request.Validator<T> _validator
public String _name
public String _displayName
public boolean _required
public transient ArrayList<RequestArguments.Argument<T>> _prerequisites
public transient Field _field
protected RequestArguments.Argument(String name, boolean required)
public boolean run(Object value)
run in interface Request.Filterprotected abstract T parse(String input) throws IllegalArgumentException
IllegalArgumentExceptionprotected abstract T defaultValue()
protected abstract String jsRefresh(String callbackName)
protected abstract String jsValue()
protected String jsAddons()
protected abstract String queryElement()
protected String queryComment()
protected abstract String queryDescription()
protected String[] errors()
protected String queryAddons()
public String getName()
public String getDisplayName()
protected String query()
public final dontweave.gson.JsonObject requestHelp()
protected final void addPrerequisite(RequestArguments.Argument arg)
protected final RequestArguments.Record<T> record()
public final void disable(String reason)
public final void disable(String reason, Properties args)
public final boolean disabled()
public void setRefreshOnChange()
public boolean refreshOnChange()
public final boolean valid()
public final boolean specified()
public final T value()
public final String originalValue()
public final void reset()
public void check(RequestQueries callInstance, String input) throws IllegalArgumentException
IllegalArgumentExceptionCopyright © 2013–2014 0xdata. All rights reserved.