|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
A form document contains static HTML and variables where dynamic
content can be inserted. The beanToForm methods of
FormUtils take a bean object and insert the bean data
within the document as default values of the form elements. Error messages
are inserted by these methods too. In addition, dynamic HTML content
can be inserted within a document using its setValue() methods.
Form documents are created by form templates.
Do not implement this interface. The mapping utilities recognize only the internal implementation of the framework.
CharacterEncoding,
FormTemplate,
FormUtils| Method Summary | |
boolean |
exists(java.lang.String varName)
Returns true if a variable with the given name exists. |
boolean |
exists(java.lang.String varName,
int index)
Returns true if a variable identified by name and index exists. |
int |
getMaxIndex(java.lang.String varName)
Returns the maximum index for a given variable name. |
java.util.Enumeration |
getNames()
Returns the names of all variables. |
java.lang.String |
getValue(java.lang.String varName)
Gets the value of a variable. |
java.lang.String |
getValue(java.lang.String varName,
int index)
Gets the value of a variable identified by name and index. |
void |
reset()
Clears the default values and the error messages of all form elements and sets all variables to null. |
void |
send(java.io.OutputStream output)
Sends the content of the document to an output stream. |
void |
send(java.io.OutputStream output,
int encoding)
Sends the content of the document to an output stream. |
void |
send(java.io.Writer writer)
Sends the content of the document to a writer. |
void |
setValue(java.lang.String varName,
int index,
java.lang.String value)
Sets the value of a variable identified by name and index. |
void |
setValue(java.lang.String varName,
java.lang.String value)
Sets the value of a variable. |
| Method Detail |
public void send(java.io.OutputStream output)
throws java.io.IOException
output - the output stream whose methods are called to write
the document's content. For example, it could be
the stream returned by getOutputStream()
of javax.servlet.ServletResponseNullPointerException - if output is nulljava.io.IOException - if an I/O error occurs
public void send(java.io.OutputStream output,
int encoding)
throws java.io.IOException
output - the output stream whose methods are called to write
the document's content. For example, it could be
the stream returned by getOutputStream()
of javax.servlet.ServletResponseencoding - the character encoding. See the constants declared by CharacterEncoding.NullPointerException - if output is nulljava.lang.IllegalArgumentException - if encoding has an invalid value.java.io.IOException - if an I/O error occurs
public void send(java.io.Writer writer)
throws java.io.IOException
writer - the writer whose methods are called to write
the document's content. For example, it could be
the writer returned by getWriter()
of javax.servlet.ServletResponseNullPointerException - if writer is nulljava.io.IOException - if an I/O error occurspublic java.util.Enumeration getNames()
public boolean exists(java.lang.String varName)
0).varName - the name of the variableNullPointerException - if varName is null
public void setValue(java.lang.String varName,
java.lang.String value)
0).
This method can be used to insert dynamic content within the document.varName - the name of the variablevalue - the new value of the variableNullPointerException - if varName is nulljava.lang.IllegalArgumentException - if there is no variable with the given nameIndexOutOfBoundsException - if 0 is an invalid variable indexpublic java.lang.String getValue(java.lang.String varName)
0).varName - the name of the variableNullPointerException - if varName is nulljava.lang.IllegalArgumentException - if there is no variable with the given nameIndexOutOfBoundsException - if 0 is an invalid variable indexpublic int getMaxIndex(java.lang.String varName)
exists().
Any index less than 0 or greater than the value returned by this method is invalid.varName - the name of the variableNullPointerException - if varName is nulljava.lang.IllegalArgumentException - if there is no variable with the given name
public boolean exists(java.lang.String varName,
int index)
varName - the name of the variableindex - the index of the variableNullPointerException - if varName is null
public void setValue(java.lang.String varName,
int index,
java.lang.String value)
varName - the name of the variablevalue - the new value of the variableindex - the index of the variableNullPointerException - if varName is nulljava.lang.IllegalArgumentException - if there is no variable with the given nameIndexOutOfBoundsException - if index is an invalid variable index
public java.lang.String getValue(java.lang.String varName,
int index)
varName - the name of the variableindex - the index of the variableNullPointerException - if varName is nulljava.lang.IllegalArgumentException - if there is no variable with the given nameIndexOutOfBoundsException - if index is an invalid variable indexpublic void reset()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||