public abstract class AbstractHandler<C> extends Object implements Handler<C>
| Constructor and Description |
|---|
AbstractHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
cast(Object value,
Node node,
Field field) |
abstract C |
check(Request request,
Node node,
Field field,
boolean errors)
Checks the user input, and invalidates the request, if this user input was invalid.
|
protected String |
findString(Request request,
Field field) |
protected Object |
getEvaluatedFieldValue(Request request,
Node node,
Field field)
Returns the field value to be used in the page.
|
protected Object |
getFieldValue(Request request,
Node node,
Field field)
Returns the field value as specified by the client's post.
|
protected Object |
getFieldValue(Request request,
Node node,
Field field,
boolean form) |
protected int |
getOperator(Field field)
The operator to be used by search(request, field, query)
|
protected Object |
getSearchFieldValue(Request request,
Field field) |
protected String |
getSearchValue(String string,
Field field,
int operator)
Converts the value to the actual value to be searched.
|
protected Object |
getValue(Node node,
String fieldName) |
protected String |
id(String s)
Puts a prefix 'mm_' before an id in form fields.
|
abstract C |
input(Request request,
Node node,
Field field,
boolean search)
Produces an form input field for the given Node, and Field.
|
protected boolean |
interpretEmptyAsNull(Field field) |
Constraint |
search(Request request,
Field field,
Query query)
Uses the user's input to create a constraint for the given query
|
boolean |
set(Request request,
Node node,
Field field)
Sets the user's input into the field of the node
|
protected void |
setValue(Request request,
Node node,
String fieldName,
Object value) |
protected String id(String s)
protected boolean interpretEmptyAsNull(Field field)
protected Object getFieldValue(Request request, Node node, Field field)
node - This parameter could be used if the client does not fully specify the field's value (possible e.g. with Date fields). The existing specification could be used then.protected Object getEvaluatedFieldValue(Request request, Node node, Field field)
request - The request, Request.isPost() is used to determin whether the value is given by the user,
otherwise the value of the node is used, or if that is null the default value of the field.node - A node or nullfield - The field, never null.protected Object getFieldValue(Request request, Node node, Field field, boolean form)
request - node - or nullfield - form - If false then this value is to be used for search inputs. The node and the default values are not
usedprotected int getOperator(Field field)
protected String getSearchValue(String string, Field field, int operator)
public Constraint search(Request request, Field field, Query query)
Handlerpublic abstract C check(Request request, Node node, Field field, boolean errors)
Handlerpublic boolean set(Request request, Node node, Field field)
HandlerMMBase 1.9-SNAPSHOT - ${javadoctimestamp}