public abstract class Model extends Element implements Element.DualDomNode
| Modifier and Type | Class and Description |
|---|---|
static interface |
Model.DualDomModel
A marker interface that indicates that a Model's contents are dual-DOM,
as opposed to the model Element itself, which is always dual-DOM.
|
static class |
Model.Publisher |
Element.DualDomNode, Element.ReplaceContentNode.ChangeLoggerAttrIsDefault, AttrIsFragment, AttrIsTransient, CREATEACTIONCREATE_ALWAYS_NEW, CREATE_IF_NOT_EXIST, CREATE_MUST_NOT_EXIST, CREATE_REPLACE, gsXFANamespacePrefixATTR_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| Modifier and Type | Method and Description |
|---|---|
void |
addErrorList(ExFull error,
int eSeverity,
Element context) |
void |
addUseHRefNode(Element poUseHRefNode)
add a new new node to the useNodeHrefList
|
void |
addUseNode(Element poUse)
add a new new node to the useNodeList
|
void |
addXMLLoadErrorContext(Node oSrc,
ExFull oEx)
This method is called by derived classes to output the filename and
line number when an error occurs during the load of an XML File.
|
void |
allowUpdates(boolean bAllowUpdates)
Sets whether this model can be updated at runtime.
|
static boolean |
checkforCompatibleNS(String aNS,
String aModelNS)
Helper function for isCompatibleNS
|
void |
clearErrorList()
Clears the model's current list of errors.
|
Element |
clone(Element parent,
boolean bDeep) |
Element |
createElement(Element parent,
Node prevSibling,
String uri,
String qName)
Creates an element with the given parent, previous sibling,
namespace uri and qualified name.
|
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.
|
Element |
createElement(int eTag,
String name)
Create an element with the given element tag and name.
|
Element |
createElement(String name)
Creates an element with the given name.
|
Element |
createElement(String className,
String name,
Element parent)
Creates an element with the given class, name and parent.
|
abstract Node |
createNode(int eTag,
Element parent,
String aName,
String aNS,
boolean bDoVersionCheck)
Create an element with the given tag, parent, name and uri.
|
TextNode |
createTextNode(Element parent,
Node prevSibling,
char[] ch,
int start,
int length) |
TextNode |
createTextNode(Element parent,
Node prevSibling,
String text)
Creates a text node with the given text.
|
boolean |
doAttributeCleanup(Node node,
int eAttributeTag,
String sAttrValue)
Return TRUE if the given attribute can be removed, aka cleaned up from a given node.
|
Element |
getAliasNode()
Returns the node that is represented by the alias for this model.
|
AppModel |
getAppModel() |
boolean |
getAppModelIsTransient() |
abstract String |
getBaseNS() |
String |
getCachedLocale() |
Node |
getContext()
Retrieves the current node, which is the starting node for calls to
resolveNode() and resolveNodes() |
int |
getCurrentVersion()
Gets the current version of this model.
|
Obj |
getDelta(Element node,
String sSOM) |
Obj |
getDeltas(Node oNode) |
Document |
getDocument()
Returns this model's document.
|
List<Element> |
getErrorContextList()
Gets all the context nodes that correspond to entries in the error list.
|
List<ExFull> |
getErrorList()
Gets all the errors that have been generated by this model
since the last method call to clear the error list.
|
EventManager |
getEventManager()
the EventManager manages xfe:script scripts and their
associated events (ie.
|
Generator |
getGenerator() |
abstract String |
getHeadNS() |
int |
getHeadVersion() |
IDValueMap |
getIDValueMap() |
boolean |
getLegacySetting(AppModel.LegacyMask nLegacyFlag)
Gets the boolean value of a particular legacy setting.
|
LogMessenger |
getLogMessenger()
Retrieves the log messenger associated with this model.
|
String |
getName()
Gets this element's name.
|
boolean |
getNeedsNSNormalize() |
Element |
getNode(String aID)
Look up an XFA ID.
|
String |
getNS()
Gets this element's namespace.
|
String |
getOriginalVersion(boolean bDefault) |
ProcessingInstruction |
getOriginalVersionNode(boolean bCreate,
String sValue)
Get the processing instruction that holds our version number.
|
int |
getOriginalXFAVersion() |
List<ProtoableNode> |
getProtoList()
Keep track of proto Nodes and 'use' tags for quick lookup later our
|
Schema |
getSchema()
Return the schema definition for this model.
|
ScriptTable |
getScriptTable() |
int |
getSourceBelow() |
int |
getVersion(String sNS) |
Node |
getXmlPeer() |
boolean |
isCompatibleNS(String aNS)
Determine if a specified namespace string is compatible with the
namespace of this model.
|
boolean |
isContainer()
Check to see if this is a container object.
|
boolean |
isLoading() |
boolean |
isVersionCompatible(int nVersion,
int nTargetVersion) |
void |
loadNode(Element parent,
Node node,
Generator genTag) |
boolean |
loadRootAttributes() |
boolean |
loadSpecialAttribute(Attribute attr,
String aLocalName,
Element element,
boolean bCheckOnly)
loadSpecialAttribute should be called by the loadNode method.
|
boolean |
loadSpecialNode(Element parent,
Node node,
boolean bCheckOnly)
loadSpecialNode should be called by the loadNode method.
|
void |
modelCleanup(Node node) |
void |
nodeCleanup(Node pNode,
boolean bHasAttrs,
boolean bHasChildren) |
void |
normalizeNameSpaces() |
void |
normalizeNameSpaces(Element poNode,
String aURI)
Helper function for normalizeNameSpaces().
|
boolean |
normalizeNameSpaces(int nTargetVersion,
List<NodeValidationInfo> oResult)
Walks through the XFA DOM and
normalizes the namespaces of all the nodes.
|
Node |
preLoadNode(Element parent,
Node node,
Generator genTag)
Preprocess the node.
|
void |
preSave(boolean bSaveXMLScript)
Prepares this
Model to be saved. |
boolean |
publish(Model.Publisher publisher)
Publish the model to an Application Storage facility.
|
boolean |
ready(boolean bForced)
Indicates that the model is ready.
|
int |
remapTag(int eTag)
Remap a given tag to a new value.
|
void |
remove()
Removes this node from its parent child list.
|
void |
removeLastError() |
void |
removeReferences(Node node)
remove references to a given node.
|
NodeList |
resolveNodes(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.
|
void |
resolveProtos(boolean bForceExternalProtoResolve) |
void |
serialize(OutputStream outStream,
DOMSaveOptions options,
int level,
Node prevSibling)
The helper function used by saveXML()
|
void |
setAliasNode(Element aliasNode)
Specify the node that is represented by the alias for this model.
|
void |
setAppModel(AppModel pNewModel) |
void |
setAppModelIsTransient(boolean bAppModelIsTransient) |
void |
setContext(Node node)
Specifies the current node, which is the starting node for calls to
resolveNode and resolveNodes.
|
void |
setCurrentVersion(int nVersion) |
void |
setDOMProperties(String uri,
String localName,
String qName,
Attributes attributes)
All name properties (including those in attributes) must be interned strings.
|
void |
setIDValueMap(IDValueMap idValueMap) |
void |
setName(String name)
Set the name for this model
|
void |
setNeedsNSNormalize(boolean bNormalize) |
void |
setOriginalXFAVersion(int nXFAVersion) |
void |
setXmlPeer(Node peer) |
String |
shortCutName() |
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.
|
boolean |
willDirtyDoc() |
void |
willDirtyDoc(boolean bWillDirty) |
appendChild, appendChild, appendPI, appendPI, assignNode, clone, connectPeerToDocument, 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, insertChild, 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, resetPostLoadXML, 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, updateFromPeercheckAncestorPerms, 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, validateSchemaaddPeer, addPeeredNode, clearPeers, deafen, getClassAtom, getClassTag, getPeer, getScriptProperty, getScriptThis, invokeFunction, isDeaf, isMute, isSameClass, isSameClass, isSameClass, mute, peerRemoved, removePeer, removePeeredNode, setClass, setClassTag, setScriptProperty, unDeafen, unMutepublic static boolean checkforCompatibleNS(String aNS, String aModelNS)
aNS - - namespace of node being checkedaModelNS - - namespace of model being checked against.public ScriptTable getScriptTable()
getScriptTable in class Elementpublic final void removeLastError()
public void addUseHRefNode(Element poUseHRefNode)
public void addUseNode(Element poUse)
public void addXMLLoadErrorContext(Node oSrc, ExFull oEx)
public void allowUpdates(boolean bAllowUpdates)
true for Designer.bAllowUpdates - - true if this model can be modified at runtime, otherwise false.public void clearErrorList()
public Element clone(Element parent, boolean bDeep)
clone in class ElementElement.clone(Element)public Element createElement(Element parent, Node prevSibling, String uri, String qName)
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.public Element createElement(Element parent, Node prevSibling, String uri, String localName, String qName, Attributes attributes, int lineNumber, String fileName)
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.public final Element createElement(int eTag, String name)
eTag - the element's tag.name - the element's name, if known. This string must be interned.public final Element createElement(String className, String name, Element parent)
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.public Element createElement(String name)
name - the element's name. This string must be interned.public abstract Node createNode(int eTag, Element parent, String aName, String aNS, boolean bDoVersionCheck)
eTag - the element's tag.parent - the element's parent.aName - the element's name.aNS - the element's namespace.bDoVersionCheck - check the element's version.public final TextNode createTextNode(Element parent, Node prevSibling, char[] ch, int start, int length)
public final TextNode createTextNode(Element parent, Node prevSibling, String text)
parent - the node's parent, if any.prevSibling - the node's previous sibling, if any.text - the node's text.public final Element getAliasNode()
public AppModel getAppModel()
getAppModel in class Elementpublic boolean getAppModelIsTransient()
public abstract String getBaseNS()
public String getCachedLocale()
public final Node getContext()
resolveNode() and resolveNodes()public int getCurrentVersion()
public final Document getDocument()
public List<Element> getErrorContextList()
public List<ExFull> getErrorList()
ExFull error objects.public EventManager getEventManager()
public Generator getGenerator()
public abstract String getHeadNS()
public int getHeadVersion()
public IDValueMap getIDValueMap()
public boolean getLegacySetting(AppModel.LegacyMask nLegacyFlag)
nLegacyFlag - the specific legacy setting to checktrue if the legacy setting is set, or is the default the original version.public LogMessenger getLogMessenger()
public final String getName()
ElementThe name of an element is the value of its name attribute, or the element name if there is no name attribute.
getName in class ElementElement.getName()public boolean getNeedsNSNormalize()
public Element getNode(String aID)
Note: jfDomDocument::getElementByXFAId handles the conversion of versioned model namespace strings to unversioned ones.
aID - The node idpublic String getNS()
ElementgetNS in class ElementElement.getNS()public String getOriginalVersion(boolean bDefault)
public ProcessingInstruction getOriginalVersionNode(boolean bCreate, String sValue)
bCreate - - if true, create the PI if it doesn't existsValue - - the value to use for the PI if we create itpublic List<ProtoableNode> getProtoList()
public final Schema getSchema()
public int getSourceBelow()
public int getVersion(String sNS)
public void setXmlPeer(Node peer)
setXmlPeer in interface Element.DualDomNodepublic Node getXmlPeer()
getXmlPeer in interface Element.DualDomNodepublic boolean isCompatibleNS(String aNS)
aNS - The namespace to compare.public final boolean isContainer()
NodeisContainer in class Elementpublic final boolean isLoading()
public boolean isVersionCompatible(int nVersion,
int nTargetVersion)
public boolean loadSpecialAttribute(Attribute attr, String aLocalName, Element element, boolean bCheckOnly)
true if the attribute is handledpublic boolean loadSpecialNode(Element parent, Node node, boolean bCheckOnly)
true if the node is handledpublic boolean loadRootAttributes()
public void modelCleanup(Node node)
public void nodeCleanup(Node pNode, boolean bHasAttrs, boolean bHasChildren)
public boolean doAttributeCleanup(Node node, int eAttributeTag, String sAttrValue)
public void normalizeNameSpaces()
public void normalizeNameSpaces(Element poNode, String aURI)
poNode - the node to normalize.aURI - the new namespace.public boolean normalizeNameSpaces(int nTargetVersion,
List<NodeValidationInfo> oResult)
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.public Node preLoadNode(Element parent, Node node, Generator genTag)
null if
all siblings have been processed.public void preSave(boolean bSaveXMLScript)
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 ElementNode.preSave(boolean)public boolean publish(Model.Publisher publisher)
publisher - an instance of a class derived from TemplateModel.Publisher.public boolean ready(boolean bForced)
AppModel, this
call recursively calls ready() on each child
model (as a convenience). Some applications may choose to call
the ready() on each model individually. Calling
ready() a second time on a given model has no
effect.true if ready scripts firepublic void remove()
Noderemove in class NodeNode.remove()public void removeReferences(Node node)
public int remapTag(int eTag)
eTag - the original input tag.public NodeList resolveNodes(String somNodes, boolean bPeek, boolean bLastInstance, boolean bNoProperties, DependencyTracker oDependencyTracker, BooleanHolder isAssociation)
NoderesolveNodes in class NodeNode.resolveNodes(String, boolean, boolean, boolean)public void resolveProtos(boolean bForceExternalProtoResolve)
public void serialize(OutputStream outStream, DOMSaveOptions options, int level, Node prevSibling) throws IOException, IOException
Nodeserialize in class ElementoutStream - Streamfile to write tooptions - save optionslevel - the indent levelprevSibling - our previous sibling -- needed for some markup options.IOExceptionNode.serialize(OutputStream, DOMSaveOptions, int, Node)public final void setAliasNode(Element aliasNode)
aliasNode - The node that will represent this model.public void setAppModel(AppModel pNewModel)
pNewModel - public void setAppModelIsTransient(boolean bAppModelIsTransient)
public void setContext(Node node)
node - the new current node.
resolveNode and resolveNodes
differ from Node.resolveNode() and
Node.resolveNodes() in that the current node is
the node set via setContext(), instead of "this"
node.
public void setCurrentVersion(int nVersion)
public final void setDOMProperties(String uri, String localName, String qName, Attributes attributes)
ElementsetDOMProperties in class ElementElement.setDOMProperties(String, String, String, Attributes)public void setIDValueMap(IDValueMap idValueMap)
public final void setName(String name)
public void setNeedsNSNormalize(boolean bNormalize)
public String shortCutName()
public boolean validateUsage(int nXFAVersion,
int nAvailability,
boolean bUpdateVersion)
ObjvalidateUsage in class NodenXFAVersion - 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
codeNode.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 NodenXFAVersion - The target XFA VersionnAvailability - The target Availability flags, this indicates for what clients
the script is availableNode.validateUsageFailedIsFatal(int, int)public void willDirtyDoc(boolean bWillDirty)
public boolean willDirtyDoc()
public int getOriginalXFAVersion()
public void setOriginalXFAVersion(int nXFAVersion)
Copyright © 2010 - 2020 Adobe. All Rights Reserved