|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.struts.action.ActionForm
com.oroad.stxx.xform.AbstractXMLForm
Abstract XMLForm that implements all methods not involving the actual XML library used to store the form. While this class extends the Struts action form, it can be used by containers that have nothing to do with servlets provided the getSchemaStream method is overridden (i.e. a SOAP container).
Field Summary | |
protected java.lang.Object |
defaultXML
The default xml document |
protected org.xmlform.Form |
form
The underlying XMLForms form |
protected java.lang.String |
formPath
The path to the form xml |
protected org.apache.commons.logging.Log |
log
The logging instance |
protected java.lang.String |
name
The name of the form |
protected java.lang.String |
phase
The current validation phase |
protected java.io.InputStream |
schema
The path to the schema |
protected java.lang.String |
schemaNS
The namespace of the schema |
protected boolean |
vsEnabled
If viewstate is enabled |
protected java.lang.Object |
xml
The xml document |
Fields inherited from class org.apache.struts.action.ActionForm |
multipartRequestHandler, servlet |
Constructor Summary | |
AbstractXMLForm()
Initializes the log for the current class |
Method Summary | |
org.xmlform.Form |
getForm()
Gets the underlying XMLForm form |
java.lang.String |
getFormPath()
Gets the form path |
protected org.xmlform.validation.Validator |
getFormValidator()
Determines the current validator using the schema namespace and sets the current phase if the validator supports multi-phase validation. |
protected org.apache.commons.logging.Log |
getLog()
|
java.lang.String |
getName()
Gets the name of the form |
java.lang.String |
getPhase()
Gets the validation phase |
java.lang.String |
getSchemaNS()
Gets the schema namespace |
java.lang.String |
getValue(java.lang.String xpath)
Gets the value at the xpath path |
java.lang.String |
getValue(java.lang.String xpath,
java.lang.String def)
Gets the value at the xpath path |
boolean |
isInitialized()
Determines if the form is initialized |
boolean |
isViewstateEnabled()
Gets the validation phase |
abstract void |
loadState(java.io.InputStream in)
Loads the XML from the inputstream |
abstract void |
outputXML(java.io.OutputStream out)
Serializes the XML |
void |
prePopulate()
Called before the form is populated |
void |
reset()
Resets the form |
void |
reset(org.apache.struts.action.ActionMapping mapping,
javax.servlet.http.HttpServletRequest request)
Resets the form |
java.lang.String |
save()
Saves the form and returns a String status code |
abstract void |
setDefaultXML(org.w3c.dom.Document doc)
Sets the default xml |
void |
setForm(org.xmlform.Form form)
Sets the underlying XMLForm form |
void |
setFormPath(java.lang.String path)
Sets the form path |
void |
setName(java.lang.String name)
Sets the name of the form |
void |
setPhase(java.lang.String phase)
Sets the validation phase |
void |
setSchema(java.io.InputStream schema)
Sets the schema path |
void |
setSchemaNS(java.lang.String schema)
Sets the schema namespace |
void |
setValue(java.lang.String xpath,
java.lang.Object val)
Sets the value at the xpath path |
void |
setViewstateEnabled(boolean val)
Sets the validation phase |
abstract void |
setXML(org.w3c.dom.Document doc)
Sets the form xml |
java.util.List |
validate()
Validates the form and generates a list of violations. |
org.apache.struts.action.ActionErrors |
validate(org.apache.struts.action.ActionMapping mapping,
javax.servlet.http.HttpServletRequest request)
Validates the form |
Methods inherited from class org.apache.struts.action.ActionForm |
getMultipartRequestHandler, getServlet, getServletWrapper, reset, setMultipartRequestHandler, setServlet, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected transient org.apache.commons.logging.Log log
protected java.lang.Object xml
protected java.lang.Object defaultXML
protected transient org.xmlform.Form form
protected java.io.InputStream schema
protected java.lang.String schemaNS
protected java.lang.String phase
protected java.lang.String name
protected java.lang.String formPath
protected boolean vsEnabled
Constructor Detail |
public AbstractXMLForm()
Method Detail |
protected org.apache.commons.logging.Log getLog()
public abstract void loadState(java.io.InputStream in)
loadState
in interface XMLForm
in
- The inputstreampublic abstract void setDefaultXML(org.w3c.dom.Document doc)
setDefaultXML
in interface XMLForm
doc
- The default XMLpublic abstract void setXML(org.w3c.dom.Document doc)
setXML
in interface XMLForm
doc
- The default XMLpublic boolean isInitialized()
isInitialized
in interface XMLForm
public java.lang.String save()
save
in interface XMLForm
public void setSchema(java.io.InputStream schema)
setSchema
in interface XMLForm
schema
- The new schema pathpublic void setName(java.lang.String name)
setName
in interface XMLForm
name
- The new name valuepublic java.lang.String getName()
getName
in interface XMLForm
public java.lang.String getSchemaNS()
getSchemaNS
in interface XMLForm
public void setSchemaNS(java.lang.String schema)
setSchemaNS
in interface XMLForm
schema
- The new schema namespacepublic void setFormPath(java.lang.String path)
setFormPath
in interface XMLForm
path
- The new formPath valuepublic java.lang.String getFormPath()
getFormPath
in interface XMLForm
public boolean isViewstateEnabled()
isViewstateEnabled
in interface XMLForm
public void setViewstateEnabled(boolean val)
setViewstateEnabled
in interface XMLForm
val
- The new viewstateEnabled valuepublic java.lang.String getPhase()
getPhase
in interface XMLForm
public void setPhase(java.lang.String phase)
setPhase
in interface XMLForm
phase
- The new phase valuepublic void setForm(org.xmlform.Form form)
setForm
in interface XMLForm
form
- The new form valuepublic org.xmlform.Form getForm()
getForm
in interface XMLForm
public void reset(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
mapping
- Description of the Parameterrequest
- Description of the Parameterpublic void reset()
reset
in interface XMLForm
public abstract void outputXML(java.io.OutputStream out)
outputXML
in interface XMLForm
out
- The outputstreampublic java.util.List validate()
validate
in interface XMLForm
public void prePopulate()
prePopulate
in interface XMLForm
public org.apache.struts.action.ActionErrors validate(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
mapping
- The action mappingrequest
- The http request
public java.lang.String getValue(java.lang.String xpath)
getValue
in interface XMLForm
xpath
- The xpath path
public java.lang.String getValue(java.lang.String xpath, java.lang.String def)
getValue
in interface XMLForm
xpath
- The xpath pathdef
- The default value
public void setValue(java.lang.String xpath, java.lang.Object val)
setValue
in interface XMLForm
xpath
- The xpath pathval
- The valueprotected org.xmlform.validation.Validator getFormValidator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |