public final class DataModel extends Model implements Model.DualDomModel
Modifier and Type | Class and Description |
---|---|
static class |
DataModel.AttributeWrapper
The AttributeWrapper exists so that we can pass an Attribute to a method that expects an Element.
|
static interface |
DataModel.SourceSetLink |
Model.DualDomModel, Model.Publisher
Element.DualDomNode, Element.ReplaceContent
Node.ChangeLogger
Modifier and Type | Field and Description |
---|---|
static int |
FMT_XML_DATA
Enumeration XFAXMLFormat:
FMT_XML_DATA = 3rd party XML,
FMT_XPF_DATA = XPF format.
|
static int |
FMT_XPF_DATA |
AttrIsDefault, AttrIsFragment, AttrIsTransient, CREATEACTION
CREATE_ALWAYS_NEW, CREATE_IF_NOT_EXIST, CREATE_MUST_NOT_EXIST, CREATE_REPLACE, gsXFANamespacePrefix
ATTR_CHANGED, CHILD_ADDED, CHILD_REMOVED, DESCENDENT_ADDED, DESCENDENT_ATTR_CHANGED, DESCENDENT_REMOVED, DESCENDENT_VALUE_CHANGED, PARENT_CHANGED, PERMS_LOCK_CLEARED, PERMS_LOCK_SET, PROTO_ATTR_CHANGED, PROTO_CHILD_ADDED, PROTO_CHILD_REMOVED, PROTO_DESCENDENT_ADDED, PROTO_DESCENDENT_ATTR_CHANGED, PROTO_DESCENDENT_REMOVED, PROTO_DESCENDENT_VALUE_CHANGED, PROTO_VALUE_CHANGED, UPDATED, VALUE_CHANGED
Constructor and Description |
---|
DataModel(Element parent,
Node prevSibling)
Default Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
appendChild(Node newChild,
boolean bValidate)
Appends the given child to this element.
|
void |
connectPeerToDocument()
connectPeerToDocument() is used to rearrange the DOM tree when inserting or appending a node.
|
Node |
createChild(boolean bIsLeaf,
String aName)
Creates a child of the current node.
|
DataNode |
createDataRootElement(DataNode dataDescription) |
Element |
createElement(Element parent,
Node prevSibling,
String uri,
String localName,
String qName,
Attributes attributes,
int lineNumber,
String fileName)
Creates an element with the given parent, sibling, namespace uri,
local name and SAX attributes.
|
Node |
createNode(int eClassTag,
Element parent,
String aNodeName,
String ns,
boolean bDoVersionCheck)
Create an element with the given tag, parent, name and uri.
|
static String |
dataDescriptionNS() |
void |
disableSchemaValidation(boolean bMode) |
static Node |
findAssociation(Node dataDesc,
String aAssociationName)
Recursive search of a data description for a
|
Attribute |
findAttrInNS(Attribute[] attrs,
String aNodeName)
Given an array of attributes, find the specified node name which exists
in a namespace that is compatible with this data model's namespace.
|
Attribute |
findAttrInNS(Element e,
String aNodeName)
Find an attribute via loose namespace checking.
|
String |
getBaseNS() |
DataNode |
getDataDescriptionRoot(String sDataRootName) |
static DataModel |
getDataModel(AppModel app,
boolean bCreateIfNotFound,
boolean bAppend)
Gets the data model held within an XFA DOM hierarchy.
|
DataNode |
getDataRoot() |
DataWindow |
getDataWindow() |
String |
getHeadNS() |
int |
getHeadVersion() |
static void |
getReflectedNodes(Node dataNode,
String aTargetNamespaceURI,
String aTargetName,
Key targetKey,
List<String> oFKeyValueAddressList,
Node namespaceContextNode,
NodeList results)
Recursive search of a data model for nodes of a particular target QName whose foreign key
matches the supplied primary key.
|
static DataNode |
getRootOfDataDescription(Node dataDesc)
Find a data description node's
|
ScriptTable |
getScriptTable() |
DataModel.SourceSetLink |
getSourceSetLink() |
void |
initFromDataDescription(Element dataNode)
used to ensure an export data tree has a basic population
since an export data tree doesn't necessarily have any actual
data bindings.
|
void |
insertChild(Node newChild,
Node refChild,
boolean bValidate)
Inserts a child before a specific child in the child list.
|
boolean |
isCompatibleNS(String aNS)
Determine if a specified namespace string is compatible with the
namespace of this model.
|
void |
loadNode(Element parent,
Node node,
Generator generator) |
boolean |
loadRootAttributes() |
void |
preSave(boolean bSaveXMLScript)
Prepares this
Model to be saved. |
void |
remove()
Removes this node from its parent child list.
|
static void |
removeDDPlaceholderFlags(Node dataNode,
boolean bDeep) |
void |
resetPostLoadXML() |
static Obj |
resolveAssociation(Element dataNode,
String aAssociationName,
BooleanHolder foundNullAssociation) |
Node |
resolveRef(String sSOM,
Element contextNode,
boolean bDataValue,
boolean bDefault) |
void |
serialize(OutputStream os,
DOMSaveOptions options,
int level,
Node prevSibling)
The helper function used by saveXML()
|
void |
setSaveFormat(int format) |
void |
setSourceSetLink(DataModel.SourceSetLink sourceSetLink) |
boolean |
validateUsage(int nXFAVersion,
int nAvailability,
boolean bUpdateVersion)
Validate if the given Version and Availability flags are valid for the
current document
|
boolean |
validateUsageFailedIsFatal(int nXFAVersion,
int nAvailability)
Determines if disallowing a version should be considered a fatal error.
|
addErrorList, addUseHRefNode, addUseNode, addXMLLoadErrorContext, allowUpdates, checkforCompatibleNS, clearErrorList, clone, createElement, createElement, createElement, createElement, createTextNode, createTextNode, doAttributeCleanup, getAliasNode, getAppModel, getAppModelIsTransient, getCachedLocale, getContext, getCurrentVersion, getDelta, getDeltas, getDocument, getErrorContextList, getErrorList, getEventManager, getGenerator, getIDValueMap, getLegacySetting, getLogMessenger, getName, getNeedsNSNormalize, getNode, getNS, getOriginalVersion, getOriginalVersionNode, getOriginalXFAVersion, getProtoList, getSchema, getSourceBelow, getVersion, getXmlPeer, isContainer, isLoading, isVersionCompatible, loadSpecialAttribute, loadSpecialNode, modelCleanup, nodeCleanup, normalizeNameSpaces, normalizeNameSpaces, normalizeNameSpaces, preLoadNode, publish, ready, remapTag, removeLastError, removeReferences, resolveNodes, resolveProtos, setAliasNode, setAppModel, setAppModelIsTransient, setContext, setCurrentVersion, setDOMProperties, setIDValueMap, setName, setNeedsNSNormalize, setOriginalXFAVersion, setXmlPeer, shortCutName, willDirtyDoc, willDirtyDoc
appendChild, appendPI, appendPI, assignNode, clone, constructKey, constructKeys, copyContent, defaultAttribute, defaultElement, defaultElement, establishID, evaluate, explodeQName, findAttr, findSchemaAttr, foundBadAttribute, foundBadAttribute, getAll, getAtom, getAttr, getAttribute, getAttribute, getAttributeByName, getAttrIndex, getAttrName, getAttrNS, getAttrProp, getAttrQName, getAttrVal, getChildReln, getClassAll, getClassIndex, getClassName, getDeltas, getElement, getElement, getElementClass, getElementLocal, getEnum, getEnum, getEventTable, getFirstXFAChild, getFirstXMLChild, getID, getIndex, getInheritedNS, getInstalledLocale, getIsNull, getLastXMLChild, getLineNumber, getLocalName, getModel, getNode, getNodes, getNodeSchema, getNumAttrs, getOneOfChild, getOneOfChild, getPI, getPI, getPrefix, getProperty, getProperty, getSaveXMLSaveTransient, getSchemaType, getScriptMethodInfo, getSibling, getText, getXFAChild, getXMLChild, getXMLName, getXPath, getXsiNilAttribute, inhibitPrettyPrint, inhibitPrettyPrint, isFragment, isHidden, isHidden, isIndexed, isInstalledLocaleAmbient, isLeaf, isNameSpaceAttr, isPropertySpecified, isPropertySpecified, isPropertyValid, isSpecified, isSpecified, isSpecified, isTransient, isTransparent, isValidAttr, isValidChild, isValidElement, loadXML, loadXML, makeDefault, makeNonDefault, newAttribute, optimizeNameSpace, peekAttribute, peekElement, peekOneOfChild, peekProperty, peekProperty, postSave, privateSetName, processTextChildrenDuringParse, removeAttr, removeAttr, removeChild, removePI, removePI, removeWhiteSpace, removeXsiNilAttribute, replaceChild, resolveAndEnumerateChildren, resolveNodeCreate, resolvePrefix, saveFilteredXML, saveXML, saveXML, setAttribute, setAttribute, setAttribute, setAttribute, setAttrProp, setDefaultFlag, setElement, setIsDataWindowRoot, setIsIndexed, setLineNumber, setLocalName, setModel, setNS, setOneOfChild, setProperty, setProperty, setQName, setSaveXMLSaveTransient, setTransparent, setXMLName, setXsiNilAttribute, updateFromPeer
checkAncestorPerms, checkDescendentPerms, checkPerms, cleanDirtyFlags, compareVersions, getData, getFirstXMLChildElement, getLocked, getNextXFASibling, getNextXMLSibling, getNextXMLSiblingElement, getNodeAsXML, getOwnerDocument, getPIAsXML, getPIName, getPreviousXMLSibling, getPrivateName, getPropName, getSOMExpression, getSOMExpression, getSomName, getUniqueSOMName, getWillDirty, getXFAChildCount, getXFAParent, getXfaPeer, getXMLChildCount, getXMLParent, hasChanged, isDefault, isDirty, isMapped, isPermsLockSet, isTransient, locateChildByClass, locateChildByName, logValueChangeHelper, notifyPeers, performSOMAssignment, resolveNode, resolveNode, resolveNode, resolveNodes, sendMessenge, setDirty, setDocument, setLocked, setMapped, setPermsLock, setPrivateName, setWillDirty, setXfaPeer, unLock, validateSchema
addPeer, addPeeredNode, clearPeers, deafen, getClassAtom, getClassTag, getPeer, getScriptProperty, getScriptThis, invokeFunction, isDeaf, isMute, isSameClass, isSameClass, isSameClass, mute, peerRemoved, removePeer, removePeeredNode, setClass, setClassTag, setScriptProperty, unDeafen, unMute
public static final int FMT_XML_DATA
public static final int FMT_XPF_DATA
public static String dataDescriptionNS()
public static DataModel getDataModel(AppModel app, boolean bCreateIfNotFound, boolean bAppend)
app
- the application model.bCreateIfNotFound
- when true, create a data model if needed.bAppend
- when true, append any underling xml to the xfa root
element when loading, and when false, create orphan
xfa:datasets and xfa:data nodes. This behaviour
occurs only works when bCreateIfNotFound is set to true.public ScriptTable getScriptTable()
getScriptTable
in class Model
public void appendChild(Node newChild, boolean bValidate)
Element
appendChild
in class Element
newChild
- the child node being appended.bValidate
- when true, ensures the given child is valid
per the model's schema and throws an ExFull
if not.public Node createChild(boolean bIsLeaf, String aName)
Node
bIsLeaf
- true if the child to be created is a leaf child.aName
- an interned string representing the name
of the child to be created.public Node createNode(int eClassTag, Element parent, String aNodeName, String ns, boolean bDoVersionCheck)
Model
createNode
in class Model
eClassTag
- the element's tag.parent
- the element's parent.aNodeName
- the element's name.ns
- the element's namespace.bDoVersionCheck
- check the element's version.public Element createElement(Element parent, Node prevSibling, String uri, String localName, String qName, Attributes attributes, int lineNumber, String fileName)
Model
createElement
in class Model
parent
- the element's parent, if any.prevSibling
- the element's previous sibling, if any.uri
- the element's namespace. This string must be interned.localName
- the element's name. This string must be interned.qName
- the element's qualified name. This string must be interned.attributes
- the element's (SAX) attribute definitions.Model.createElement(Element, Node, String, String, String,
Attributes, int, String)
public Attribute findAttrInNS(Element e, String aNodeName)
e
- the element to searchaNodeName
- the local name of the attributepublic Attribute findAttrInNS(Attribute[] attrs, String aNodeName)
attrs
- the array of attributes to searchaNodeName
- the local name of the attributepublic String getBaseNS()
getBaseNS
in class Model
Model.getBaseNS()
public void connectPeerToDocument()
Element
connectPeerToDocument
in class Element
public DataNode getDataRoot()
public DataWindow getDataWindow()
public DataModel.SourceSetLink getSourceSetLink()
public void initFromDataDescription(Element dataNode)
public void insertChild(Node newChild, Node refChild, boolean bValidate)
Element
insertChild
in class Element
newChild
- the child to be insertedrefChild
- the child to insert beforebValidate
- if true, validate the insertionpublic boolean isCompatibleNS(String aNS)
Model
isCompatibleNS
in class Model
aNS
- The namespace to compare.public boolean loadRootAttributes()
loadRootAttributes
in class Model
public void preSave(boolean bSaveXMLScript)
Model
Model
to be saved. Any model maintenance that
may have been deferred is performed to ensure that the serialized form of
the Model
is correct. This method is called automatically
before a Model
is serialized to a stream, so it does not
normally need to be called directly. The exception is when a
Document
is saved using
Document.saveAs(java.io.OutputStream, Node, DOMSaveOptions)
or
Document.saveXML(java.io.OutputStream, DOMSaveOptions)
.preSave
in class Model
Node.preSave(boolean)
public void remove()
Node
remove
in class Model
Node.remove()
public static void removeDDPlaceholderFlags(Node dataNode, boolean bDeep)
public void resetPostLoadXML()
resetPostLoadXML
in class Element
public Node resolveRef(String sSOM, Element contextNode, boolean bDataValue, boolean bDefault)
public void serialize(OutputStream os, DOMSaveOptions options, int level, Node prevSibling) throws IOException
Node
serialize
in class Model
os
- Streamfile to write tooptions
- save optionslevel
- the indent levelprevSibling
- our previous sibling -- needed for some markup options.IOException
Element.serialize(OutputStream, DOMSaveOptions, int, Node)
public void setSourceSetLink(DataModel.SourceSetLink sourceSetLink)
public void setSaveFormat(int format)
public boolean validateUsage(int nXFAVersion, int nAvailability, boolean bUpdateVersion)
Obj
validateUsage
in class Model
nXFAVersion
- The target XFA VersionnAvailability
- The target Availability flags, this indicates for what clients
the script is availablebUpdateVersion
- indicates if the model version can be updated by the calling
codeModel.validateUsage(int, int, boolean)
public boolean validateUsageFailedIsFatal(int nXFAVersion, int nAvailability)
Obj
This method is called after calling
Obj.validateUsage(int, int, boolean)
when that method returns false.
validateUsageFailedIsFatal
in class Model
nXFAVersion
- The target XFA VersionnAvailability
- The target Availability flags, this indicates for what clients
the script is availableModel.validateUsageFailedIsFatal(int, int)
public void disableSchemaValidation(boolean bMode)
public int getHeadVersion()
getHeadVersion
in class Model
public static Obj resolveAssociation(Element dataNode, String aAssociationName, BooleanHolder foundNullAssociation)
public static DataNode getRootOfDataDescription(Node dataDesc)
public static Node findAssociation(Node dataDesc, String aAssociationName)
public static void getReflectedNodes(Node dataNode, String aTargetNamespaceURI, String aTargetName, Key targetKey, List<String> oFKeyValueAddressList, Node namespaceContextNode, NodeList results)
Copyright © 2010 - 2020 Adobe. All Rights Reserved