XFA4J

com.adobe.xfa
Class Model

java.lang.Object
  extended by com.adobe.xfa.Obj
      extended by com.adobe.xfa.Node
          extended by com.adobe.xfa.Element
              extended by com.adobe.xfa.Model
Direct Known Subclasses:
AppModel, ConfigurationModel, DataModel, FormModel, LocaleSetModel, TemplateModel

public abstract class Model
extends Element

An abstract class from which to derive all other models.


Nested Class Summary
 
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
 void clearErrorList()
          Clears the model's current list of errors.
 Element createElement(Element parent, Node prevSibling, java.lang.String uri, java.lang.String qName)
          Creates an element with the given parent, previous sibling, namespace uri and qualified name.
 Element createElement(int eTag, java.lang.String name)
          Create an element with the given element tag and name.
 Element createElement(java.lang.String className, java.lang.String name, Element parent)
          Creates an element with the given class, name and parent.
 TextNode createTextNode(Element parent, Node prevSibling, java.lang.String text)
          Creates a text node with the given text.
 int getCurrentVersion()
          Gets the current version of this model.
 Document getDocument()
          Returns this model's document.
 java.util.List<Element> getErrorContextList()
          Gets all the context nodes that correspond to entries in the error list.
 java.util.List<ExFull> getErrorList()
          Gets all the errors that have been generated by this model since the last method call to clear the error list.
 boolean normalizeNameSpaces(int nTargetVersion, java.util.List<NodeValidationInfo> oResult)
          Walks through the XFA DOM and normalizes the namespaces of all the nodes.
 NodeList resolveNodes(java.lang.String somNodes, boolean bPeek, boolean bLastInstance, boolean bNoProperties, DependencyTracker oDependencyTracker, BooleanHolder isAssociation)
          Evaluates the Scripting Object Model expression, using this node as the current context.
 
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

clearErrorList

public void clearErrorList()
Clears the model's current list of errors.


createElement

public Element createElement(Element parent,
                             Node prevSibling,
                             java.lang.String uri,
                             java.lang.String qName)
Creates an element with the given parent, previous sibling, namespace uri and qualified name.

Parameters:
parent - the element's parent, if any.
prevSibling - the element's previous sibling, if any.
uri - the element's namespace URI. This string must be interned.
qName - the element's qualified name. This string must be interned.
Returns:
a new element conformant to our schema.

createElement

public final Element createElement(int eTag,
                                   java.lang.String name)
Create an element with the given element tag and name.

Parameters:
eTag - the element's tag.
name - the element's name, if known. This string must be interned.
Returns:
a new element conformant to the XFA schema.

createElement

public final Element createElement(java.lang.String className,
                                   java.lang.String name,
                                   Element parent)
Creates an element with the given class, name and parent.

Parameters:
className - the element's class name. This string must be interned.
name - the element's name, if known. This string must be interned.
parent - the element's parent.
Returns:
a new element conformant to the XFA schema.

createTextNode

public final TextNode createTextNode(Element parent,
                                     Node prevSibling,
                                     java.lang.String text)
Creates a text node with the given text.

Parameters:
parent - the node's parent, if any.
prevSibling - the node's previous sibling, if any.
text - the node's text.
Returns:
a new node conformant to our schema.

getCurrentVersion

public int getCurrentVersion()
Gets the current version of this model.

Returns:
the version number (times 10).

getDocument

public final Document getDocument()
Returns this model's document.

Returns:
the document node.

getErrorContextList

public java.util.List<Element> getErrorContextList()
Gets all the context nodes that correspond to entries in the error list.

Returns:
A list of Element objects where the load discovered a problem.

getErrorList

public java.util.List<ExFull> getErrorList()
Gets all the errors that have been generated by this model since the last method call to clear the error list. Note that these are not fatal errors. They are typically syntax problems discovered when loading the collateral. Some applications may choose to sift through the list and stop processing if they recognize specific problems. However most applications should simply dump the messages into the log file and continue processing. i.e. treat this as a list of warnings.

Returns:
the current list of ExFull error objects.

normalizeNameSpaces

public boolean normalizeNameSpaces(int nTargetVersion,
                                   java.util.List<NodeValidationInfo> oResult)
Walks through the XFA DOM and normalizes the namespaces of all the nodes.

Parameters:
nTargetVersion - the version of the schema desired. One of XFAVERSION_10, ... XFAVERSION_HEAD.
oResult - a list of NodeValidationInfo objects: invalid children, attributes and attribute values based upon the target version. If this model is not a valid child of its parent, this model will be the first entry of oResult. If oResult is not null, this method will ensure all child nodes attributes and attribute values are valid for given the target version.
Returns:
true if successful, else false.

resolveNodes

public NodeList resolveNodes(java.lang.String somNodes,
                             boolean bPeek,
                             boolean bLastInstance,
                             boolean bNoProperties,
                             DependencyTracker oDependencyTracker,
                             BooleanHolder isAssociation)
Description copied from class: Node
Evaluates the Scripting Object Model expression, using this node as the current context.

Overrides:
resolveNodes in class Node
See Also:
Node.resolveNodes(String, boolean, boolean, boolean)

XFA4J

© 2005 Adobe Systems Incorporated. All Rights Reserved.