|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.datatypes.handlers.AbstractHandler<C>
public abstract class AbstractHandler<C>
Handlers can be associated to DataTypes, but different Handler can be associated with different content types. The main implementation will of course be one that produces HTML, like forms, and post and things like that.
| Constructor Summary | |
|---|---|
AbstractHandler()
|
|
| Method Summary | |
|---|---|
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 |
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 useDefault)
Returns the field value to be used in the page. |
protected int |
getOperator(Field field)
The operator to be used by search(request, field, query) |
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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.mmbase.datatypes.handlers.Handler |
|---|
id |
| Constructor Detail |
|---|
public AbstractHandler()
| Method Detail |
|---|
protected String id(String s)
protected boolean interpretEmptyAsNull(Field field)
protected Object cast(Object value,
Node node,
Field field)
protected Object getValue(Node node,
String fieldName)
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 getFieldValue(Request request,
Node node,
Field field,
boolean useDefault)
protected int getOperator(Field field)
protected String getSearchValue(String string,
Field field,
int operator)
protected final String findString(Request request,
Field field)
public Constraint search(Request request,
Field field,
Query query)
Handler
search in interface Handler<C>
protected void setValue(Request request,
Node node,
String fieldName,
Object value)
public abstract C check(Request request,
Node node,
Field field,
boolean errors)
Handler
check in interface Handler<C>errors - If true then report the errors, otherwise the return value can
remain empty.
public boolean set(Request request,
Node node,
Field field)
Handler
set in interface Handler<C>
public abstract C input(Request request,
Node node,
Field field,
boolean search)
Handler
input in interface Handler<C>search - if true, then a search field is produced.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||