|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FormElement
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 |
---|
FormElement setKey(String key)
String getKey()
FormElement setName(String name)
String getName()
FormElement setType(FormType type)
FormType getType()
FormElement setDefaultVal(Object defaultVal)
Object getDefaultVal()
FormElement setAllowMultiples(boolean val)
boolean allowMultiples()
FormElement setValidator(FormValidator validator)
FormValidator getValidator()
FormElement setOrigVal(Object iorigVal)
Object getOrigVal()
FormElement setVal(Object ival)
Object getVal()
Object getVal(Object dflt)
Object[] getVals()
Object[] getVals(Object[] dflt)
FormElement setParseException(ParseException pe)
ParseException getParseException()
FormElement setFormat(Format iformat)
Format getFormat()
FormElement setParentForm(FormMap iparent)
FormMap getParentForm()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |