public class Element extends Node
Comment
and processing instructions
ProcessingInstruction
of a DOM,
lie outside the XFA schemas.Modifier and Type | Class and Description |
---|---|
static interface |
Element.DualDomNode
Interface that is implemented by classes that use a dual XFA/XML DOM.
|
static class |
Element.ReplaceContent
Specifies handling of existing node content when XML content is loaded.
|
Node.ChangeLogger
Modifier and Type | Field and Description |
---|---|
static int |
AttrIsDefault |
static int |
AttrIsFragment |
static int |
AttrIsTransient |
static int |
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 |
---|
Element(Element parent,
Node prevSibling,
String uri,
String localName,
String qName,
Attributes attributes,
int classTag,
String className)
Instantiates an element node with the given properties.
|
Modifier and Type | Method and Description |
---|---|
void |
appendChild(Node child) |
void |
appendChild(Node child,
boolean bValidate)
Appends the given child to this element.
|
void |
appendPI(String aPiName,
String sData) |
void |
appendPI(String aPiName,
String sPropName,
String sData) |
Node |
assignNode(String sSOMExpression,
String sValue,
int eMode)
Assigns the value given to the node located by the given
SOM (Scripting Object Model) expression and interpreted relative
to this element's context.
|
Node |
clone(Element parent) |
Element |
clone(Element parent,
boolean deep) |
void |
connectPeerToDocument()
connectPeerToDocument() is used to rearrange the DOM tree when inserting or appending a node.
|
Key |
constructKey(List<String> nodeAddressList,
Node namespaceContextNode)
Constructs a key (either primary or foreign) for an element given a node
address list.
|
void |
constructKeys(List<String> nodeAddressList,
Node namespaceContextNode,
List<Key> keys) |
void |
copyContent(Element newNode,
boolean deep) |
Attribute |
defaultAttribute(int eTag) |
int |
defaultElement()
Returns the class tag of the default one-of child (if there is one)
|
Node |
defaultElement(int eTag,
int nOccurrence) |
String |
establishID() |
Arg |
evaluate(String sEvalText,
String sEvalTypeText,
int executeReason,
boolean bReportNonFatalErrors)
Evaluates a fragment of script.
|
static void |
explodeQName(String aQName,
StringHolder aPrefix,
StringHolder aLocalName) |
int |
findAttr(String URI,
String name)
Find an attribute value by the combination of URI and name.
|
int |
findSchemaAttr(String name)
Find an attribute value by name.
|
void |
foundBadAttribute(int eTag,
String attrValue) |
void |
foundBadAttribute(String attrName,
String attrValue) |
NodeList |
getAll(boolean bByName)
Return the collection of like-named, in-scope, nodes.
|
AppModel |
getAppModel() |
String |
getAtom(int eTag)
get an attribute value, will return the default attribute value if none
exist NON validating
|
Attribute |
getAttr(int n)
Gets this element's n'th attribute.
|
Attribute |
getAttribute(int eAttributeTag)
Gets this element's attribute with the given tag.
|
Attribute |
getAttribute(int eTag,
boolean bPeek,
boolean bValidate)
Gets this element's attribute whose attribute tag is given.
|
Attribute |
getAttributeByName(String aAttrName,
boolean bSearchProto)
get the named attribute.
|
int |
getAttrIndex(Attribute attr)
get the index of this attribute.
|
String |
getAttrName(int index) |
String |
getAttrNS(int index) |
boolean |
getAttrProp(int attrIndex,
int eProp)
Get one of the volatile attribute properties.
|
String |
getAttrQName(int index) |
String |
getAttrVal(int index) |
ChildReln |
getChildReln(int eTag) |
NodeList |
getClassAll()
Return the collection of like-class, in-scope, nodes.
|
int |
getClassIndex()
Return the position of this node in its collection of like-class,
in-scope, like-child relationship, nodes.
|
String |
getClassName()
Gets this element's class name.
|
void |
getDeltas(Element delta,
XFAList list)
Gets a collection of deltas to restore.
|
Element |
getElement(int eTag,
boolean bPeek,
int nOccurrence,
boolean bReturnDefault,
boolean bValidate)
Gets this element's sub element whose element tag is given.
|
Element |
getElement(int eElementTag,
int nOccurrence)
get an element for a given node, The method will create a default if it
doesn't exist.
|
int |
getElementClass() |
Element |
getElementLocal(int eTag,
boolean bPeek,
int nOccurrence,
boolean bReturnDefault,
boolean bValidate)
This method does the work of getElement().
|
int |
getEnum(int ePropertyTag) |
EnumAttr |
getEnum(String sPropertyName) |
EventManager.EventTable |
getEventTable(boolean bCreate) |
Node |
getFirstXFAChild()
Gets this element's first XFA child.
|
Node |
getFirstXMLChild()
Gets this element's first XML child.
|
String |
getID() |
int |
getIndex(boolean bByName)
Return the position of this node in its collection of like-named,
in-scope, like-child relationship, nodes.
|
String |
getInheritedNS()
Get our namespace by traversing to our ancestors if necessary.
|
String |
getInstalledLocale()
Gets this element's installed locale.
|
boolean |
getIsNull()
Determine if this node contains a null value.
|
Node |
getLastXMLChild()
Gets this element's last XML child.
|
int |
getLineNumber() |
String |
getLocalName() |
Model |
getModel()
Gets this element's model.
|
String |
getName()
Gets this element's name.
|
Node |
getNode(int eTag,
int nOccurrence)
A variant of getElement that peeks for a non-Element and
returns it if it exists, otherwise falls back on getElement
with bPeek = true (don't create a default).
|
NodeList |
getNodes()
Gets this element's list of children.
|
NodeSchema |
getNodeSchema()
Gets the Schema for this node.
|
String |
getNS()
Gets this element's namespace.
|
int |
getNumAttrs()
Gets this element's number of attributes.
|
Node |
getOneOfChild()
In the case where an element may contain a "OneOf" child, this method
will retrieve the child element that has the XFA::oneOfChild relationship
to its parent.
|
Node |
getOneOfChild(boolean bPeek,
boolean bReturnDefault) |
void |
getPI(String aPiName,
List<String> pis,
boolean bCheckProtos)
Get the processing instruction based on the aPiName.
|
void |
getPI(String aPiName,
String sPropName,
List<String> pis,
boolean bCheckProtos)
Get the processing instruction based on the aPiName.
|
String |
getPrefix()
Gets this element's namespace prefix.
|
Object |
getProperty(int ePropTag,
int nOccurrence)
Get a property for this node.
|
Object |
getProperty(String propertyName,
int nOccurrence)
string version of getProperty.
|
boolean |
getSaveXMLSaveTransient() |
int |
getSchemaType(int eTag) |
ScriptFuncObj |
getScriptMethodInfo(String sFunctionName)
Gets the information on a script method.
|
ScriptTable |
getScriptTable() |
Node |
getSibling(int index,
boolean bByName,
boolean bExceptionIfNotFound)
a (not so) private method, overrides Node.getSibling()
|
TextNode |
getText(boolean bPeek,
boolean bReturnDefault,
boolean bValidate)
Gets this element's text node child.
|
Node |
getXFAChild(int n)
Gets this element's n'th XFA child.
|
Node |
getXMLChild(int n)
Gets this element's n'th XML child.
|
String |
getXMLName()
Gets this element's XML name.
|
String |
getXPath(Map<String,String> prefixList,
Element contextNode) |
Attribute |
getXsiNilAttribute() |
boolean |
inhibitPrettyPrint() |
void |
inhibitPrettyPrint(boolean bInhibit) |
void |
insertChild(Node newChild,
Node refNode,
boolean bValidate)
Inserts a child before a specific child in the child list.
|
boolean |
isContainer()
Check to see if this is a container object.
|
void |
isFragment(boolean bFragment,
boolean bSetChildren)
Set the fragment state of this node
|
boolean |
isHidden()
Determine if this node is hidden or not.
|
void |
isHidden(boolean bHidden)
Set the hidden state of this node.
|
boolean |
isIndexed() |
boolean |
isInstalledLocaleAmbient()
Determines if this element's installed locale
is ambient.
|
boolean |
isLeaf()
Check if this node is a leaf node
|
boolean |
isNameSpaceAttr()
Is this element's name namespaced.
|
boolean |
isPropertySpecified(int ePropTag,
boolean bCheckProtos,
int nOccurrence)
Check if a specific property has been defined for this node.
|
boolean |
isPropertySpecified(String propertyName,
boolean bCheckProtos,
int nOccurrence) |
boolean |
isPropertyValid(int ePropTag)
Check if a specified property is valid according to the schema.
|
boolean |
isSpecified(int eTag,
boolean bCheckProtos,
int nOccurrence)
Check if a property, child, or oneOfChild has been defined for this node
|
boolean |
isSpecified(int eTag,
int eType,
boolean bCheckProtos,
int nOccurrence) |
boolean |
isSpecified(String sPropertyName,
boolean bCheckProtos,
int nOccurrence) |
void |
isTransient(boolean bTransient,
boolean bSetChildren)
Set the transient state of this node.
|
boolean |
isTransparent() |
boolean |
isValidAttr(int eTag,
boolean bReport,
String value)
Determine if a specified attribute tag is valid for this node.
|
boolean |
isValidChild(int eTag,
int nError,
boolean bBeforeInsert,
boolean bOccurrenceErrorOnly) |
boolean |
isValidElement(int eTag,
boolean bReport) |
void |
loadXML(InputStream is,
boolean bIgnoreAggregatingTag,
boolean bReplaceContent)
Loads and appends the specified XML fragment (or document)
to this element.
|
void |
loadXML(InputStream is,
boolean bIgnoreAggregatingTag,
Element.ReplaceContent eReplaceContent)
Loads and appends the specified XML fragment (or document)
to this element.
|
void |
makeDefault()
Mark this element as a default property
|
void |
makeNonDefault(boolean bRecursive)
Mark this element to indicate it is not a default property
|
Attribute |
newAttribute(int eTag,
String value) |
void |
optimizeNameSpace(int eAttributeTag,
boolean bDeleteIfNotNeeded)
For use with attributes that live in a non-standard namespace.
|
Attribute |
peekAttribute(int eAttributeTag)
get an attribute value only if it exists.
|
Element |
peekElement(int eElementTag,
boolean bReturnDefault,
int nOccurrence)
get an element only if it exists NON validating READ ONLY VERSION
|
Node |
peekOneOfChild(boolean bReturnDefault)
Deprecated.
Use
getOneOfChild(true, bReturnDefault) instead. |
Object |
peekProperty(int ePropTag,
int nOccurrence)
Get a property for this node.
|
Object |
peekProperty(String propertyName,
int nOccurrence)
string version of peekProperty.
|
void |
postSave() |
void |
preSave(boolean bSaveXMLScript) |
void |
privateSetName(String name)
This version will not perform any notification or undo steps.
|
boolean |
processTextChildrenDuringParse()
Determines whether child text nodes should be processed (check validity, consolidate)
at parse time.
|
void |
removeAttr(int index) |
void |
removeAttr(String URI,
String name)
Remove an attribute as specified by the combination of URI and name.
|
void |
removeChild(Node child)
Removes a child from the child list
|
void |
removePI(String aPiName)
Remove all processing instruction based on the aPiName.
|
void |
removePI(String aPiName,
String sPropName) |
void |
removeWhiteSpace()
Remove all #text children that consist of whitespace
|
void |
removeXsiNilAttribute() |
Node |
replaceChild(Node newChild,
Node oldChild) |
void |
resetPostLoadXML() |
NodeList |
resolveAndEnumerateChildren(boolean bAllProperties,
boolean bFirstDefaultOnly)
Construct a list of element-based properties and children.
|
SOMParser.SomResultInfo |
resolveNodeCreate(String somNodesInput,
int eAction,
boolean bLeaf,
boolean bDefault,
boolean bNoProperties) |
String |
resolvePrefix(String aPrefix) |
void |
saveFilteredXML(NodeList nodeList,
OutputStream outFile,
DOMSaveOptions options) |
void |
saveXML(OutputStream outFile,
DOMSaveOptions options)
Serializes this element (and all its children) to an output stream.
|
void |
saveXML(OutputStream outFile,
DOMSaveOptions options,
boolean bSaveXMLScript)
Serializes this element (and all its children) to an output stream.
|
void |
serialize(OutputStream outStream,
DOMSaveOptions options,
int level,
Node prevSibling)
The helper function used by saveXML()
|
void |
setAttribute(Attribute attr,
int eTag)
Sets (adds) an attribute to this element.
|
void |
setAttribute(int eVal,
int eTag)
Sets (adds) an enumerated attribute value to this element.
|
Attribute |
setAttribute(String nameSpace,
String qName,
String localName,
String value)
Sets (adds) an attribute to this element.
|
Attribute |
setAttribute(String nameSpace,
String qName,
String localName,
String value,
boolean internSymbols)
Sets (adds) an attribute to this element.
|
void |
setAttrProp(int attrIndex,
int eProp,
boolean bValue)
Set one of the volatile attribute properties.
|
void |
setDefaultFlag(boolean bDefaultNode,
boolean bSetChildren) |
void |
setDOMProperties(String uri,
String localName,
String qName,
Attributes attributes)
All name properties (including those in attributes) must be interned strings.
|
Node |
setElement(Node child,
int eTag,
int nOccurrence)
Set an element value.
|
void |
setIsDataWindowRoot(boolean bIsRoot) |
void |
setIsIndexed(boolean bIsIndexed)
Set whether this node has an XMLID
|
void |
setLineNumber(int nLineNumber) |
void |
setLocalName(String name)
Sets this element's local name.
|
void |
setModel(Model model)
Sets this element's model.
|
void |
setName(String name)
Sets this element's name attribute.
|
void |
setNS(String sNS)
Sets this element's children null namespace to the given uri.
|
Node |
setOneOfChild(Node child)
In the case where an element may contain a "OneOf" child, this method
will set the child element that has the XFA::oneOfChild relationship.
|
void |
setProperty(Object property,
int ePropertyTag)
Set a property for this node.
|
void |
setProperty(Object property,
String propertyName)
string version of setProperty.
|
void |
setQName(String name)
Sets this element's qualified name.
|
void |
setSaveXMLSaveTransient(boolean bSaveTransient) |
void |
setTransparent(boolean isTransparent) |
void |
setXMLName(String name)
Sets this element's XML name.
|
void |
setXsiNilAttribute(String aValue) |
void |
updateFromPeer(Object peer,
int eventType,
String arg1,
Object arg2)
This method will be called by the peer whenever its
state changes.
|
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, remove, resolveNode, resolveNode, resolveNode, resolveNodes, resolveNodes, sendMessenge, setDirty, setDocument, setLocked, setMapped, setPermsLock, setPrivateName, setWillDirty, setXfaPeer, unLock, validateSchema, validateUsage, validateUsageFailedIsFatal
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 AttrIsDefault
public static final int AttrIsFragment
public static final int AttrIsTransient
public static final int CREATEACTION
public Element(Element parent, Node prevSibling, String uri, String localName, String qName, Attributes attributes, int classTag, String className)
parent
- the element's parent, if any.prevSibling
- the element's previous sibling, if any.uri
- the element's namespace URI.localName
- the element's local name.qName
- the element's qualified name.attributes
- the element's list of XML attributes.classTag
- the element's class tag.className
- the element's class name.public void appendChild(Node child)
public void appendChild(Node child, boolean bValidate)
child
- 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 final Node assignNode(String sSOMExpression, String sValue, int eMode)
If the node doesn't exist,
it can be created depending of the value of the given eMode.
The eMode values are those identified in
Node.assignNode()
.
assignNode
in class Node
sSOMExpression
- a SOM expression evaluating to a node.sValue
- the value to be assigned.eMode
- specifies whether the node should be created or not.public void copyContent(Element newNode, boolean deep)
public Attribute defaultAttribute(int eTag)
public int defaultElement()
public Node defaultElement(int eTag, int nOccurrence)
eTag
- The tag of the attribute we wantnOccurrence
- The zero-based occurrence of the attribute (usually zero)public final String establishID()
public final Arg evaluate(String sEvalText, String sEvalTypeText, int executeReason, boolean bReportNonFatalErrors)
sEvalText
- - the text to execute.sEvalTypeText
- - the language name. This can be the name of a script
language for which the application has installed a handler, such as "formcalc"
or "javascript", or an empty string. An empty string is equivalent to "formcalc".
Note that the appropriate language handler must be installed by the application.public final int findAttr(String URI, String name)
URI
- the namespace for this attribute. If null, don't worry about
namespace matching. If non-null, this String must be interned.name
- the name of the attribute. This String must be interned.public final int findSchemaAttr(String name)
name
- the name of the attribute. This String must be interned.public final void foundBadAttribute(int eTag, String attrValue)
public final NodeList getAll(boolean bByName)
public AppModel getAppModel()
public String getAtom(int eTag)
public final Attribute getAttr(int n)
n
- the zero-based index of the attribute.public Attribute getAttribute(int eAttributeTag)
public Attribute getAttribute(int eTag, boolean bPeek, boolean bValidate)
To peek at an attribute, set the peek argument to true. If the attribute is present, it is returned; otherwise null is returned.
To create an attribute, set the peek argument to false. If the attribute is absent, a default attribute is created and returned; for attributes with no default, null is returned.
If validation argument is true, and the validation fails, this method throws.
eTag
- the tag of the attribute.bPeek
- whether to peek at the attribute or not.bValidate
- whether to validate the attribute or not.public Attribute getAttributeByName(String aAttrName, boolean bSearchProto)
aAttrName
- - the attribute name.bSearchProto
- - whether to search protos.public final int getAttrIndex(Attribute attr)
attr
- the attribute to find.public final String getAttrName(int index)
public final String getAttrNS(int index)
index
- the index of the attribute.public final boolean getAttrProp(int attrIndex, int eProp)
attrIndex
- The offset into the attribute array.eProp
- The property to return. One of AttrIsDefault, AttrIsFragment, AttrIsTransient.public final String getAttrQName(int index)
public final String getAttrVal(int index)
public final Node getXMLChild(int n)
n
- the zero-based index of the XML child.public final Node getXFAChild(int n)
n
- the zero-based index of the XFA child.public final ChildReln getChildReln(int eTag)
public final NodeList getClassAll()
public final int getClassIndex()
public final String getClassName()
getClassName
in class Obj
public void getDeltas(Element delta, XFAList list)
delta
- an Element from the form packet.list
- the list of deltas to be populated.public Element getElement(int eTag, boolean bPeek, int nOccurrence, boolean bReturnDefault, boolean bValidate)
To return the element, set the returnDefault argument to true. If the element is present, it is returned; otherwise the default element is created and returned.
To peek at the element, set the peek argument to true. If the element is present, it is returned; otherwise null is returned. When set to true, default properties aren't created, and proto references are not expanded.
To create the element, set the peek argument to false. If the element is absent, a default element is created and returned.
If validation argument is true, and the validation fails, this method throws.
If the occurrence argument is out of range, this method throws.
eTag
- the tag of the element to retrieve.bPeek
- whether to peek at the element, or not.nOccurrence
- the n'th occurrence of the element to retrieve.bReturnDefault
- whether to create a default element, or not.bValidate
- whether to validate the element, or not.public final Element getElement(int eElementTag, int nOccurrence)
public final Node getNode(int eTag, int nOccurrence)
public final Element getElementLocal(int eTag, boolean bPeek, int nOccurrence, boolean bReturnDefault, boolean bValidate)
public final int getElementClass()
public final int getEnum(int ePropertyTag)
public EventManager.EventTable getEventTable(boolean bCreate)
bCreate
- if true, create if the map doesn't exist.public Node getFirstXMLChild()
getFirstXMLChild
in class Node
public final Node getSibling(int index, boolean bByName, boolean bExceptionIfNotFound)
getSibling
in class Node
public Node getFirstXFAChild()
getFirstXFAChild
in class Node
public final String getID()
public final int getIndex(boolean bByName)
public final String getInheritedNS()
public final String getInstalledLocale()
public final boolean isInstalledLocaleAmbient()
getInstalledLocale()
public boolean getIsNull()
public final Node getLastXMLChild()
getLastXMLChild
in class Node
public final int getLineNumber()
public String getLocalName()
public final Model getModel()
public String getName()
The name of an element is the value of its name attribute, or the element name if there is no name attribute.
public void privateSetName(String name)
public NodeList getNodes()
public final NodeSchema getNodeSchema()
public String getNS()
public final int getNumAttrs()
public final Node getOneOfChild()
public Node getOneOfChild(boolean bPeek, boolean bReturnDefault)
public void getPI(String aPiName, List<String> pis, boolean bCheckProtos)
aPiName
- the processing instruction's target name. This String must be interned.pis
- an input/output parameter that is populated with the values of
all the Processing Instructions found for PI name. with the
same aPiName.bCheckProtos
- if TRUE, check if this element is specified via prototype
inheritance. Defaults to FALSE.public void optimizeNameSpace(int eAttributeTag, boolean bDeleteIfNotNeeded)
eAttributeTag
- - the attribute (currently only XFA::RIDTAG will have any effect).bDeleteIfNotNeeded
- - if FALSE, simply declare the namespace unconditionally. This
is very efficient, but if the attribute is never used in the document then the declaration
of the namespace is superfluous. If TRUE, search the descendants of this node to see
if the attribute is in use; if it's not in use then delete any declarations of the
attribute's namespace at any level of the tree under this node. If the attribute is in
use then this will have the net effect of the FALSE setting. No superfluous namespace
declaration will occur with the TRUE setting.public void getPI(String aPiName, String sPropName, List<String> pis, boolean bCheckProtos)
aPiName
- the processing instructions target namesPropName
- the processing instructions property namepis
- an input/output parameter that is populated with the values of
all the Processing Instructions found for PI name. with the
same aPiName.bCheckProtos
- if TRUE, check if this element is specified via prototype
inheritance. Defaults to FALSE.public final String getPrefix()
public final Object getProperty(int ePropTag, int nOccurrence)
Node
getProperty
in class Node
ePropTag
- The XFA tag (name) of the property to check for.nOccurrence
- if this property can occur a fix number of times (usually
[0..n]), then specify which occurrence to get. Defaults to 0.XFA::textNodeTag()
.
The return value will never be a null object. The XFAProperty will refer
to either an Node or an Attribute.public final Object getProperty(String propertyName, int nOccurrence)
Node
getProperty
in class Node
public boolean getSaveXMLSaveTransient()
public int getSchemaType(int eTag)
public ScriptFuncObj getScriptMethodInfo(String sFunctionName)
Obj
getScriptMethodInfo
in class Obj
sFunctionName
- the name of the methodpublic ScriptTable getScriptTable()
getScriptTable
in class Node
public TextNode getText(boolean bPeek, boolean bReturnDefault, boolean bValidate)
To return the text node, set the returnDefault argument to true. If the text node is present, it is returned; otherwise the default text node is created and returned.
To peek at the text node, set the peek argument to true. If the text node is present, it is returned; otherwise null is returned. When set to true, default properties aren't created, and proto references are not expanded.
To create the text node, set the peek argument to false. If the text node is absent, a default text node is created and returned.
If validation argument is true, and the validation fails, this method throws.
bPeek
- whether to peek at the text node, or not.bReturnDefault
- whether to create a default text node, or not.bValidate
- whether to validate the text node, or not.public String getXMLName()
public void setXMLName(String name)
public Attribute getXsiNilAttribute()
public void removeXsiNilAttribute()
public final void setXsiNilAttribute(String aValue)
public final boolean inhibitPrettyPrint()
public final void inhibitPrettyPrint(boolean bInhibit)
public void insertChild(Node newChild, Node refNode, boolean bValidate)
newChild
- the child to be insertedrefNode
- the child to insert beforebValidate
- if true, validate the insertionpublic boolean isContainer()
Node
isContainer
in class Node
public void isFragment(boolean bFragment, boolean bSetChildren)
bFragment
- the fragment statebSetChildren
- if true, set this flag on all nested childrenpublic final boolean isHidden()
public final void isHidden(boolean bHidden)
bHidden
- the new hidden state.public final boolean isIndexed()
public final boolean isLeaf()
public boolean isNameSpaceAttr()
public final boolean isPropertySpecified(int ePropTag, boolean bCheckProtos, int nOccurrence)
Node
isPropertySpecified
in class Node
ePropTag
- The XFA tag (name) of the property to check for.bCheckProtos
- if true, check if this property is specified via prototype
inheritance. Defaults to true.nOccurrence
- if this property can occur a fix number of times (usually
[0..n]), then specify which occurrence to check for. Defaults
to 0.The property name should correspond to the name of either a child element that occurs 0..1 times OR is the name of an attribute. The parameter propertyName must be a valid property for this particular class.
public final boolean isPropertySpecified(String propertyName, boolean bCheckProtos, int nOccurrence)
public final boolean isPropertyValid(int ePropTag)
ePropTag
- The XFA tag (name) of the property to check for.public boolean isSpecified(int eTag, boolean bCheckProtos, int nOccurrence)
Node
isSpecified
in class Node
eTag
- The XFA tag (name) of the property/child/oneOfChild to check
for.bCheckProtos
- if true, check if this property is specified via prototype
inheritance. Defaults to true.nOccurrence
- if this property can occur a fix number of times (usually
[0..n]), then specify which occurrence to check for. Defaults
to 0.public boolean isSpecified(int eTag, int eType, boolean bCheckProtos, int nOccurrence)
public final boolean isSpecified(String sPropertyName, boolean bCheckProtos, int nOccurrence)
public final void isTransient(boolean bTransient, boolean bSetChildren)
Node
isTransient
in class Node
bTransient
- the new transient state.Node.isTransient(boolean, boolean)
public boolean isTransparent()
isTransparent
in class Node
public boolean isValidAttr(int eTag, boolean bReport, String value)
eTag
- the XFA tag to checkpublic boolean isValidChild(int eTag, int nError, boolean bBeforeInsert, boolean bOccurrenceErrorOnly)
eTag
- the class tag of the node that will be or has been appendednError
- bBeforeInsert
- if true
, then the child has not yet been inserted
into the child list of this element.bOccurrenceErrorOnly
- true
if eTag is a valid child.public boolean isValidElement(int eTag, boolean bReport)
public void loadXML(InputStream is, boolean bIgnoreAggregatingTag, boolean bReplaceContent)
is
- the input stream of XML fragment.bIgnoreAggregatingTag
- ignore the root node of the XML fragment, when true,
in which case, the children of the root node will be
appended to this element. Append the root node of the
XML fragment to this element, when false.bReplaceContent
- replace the content of this element with the content of
the root node of the XML fragment, when true.public void loadXML(InputStream is, boolean bIgnoreAggregatingTag, Element.ReplaceContent eReplaceContent)
is
- the input stream of XML fragment.bIgnoreAggregatingTag
- ignore the root node of the XML fragment, when true,
in which case, the children of the root node will be
appended to this element. Append the root node of the
XML fragment to this element, when false.eReplaceContent
- specifies handling of existing node content.public void makeDefault()
Node
makeDefault
in class Node
Node.makeDefault()
public void makeNonDefault(boolean bRecursive)
Node
makeNonDefault
in class Node
Node.makeNonDefault(boolean)
public void setDefaultFlag(boolean bDefaultNode, boolean bSetChildren)
public final Attribute peekAttribute(int eAttributeTag)
public final Element peekElement(int eElementTag, boolean bReturnDefault, int nOccurrence)
public final Node peekOneOfChild(boolean bReturnDefault)
getOneOfChild(true, bReturnDefault)
instead.Node
When one only one child node out of a set of nodes can exist for a particular node, then that set of nodes is called a oneOf children.
Note! Proto references are not expanded, SHOULD NOT modify the resulting node.
peekOneOfChild
in class Node
bReturnDefault
- true if you want the defualt node to be returned if the
"OneOf" child doesn't exist, if false null will be returnedpublic final Object peekProperty(int ePropTag, int nOccurrence)
Node
Note! Default properties are not created and proto references are not expanded, SHOULD NOT modify the resulting node.
nOccurrence
- if this property can occur a fix number of times (usually
[0..n]), then specify which occurrence to get. Defaults to 0.public final Object peekProperty(String propertyName, int nOccurrence)
Node
The parameter propertyName should correspond to the name of either a child element that occurs 0..1 times OR is the name of an attribute. The parameter propertyName must be a valid property for this particular class.
public void postSave()
postSave
in class Node
Node.postSave()
public void preSave(boolean bSaveXMLScript)
preSave
in class Node
Node.preSave(boolean)
public final void removeAttr(int index)
public final void removeAttr(String URI, String name)
URI
- the namespace for this attribute. If null, don't worry about
namespace matching. If non-null, this String must be interned.name
- the name of the attribute. This String must be interned.public final void removeChild(Node child)
child
- the node to be removedpublic final void removePI(String aPiName)
aPiName
- the processing instructions target namepublic final void removeWhiteSpace()
public void resetPostLoadXML()
public NodeList resolveAndEnumerateChildren(boolean bAllProperties, boolean bFirstDefaultOnly)
public SOMParser.SomResultInfo resolveNodeCreate(String somNodesInput, int eAction, boolean bLeaf, boolean bDefault, boolean bNoProperties)
public void saveXML(OutputStream outFile, DOMSaveOptions options)
outFile
- an output stream.options
- the XML save optionspublic void saveXML(OutputStream outFile, DOMSaveOptions options, boolean bSaveXMLScript)
outFile
- an output stream.options
- the XML save optionspublic void saveFilteredXML(NodeList nodeList, OutputStream outFile, DOMSaveOptions options)
public void serialize(OutputStream outStream, DOMSaveOptions options, int level, Node prevSibling) throws IOException
Node
serialize
in class Node
outStream
- Streamfile to write tooptions
- save optionslevel
- the indent levelprevSibling
- our previous sibling -- needed for some markup options.IOException
Node.serialize(OutputStream, DOMSaveOptions, int, Node)
public void setAttribute(Attribute attr, int eTag)
attr
- the attribute.eTag
- The XFA tag name of the attribute being set.public final void setAttribute(int eVal, int eTag)
public final Attribute setAttribute(String nameSpace, String qName, String localName, String value)
nameSpace
- namespace of the attribute.qName
- the qualified name of the attribute.localName
- the local name of the attribute.value
- the value of the attribute.public final Attribute setAttribute(String nameSpace, String qName, String localName, String value, boolean internSymbols)
The internSymbols parameter specifies whether the nameSpace, qName and localName parameters need to be interned. If it is known that these symbols are already interned (eg, they were retrieved from another Attribute, or are literal values), then specifing false for internSymbols saves the overhead for interning.
nameSpace
- namespace of the attribute.qName
- the qualified name of the attribute.localName
- the local name of the attribute.value
- the value of the attribute.internSymbols
- indicates whether the namespace, qName and localName argument need to be interned.public final void setAttrProp(int attrIndex, int eProp, boolean bValue)
attrIndex
- The offset into the attribute array.eProp
- The property to return. One of AttrIsDefault, AttrIsFragment, AttrIsTransient.bValue
- the boolean value of the propertypublic void setDOMProperties(String uri, String localName, String qName, Attributes attributes)
public Node setElement(Node child, int eTag, int nOccurrence)
child
- the child to add or set.eTag
- only used if oChild isNull -- in which case we remove the
elementpublic final void setIsIndexed(boolean bIsIndexed)
bIsIndexed
- public final void setLineNumber(int nLineNumber)
public void setLocalName(String name)
name
- the new local name.public final void setModel(Model model)
model
- the model this element belongs to.public void setName(String name)
public final void setNS(String sNS)
sNS
- the namespace uri. This string must be interned.
Javaport: added.public Node setOneOfChild(Node child)
child
- the child to set. If this is a null object, any any existing
"oneOf" child will be deleted.public final void setProperty(Object property, int ePropertyTag)
XFA::textNodeTag()
.property
- The XFA element that defines this property.ePropertyTag
- The XFA tag (name) of the property.public final void setProperty(Object property, String propertyName)
public final void setQName(String name)
name
- the new qualified name.public void setSaveXMLSaveTransient(boolean bSaveTransient)
public final void setTransparent(boolean isTransparent)
public void updateFromPeer(Object peer, int eventType, String arg1, Object arg2)
Peer
eventType (String)arg1 (Object)arg2 UPDATED update type (optional) ATTR_CHANGED attr name (optional) CHILD_ADDED (optional) added node CHILD_REMOVED (optional) removed node VALUE_CHANGED new data (optional) PARENT_CHANGED (optional) new parent DESCENDENT_ATTR_CHANGED attr name changed node DESCENDENT_VALUE_CHANGED (optional) changed node DESCENDENT_ADDED (optional) added node DESCENDENT_REMOVED (optional) removed node PERMS_LOCK_SET (optional) (optional) PERMS_LOCK_CLEARED (optional) (optional) PROTO_ATTR_CHANGED attr name changed node PROTO_CHILD_ADDED (optional) added node of the protoype PROTO_CHILD_REMOVED (optional) removed node from the prototype PROTO_VALUE_CHANGED new data prototype node PROTO_DESCENDENT_ATTR_CHANGED attr name changed prototype node PROTO_DESCENDENT_VALUE_CHANGED (optional) changed prototype node PROTO_DESCENDENT_ADDED (optional) added node to the prototype PROTO_DESCENDENT_REMOVED (optional) removed node from the prototype
updateFromPeer
in interface Peer
updateFromPeer
in class Obj
peer
- the peer to this object.eventType
- the event type as enumerated in this classarg1
- additional event informationarg2
- additional event informationObj.updateFromPeer(Object, int, String, Object)
public boolean processTextChildrenDuringParse()
true
if child text nodes should be processed at parse time.public void connectPeerToDocument()
public final void setIsDataWindowRoot(boolean bIsRoot)
public Key constructKey(List<String> nodeAddressList, Node namespaceContextNode)
public void constructKeys(List<String> nodeAddressList, Node namespaceContextNode, List<Key> keys)
public static void explodeQName(String aQName, StringHolder aPrefix, StringHolder aLocalName)
Copyright © 2010 - 2020 Adobe. All Rights Reserved