|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interfaces defines the methods a class needs to implement to act as a FormElement.
A FormElement defines how an element in a FormMap should be mapped to a first class java object. There are several key pieces of information required:
Once we have this information, we basically have enough data to map a String value in the data source to a first class Java object in the element.
Note that you can optionally specify a Format object, which will be used by FormUtil.repopulate() and FormUtil.formatForOutput() to render the form value in a manner that will be fit for human consumption (as well as subsequent form reparsing).
Also note that all of the setters have been modified to return a reference
to the FormElement. This makes it possible to chain your calls on a single line,
like this:
new DefaultFormElement(...).setName("foo").setDefaultVal("blah")
Method Summary | |
boolean |
allowMultiples()
|
Object |
getDefaultVal()
|
Format |
getFormat()
|
String |
getKey()
|
String |
getName()
|
Object |
getOrigVal()
|
FormMap |
getParentForm()
|
ParseException |
getParseException()
|
FormType |
getType()
|
Object |
getVal()
|
Object |
getVal(Object dflt)
|
FormValidator |
getValidator()
|
Object[] |
getVals()
|
Object[] |
getVals(Object[] dflt)
|
FormElement |
setAllowMultiples(boolean val)
|
FormElement |
setDefaultVal(Object defaultVal)
|
FormElement |
setFormat(Format iformat)
|
FormElement |
setKey(String key)
|
FormElement |
setName(String name)
|
FormElement |
setOrigVal(Object iorigVal)
|
FormElement |
setParentForm(FormMap iparent)
|
FormElement |
setParseException(ParseException pe)
|
FormElement |
setType(FormType type)
|
FormElement |
setVal(Object ival)
|
FormElement |
setValidator(FormValidator validator)
|
Methods inherited from interface java.lang.Comparable |
compareTo |
Method Detail |
public FormElement setKey(String key)
public String getKey()
public FormElement setName(String name)
public String getName()
public FormElement setType(FormType type)
public FormType getType()
public FormElement setDefaultVal(Object defaultVal)
public Object getDefaultVal()
public FormElement setAllowMultiples(boolean val)
public boolean allowMultiples()
public FormElement setValidator(FormValidator validator)
public FormValidator getValidator()
public FormElement setOrigVal(Object iorigVal)
public Object getOrigVal()
public FormElement setVal(Object ival)
public Object getVal()
public Object getVal(Object dflt)
public Object[] getVals()
public Object[] getVals(Object[] dflt)
public FormElement setParseException(ParseException pe)
public ParseException getParseException()
public FormElement setFormat(Format iformat)
public Format getFormat()
public FormElement setParentForm(FormMap iparent)
public FormMap getParentForm()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |