|
XFA4J | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.adobe.xfa.Obj
com.adobe.xfa.Node
com.adobe.xfa.Element
com.adobe.xfa.Model
com.adobe.xfa.form.FormModel
public class FormModel
A class to represent the result of joining a template and data.
| Nested Class Summary | |
|---|---|
static interface |
FormModel.PostMergeHandler
Defines the callback interface that will be invoked immediately after a merge but before any initialize events are fired. |
static class |
FormModel.Validate
A base class that an implementation can derive from to interact with the form validation process. |
| Nested classes/interfaces inherited from class com.adobe.xfa.Node |
|---|
Node.ChangeLogger |
| Field Summary |
|---|
| Fields inherited from class com.adobe.xfa.Node |
|---|
CREATE_ALWAYS_NEW, CREATE_IF_NOT_EXIST, CREATE_MUST_NOT_EXIST, CREATE_REPLACE |
| Method Summary | |
|---|---|
boolean |
eventOccurred(java.lang.String sActivity,
Obj container)
Notifies event listeners that an event has occurred on a container. |
boolean |
getAdjustData()
Determines whether the next FormModel.remerge() operation will adjust the
structure of the DataModel to match the TemplateModel. |
boolean |
getCalculationsEnabled()
Determines if calculations are enabled. |
FormModel.Validate |
getDefaultValidate()
Gets the default Validate object. |
static FormModel |
getFormModel(AppModel appModel,
boolean bCreateIfNotFound)
Returns the FormModel held within the AppModel. |
boolean |
getFormStateRemoved()
Determines if the formState packet has been removed. |
java.lang.String |
getFriendlyName(Element formNode)
Gets the friendly name (to use in user-facing communication) for a form node |
FormModel.PostMergeHandler |
getPostMergeHandler()
Gets the callback method that is to be invoked after merge but before any initialization scripts are run. |
int |
getRunScripts()
Gets the runAt property that specifies where scripts should be executed (client, server or both). |
boolean |
getValidationsEnabled()
Determines whether validations are enabled. |
boolean |
initialize()
Fires the initialize event on all containers on the form, and fires the indexChange event on all subforms. |
void |
merge(boolean bEmptyMerge,
boolean bAdjustData,
boolean bInitialize,
boolean bRestoreDeltas,
boolean bForceRestore)
Merges the TemplateModel and the DataModel to create the FormModel. |
boolean |
recalculate(boolean bFullRecalculate,
FormModel.Validate validate,
boolean bIgnoreCalcEnabledFlag)
Executes calculation and validation scripts. |
void |
remerge()
Forces the remerging of the DataModel and TemplateModel to recreate this FormModel. |
void |
reset()
Resets this FormModel to its initial state. |
void |
resetData(Obj container)
Resets a container to its template default value. |
void |
setAdjustData(boolean bAdjustData)
Sets whether the next FormModel.remerge() operation will adjust the
structure of the DataModel to match the structure of the TemplateModel. |
void |
setDefaultValidate(FormModel.Validate validate)
Sets the default Validate. |
void |
setEmptyMerge(boolean bEmptyMerge)
Sets whether the next FormModel.remerge() operation will do an empty
merge. |
void |
setExcludedActivities(java.lang.String sExclude)
Sets event activites that are to be excluded from execution. |
void |
setPostMergeHandler(FormModel.PostMergeHandler handler,
java.lang.Object clientData)
Sets the callback method that is to be invoked after merge but before any initialize scripts are run. |
void |
setRunScripts(int eRunAtSetting)
Sets the runAt property that specifies where scripts should be executed (client, server or both). |
| Methods inherited from class com.adobe.xfa.Model |
|---|
clearErrorList, createElement, createElement, createElement, createTextNode, getCurrentVersion, getDocument, getErrorContextList, getErrorList, normalizeNameSpaces, resolveNodes |
| Methods inherited from class com.adobe.xfa.Element |
|---|
appendChild, assignNode, getAttr, getAttribute, getElement, getFirstXFAChild, getFirstXMLChild, getInstalledLocale, getLastXMLChild, getModel, getName, getNodes, getNS, getNumAttrs, getPrefix, getText, getXFAChild, getXMLChild, isInstalledLocaleAmbient, loadXML, saveXML, setAttribute, setAttribute, setAttribute, setLocalName, setName, setNS, setQName |
| Methods inherited from class com.adobe.xfa.Node |
|---|
checkAncestorPerms, checkDescendentPerms, checkPerms, cleanDirtyFlags, compareVersions, getData, getDynamicScriptProp, getNextXFASibling, getNextXMLSibling, getOwnerDocument, getPreviousXMLSibling, getSOMExpression, getXFAChildCount, getXFAParent, getXMLChildCount, getXMLParent, hasChanged, remove, resolveNode, resolveNode, resolveNodes, setNextXMLSibling, setPermsLock, setXMLParent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static FormModel getFormModel(AppModel appModel,
boolean bCreateIfNotFound)
appModel - the AppModel to searchbCreateIfNotFound - if true, and the FormModel does not exist,
then one will be created and returned; if false
and the FormModel does not exist, null is
returned
null if
not found and bCreateIfNotFound is false.
public boolean eventOccurred(java.lang.String sActivity,
Obj container)
sActivity - the name of the eventcontainer - the container on which the event occurs
true if one or more events were dispatched.public boolean getAdjustData()
FormModel.remerge() operation will adjust the
structure of the DataModel to match the TemplateModel. The default value
is false.
true if the next FormModel.remerge() operation will
adjust the structure of the DataModel to match the TemplateModel.FormModel.remerge(),
FormModel.setAdjustData(boolean)public boolean getCalculationsEnabled()
true if calculations are enabled.public FormModel.Validate getDefaultValidate()
FormModel.validate(Validate, Element, boolean, boolean) or
FormModel.recalculate(boolean, Validate, boolean) and null
is passed to the validate parameter. For example, the default Validate
object is used when validation is initiated by the
execValidate scripting method of the FormModel.
null if no default Validate object has been set.FormModel.setDefaultValidate(Validate),
FormModel.validate(Validate, Element, boolean, boolean),
FormModel.recalculate(boolean, Validate, boolean)public boolean getFormStateRemoved()
formState packet has been removed.
true if the formState packet has been removedpublic java.lang.String getFriendlyName(Element formNode)
formNode - a FormSubform, FormField or
FormExclGroup to get a user-friendly name for.
public FormModel.PostMergeHandler getPostMergeHandler()
FormModel.setPostMergeHandler(PostMergeHandler, Object)public int getRunScripts()
EnumAttr.RUNSCRIPTS_CLIENT,
EnumAttr.RUNSCRIPTS_SERVER,
EnumAttr.RUNSCRIPTS_BOTH or
EnumAttr.RUNSCRIPTS_NONEFormModel.setRunScripts(int)public boolean getValidationsEnabled()
true if validations are enabled.public boolean initialize()
true if one or more events were dispatched.
public void merge(boolean bEmptyMerge,
boolean bAdjustData,
boolean bInitialize,
boolean bRestoreDeltas,
boolean bForceRestore)
FormModel.setEmptyMerge(boolean) and FormModel.setAdjustData(boolean)
respectively.
bEmptyMerge - if true then merge against an empty DataModel,
if false use the DataModel found in the
AppModelbAdjustData - if true adjust the structure of the DataModel
to match the structure of the TemplateModel; if
false don't modify the DataModel.bInitialize - if true all the initialize events will be
fired; if false no initialization is performedbRestoreDeltas - if true and if the restoreState property on the
form's root subform is "auto" (the default is "manual"), all
deltas are restored from the form packet. The locale attribute
is always restored from the form packet, regardless of the
value of this parameter.bForceRestore - if true, restore the state regardless of the the
restoreState property on the form's root subform.
public boolean recalculate(boolean bFullRecalculate,
FormModel.Validate validate,
boolean bIgnoreCalcEnabledFlag)
false to perform only those calculations and validations
that are dependent on the changed data values.
bFullRecalculate - if true all calculations and validations are
run. If false calculations and validations are
run as needed (i.e. if values that the validate or calculate
script are dependent on have changed since the last
recalculate).validate - an object derived from Validate. If null the
default Validate is used, and if the default Validate is also null,
no validations are performed.bIgnoreCalcEnabledFlag - if true the calculations will be performed even
if they are disabled on the host.
true if any calculations were performedFormModel.setDefaultValidate(Validate),
FormModel.getDefaultValidate()public void remerge()
FormModel.merge(boolean, boolean, boolean, boolean, boolean), and
specifying FormModel.getEmptyMerge() and FormModel.getAdjustData() for the
bEmptyMerge and bAdjustData parameters, and specifying true,
false, false for the bInitialize,
bRestoreDeltas and bForceRestore parameters.
FormModel.merge(boolean, boolean, boolean, boolean, boolean),
FormModel.getAdjustData(),
FormModel.setAdjustData(boolean),
FormModel.getEmptyMerge(),
FormModel.setEmptyMerge(boolean)public void reset()
public void resetData(Obj container)
null then it
will reset the root subform, and therefore all fields in the form.
container - the container to be resetpublic void setAdjustData(boolean bAdjustData)
FormModel.remerge() operation will adjust the
structure of the DataModel to match the structure of the TemplateModel.
bAdjustData - if true the next FormModel.remerge() operation
will adjust the structure of the DataModel to match the
structure of the TemplateModel.FormModel.getAdjustData(),
FormModel.remerge(),
FormModel.merge(boolean, boolean, boolean, boolean, boolean)public void setDefaultValidate(FormModel.Validate validate)
FormModel.recalculate(boolean, Validate, boolean) or
FormModel.validate(Validate, Element, boolean, boolean), or when validate or recalculate
are called and null is passed to the validate parameter.
If no Validate instance is available, then no validations are performed.
validate - a reference to an object derived from Validate.FormModel.getDefaultValidate()public void setEmptyMerge(boolean bEmptyMerge)
FormModel.remerge() operation will do an empty
merge. This property is also set implicity from the first parameter of
any call to FormModel.merge(boolean, boolean, boolean, boolean, boolean).
FormModel.merge(boolean, boolean, boolean, boolean, boolean),
FormModel.remerge(),
FormModel.getEmptyMerge()public void setExcludedActivities(java.lang.String sExclude)
sExclude - a space-delimited list of activities.
public void setPostMergeHandler(FormModel.PostMergeHandler handler,
java.lang.Object clientData)
handler - the PostMergeHandler implementation to be invoked after merge but before
any initialize scripts are run.clientData - this value will be passed as the parameter to FormModel.PostMergeHandler.handlePostMerge(Object)
when the callback method is invoked.FormModel.getPostMergeHandler()public void setRunScripts(int eRunAtSetting)
eRunAtSetting - one of: EnumAttr.RUNSCRIPTS_CLIENT,
EnumAttr.RUNSCRIPTS_SERVER,
EnumAttr.RUNSCRIPTS_BOTH or
EnumAttr.RUNSCRIPTS_NONEFormModel.getRunScripts()
|
XFA4J | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||