|
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
public class Element
A class to represent the XFA elements in a DOM.
Elements differ from nodes in that they all
conform to an XFA schema. All the XML
comments Comment and processing instructions
ProcessingInstruction of a DOM,
lie outside the XFA schemas.
| 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 |
| Constructor Summary | |
|---|---|
protected |
Element()
Instantiates an element node. |
protected |
Element(Element parent,
Node prevSibling)
Instantiates an element node. |
protected |
Element(Element parent,
Node prevSibling,
java.lang.String uri,
java.lang.String name)
Instantiates an element node with the given properties. |
| Method Summary | |
|---|---|
void |
appendChild(Node child,
boolean bValidate)
Appends the given child to this element. |
Node |
assignNode(java.lang.String sSOMExpression,
java.lang.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. |
Attribute |
getAttr(int n)
Gets this element's n'th attribute. |
Attribute |
getAttribute(int eTag,
boolean bPeek,
boolean bValidate)
Gets this element's attribute whose attribute tag is given. |
Element |
getElement(int eTag,
boolean bPeek,
int nOccurrence,
boolean bReturnDefault,
boolean bValidate)
Gets this element's sub element whose element tag is given. |
Node |
getFirstXFAChild()
Gets this element's first XFA child. |
Node |
getFirstXMLChild()
Gets this element's first XML child. |
java.lang.String |
getInstalledLocale()
Gets this element's installed locale. |
Node |
getLastXMLChild()
Gets this element's last XML child. |
Model |
getModel()
Gets this element's model. |
java.lang.String |
getName()
Gets this element's name. |
NodeList |
getNodes()
Gets this element's list of children. |
java.lang.String |
getNS()
Gets this element's namespace. |
int |
getNumAttrs()
Gets this element's number of attributes. |
java.lang.String |
getPrefix()
Gets this element's namespace prefix. |
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. |
boolean |
isInstalledLocaleAmbient()
Determines if this element's installed locale is ambient. |
void |
loadXML(java.io.InputStream is,
boolean bIgnoreAggregatingTag,
boolean bReplaceContent)
Loads and appends the specified XML fragment (or document) to this element. |
void |
saveXML(java.io.OutputStream outFile,
DOMSaveOptions options)
Serializes this element (and all its children) to an output stream. |
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(java.lang.String nameSpace,
java.lang.String qName,
java.lang.String localName,
java.lang.String value)
Sets (adds) an attribute to this element. |
void |
setLocalName(java.lang.String name)
Sets this element's local name. |
void |
setName(java.lang.String name)
Sets this element's name attribute. |
void |
setNS(java.lang.String sNS)
Sets this element's children null namespace to the given uri. |
void |
setQName(java.lang.String name)
Sets this element's qualified name. |
| 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 |
| Constructor Detail |
|---|
protected Element()
protected Element(Element parent,
Node prevSibling)
parent - the element's parent, if any.prevSibling - the element's previous sibling, if any.
protected Element(Element parent,
Node prevSibling,
java.lang.String uri,
java.lang.String name)
parent - the element's parent, if any.prevSibling - the element's previous sibling, if any.uri - the element's namespace URI.name - the element's name.| Method Detail |
|---|
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(java.lang.String sSOMExpression,
java.lang.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 NodesSOMExpression - a SOM expression evaluating to a node.sValue - the value to be assigned.eMode - specifies whether the node should be created or not.
public final Attribute getAttr(int n)
n - the zero-based index of the attribute.
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 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 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 Node getFirstXMLChild()
getFirstXMLChild in class Nodepublic Node getFirstXFAChild()
getFirstXFAChild in class Nodepublic final java.lang.String getInstalledLocale()
public final boolean isInstalledLocaleAmbient()
Element.getInstalledLocale()public final Node getLastXMLChild()
getLastXMLChild in class Nodepublic final Model getModel()
getModel in class Nodepublic java.lang.String getName()
The name of an element is the value of its name attribute, or the element name if there is no name attribute.
getName in class Nodepublic NodeList getNodes()
getNodes in class Nodepublic java.lang.String getNS()
public final int getNumAttrs()
public final java.lang.String getPrefix()
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 void loadXML(java.io.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 saveXML(java.io.OutputStream outFile,
DOMSaveOptions options)
outFile - an output stream.options - the XML save options
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)
eVal - the enumerated attribute value.
See EnumAttr for valid values.eTag - the XFA tag name of the attribute being set.
See XFA for valid tag names.
public final Attribute setAttribute(java.lang.String nameSpace,
java.lang.String qName,
java.lang.String localName,
java.lang.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 void setLocalName(java.lang.String name)
name - the new local name.public void setName(java.lang.String name)
setName in class Nodename - the name attribute value.public final void setNS(java.lang.String sNS)
sNS - the namespace uri. This string must be interned.
Javaport: added.public final void setQName(java.lang.String name)
name - the new qualified name.
|
XFA4J | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||