|
NetKernel APIs |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ten60.netkernel.xml.xda.DOMXDA
public class DOMXDA
Implementation of IXDA, IXDAIterator, IXDAReadOnly and IXDAReadOnlyIterator using DOM
| Field Summary | |
|---|---|
static java.lang.String |
XMLNS_DECLARATION_URI
|
| Constructor Summary | |
|---|---|
DOMXDA(org.w3c.dom.Document aDocument)
Creates a new instance of DOMXDA |
|
DOMXDA(org.w3c.dom.Document aDocument,
boolean clone)
|
|
DOMXDA(DOMXDA aOther)
|
|
DOMXDA(org.w3c.dom.Node aRoot,
DOMXDA aParentXDA)
|
|
DOMXDA(org.w3c.dom.Node aRoot,
DOMXDA aParentXDA,
boolean clone)
|
|
| Method Summary | |
|---|---|
void |
append(IXDAReadOnly aSource,
java.lang.String aSourceXPath,
java.lang.String aTargetXPath)
Append fragment of source to this at a specified location or locations |
void |
appendPath(java.lang.String aTargetXPath,
java.lang.String aNewRelativeXPath,
java.lang.String aOptionalValue)
Builds and appends a chain of elements to a location or locations within this |
void |
applyNS(java.lang.String aTargetXPath,
java.lang.String prefix,
java.lang.String uri)
Apply namespace to target location or locations |
void |
declareNS(java.lang.String aTargetXPath,
java.lang.String prefix,
java.lang.String uri)
|
void |
delete(java.lang.String aTargetXPath)
Delete elements at target location or locations |
IXPathResult |
eval(java.lang.String aTargetXPath)
Evaluate the xpath against the document returning an IXPathResult |
java.lang.String |
getCurrentXPath()
return an xpath representation of the current context node |
org.w3c.dom.Document |
getDocument()
|
org.w3c.dom.Document |
getFragment(org.w3c.dom.Node node)
Returns the document fragment located by a Node |
org.w3c.dom.Document |
getFragment(java.lang.String aXPath)
Returns the document fragment located by an unambiguous XPath |
java.util.Map |
getMap(java.lang.String aTargetXPath,
boolean aTrim)
Returns |
org.w3c.dom.NodeList |
getNodeList(java.lang.String aXPath)
Evaluates the given XPath expression on the current document and returns a NodeList. |
java.util.List |
getNodesFor(java.lang.String aXPath)
|
java.lang.String |
getPrefix(java.lang.String aNamespace)
|
org.w3c.dom.Node |
getRoot()
|
org.w3c.dom.Node |
getSingleNode(org.w3c.dom.NodeList aNodeList)
Returns a the one and only node from a NodeList. |
org.w3c.dom.Node |
getSingleNode(java.lang.String aXpath)
Returns the one and only node from an Xpath query. |
java.lang.String |
getText(java.lang.String aTargetXPath,
boolean aTrim)
Return the text that is contained at the element located using an XPath |
boolean |
hasNext()
return true if there are more context nodes to move to |
void |
insertAfter(IXDAReadOnly aSource,
java.lang.String aSourceXPath,
java.lang.String aTargetXPath)
Insert fragment of source to this after specified location or locations |
void |
insertBefore(IXDAReadOnly aSource,
java.lang.String aSourceXPath,
java.lang.String aTargetXPath)
Insert fragment of source to this before specified location or locations |
boolean |
isTrue(java.lang.String aTargetXPath)
Evaluate and xpath against the document returning a boolean result |
IXDAIterator |
iterator(java.lang.String aTargetXPath)
Return an iterator over all elements match the xpath in this |
void |
move(java.lang.String aSourceXPath,
java.lang.String aTargetXPath)
Moves a fragment from one location in this to another |
boolean |
next()
move to next context node, returns true if sucessful, false if there are no more nodes |
IXDAReadOnlyIterator |
readOnlyIterator(java.lang.String aTargetXPath)
Return an iterator over all elements that match the an XPath |
void |
removeNS(java.lang.String aTargetXPath,
java.lang.String prefix)
Remove namespace from target location or locations |
void |
rename(java.lang.String aTargetXPath,
java.lang.String name)
Rename elements at target location or locations |
void |
replace(IXDAReadOnly aSource,
java.lang.String aSourceXPath,
java.lang.String aTargetXPath)
Replace fragments of this with fragments from source at specified location or locations |
void |
replaceByText(java.lang.String aTargetXPath,
java.lang.String aText)
Replace fragments of this with given text at specified location or locations |
static org.w3c.dom.Node |
safeDeepClone(org.w3c.dom.Node aNode)
|
void |
serialize(java.io.Writer aWriter,
boolean indent)
Serialize the whole document |
void |
serialize(java.io.Writer aWriter,
java.lang.String aTargetXPath,
boolean indent)
Serialize part of the document |
void |
setDirty()
|
void |
setDirtyNS()
|
void |
setText(java.lang.String aTargetXPath,
java.lang.String aText)
Sets the text of the element or elements at the target location of this |
org.w3c.dom.Document |
toDOM()
|
org.w3c.dom.Document |
toDOMQuick()
|
java.lang.String |
toString()
|
java.lang.String |
toString(boolean aIndent)
Returns a debug representation of the contained document. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String XMLNS_DECLARATION_URI
| Constructor Detail |
|---|
public DOMXDA(org.w3c.dom.Document aDocument,
boolean clone)
public DOMXDA(org.w3c.dom.Document aDocument)
public DOMXDA(org.w3c.dom.Node aRoot,
DOMXDA aParentXDA)
public DOMXDA(org.w3c.dom.Node aRoot,
DOMXDA aParentXDA,
boolean clone)
public DOMXDA(DOMXDA aOther)
| Method Detail |
|---|
public org.w3c.dom.Node getRoot()
public org.w3c.dom.Document getDocument()
public void setDirty()
public void setDirtyNS()
public org.w3c.dom.Node getSingleNode(java.lang.String aXpath)
throws XPathLocationException
aXpath - The Xpath which is expected to have only one node.
NullTargetException - Thrown if the Xpath has zero nodes.
AmbiguousTargetException - Thrown if the Xpath has more than one node.
MalformedTargetException - Thrown if the Xpath is not valid.
AccessViolationException - Thrown when lock is not held on bean.
XPathLocationException
public org.w3c.dom.Node getSingleNode(org.w3c.dom.NodeList aNodeList)
throws XPathLocationException
aNodeList - The NodeList which is expected to have only one node.
NullTargetException - Thrown if the NodeList has zero nodes.
AmbiguousTargetException - Thrown if the node list has more than one node.
XPathLocationException
public org.w3c.dom.NodeList getNodeList(java.lang.String aXPath)
throws XPathLocationException
aXPath - The XPath to evaluate
MalformedTargetException - Thrown if the XPath cannot be parsed.
XPathLocationException
public java.util.List getNodesFor(java.lang.String aXPath)
throws XPathLocationException
XPathLocationException
public org.w3c.dom.Document getFragment(java.lang.String aXPath)
throws XPathLocationException
XPathLocationException
public org.w3c.dom.Document getFragment(org.w3c.dom.Node node)
throws org.w3c.dom.DOMException
org.w3c.dom.DOMExceptionpublic static org.w3c.dom.Node safeDeepClone(org.w3c.dom.Node aNode)
public java.util.Map getMap(java.lang.String aTargetXPath,
boolean aTrim)
throws XPathLocationException
aXPath - An XPath expression which should evaluate to zero or more elements or attributes
within the document.aTrim - If true the resulting string is trimed at beginning and end for whitespace.
AccessViolationException - Thrown when lock is not held on bean.
MalformedTargetException - Thrown if aXPath cannot be parsed.
XPathLocationException
public void append(IXDAReadOnly aSource,
java.lang.String aSourceXPath,
java.lang.String aTargetXPath)
throws XPathLocationException,
XDOIncompatibilityException
IXDA
append in interface IXDAXPathLocationException - throw if the xpath is malformed, xpaths don't result in well defined element
XDOIncompatibilityException - throw if the implementation doesn't support this operation
public void appendPath(java.lang.String aTargetXPath,
java.lang.String aNewRelativeXPath,
java.lang.String aOptionalValue)
throws XPathLocationException
IXDA
appendPath in interface IXDAaNewRelativeXPath - a simple xpath of form a/b/c to name a chain of elements
to append.aOptionalValue - a text value to assign to the leaf node, may be null
XPathLocationException - throw if the xpath is malformed, xpaths don't result in well defined element
public void applyNS(java.lang.String aTargetXPath,
java.lang.String prefix,
java.lang.String uri)
throws XPathLocationException
IXDA
applyNS in interface IXDAprefix - prefix for the namespaceuri - uri for the namespace
XPathLocationException - throw if the xpath is malformed, xpaths don't result in well defined element
public void declareNS(java.lang.String aTargetXPath,
java.lang.String prefix,
java.lang.String uri)
throws XPathLocationException
XPathLocationException
public void delete(java.lang.String aTargetXPath)
throws XPathLocationException
IXDA
delete in interface IXDAXPathLocationException - throw if the xpath is malformed, xpaths don't result in well defined element
public IXPathResult eval(java.lang.String aTargetXPath)
throws XPathLocationException
IXDAReadOnly
eval in interface IXDAReadOnlyXPathLocationException - throw if the xpath is malformed
public java.lang.String getText(java.lang.String aTargetXPath,
boolean aTrim)
throws XPathLocationException
IXDAReadOnly
getText in interface IXDAReadOnlyaTargetXPath - the xpathaTrim - if true trim whitespace from the String
XPathLocationException - throw if the xpath is malformed or
doesn't point to a single unique elementpublic boolean hasNext()
IXDAIterator
hasNext in interface IXDAIteratorhasNext in interface IXDAReadOnlyIterator
public void insertAfter(IXDAReadOnly aSource,
java.lang.String aSourceXPath,
java.lang.String aTargetXPath)
throws XPathLocationException,
XDOIncompatibilityException
IXDA
insertAfter in interface IXDAXPathLocationException - throw if the xpath is malformed, xpaths don't result in well defined element
XDOIncompatibilityException - throw if the implementation doesn't support this operation
public void insertBefore(IXDAReadOnly aSource,
java.lang.String aSourceXPath,
java.lang.String aTargetXPath)
throws XPathLocationException,
XDOIncompatibilityException
IXDA
insertBefore in interface IXDAXPathLocationException - throw if the xpath is malformed, xpaths don't result in well defined element
XDOIncompatibilityException - throw if the implementation doesn't support this operation
public boolean isTrue(java.lang.String aTargetXPath)
throws XPathLocationException
IXDAReadOnly
isTrue in interface IXDAReadOnlyXPathLocationException - throw if the xpath is malformed
public IXDAIterator iterator(java.lang.String aTargetXPath)
throws XPathLocationException
IXDA
iterator in interface IXDAXPathLocationException - throw if the xpath is malformed, xpaths don't result in well defined element
public IXDAReadOnlyIterator readOnlyIterator(java.lang.String aTargetXPath)
throws XPathLocationException
IXDAReadOnly
readOnlyIterator in interface IXDAReadOnlyaTargetXPath - the xpath
XPathLocationException - throw if the xpath is malformed
public void move(java.lang.String aSourceXPath,
java.lang.String aTargetXPath)
throws XPathLocationException
IXDA
move in interface IXDAXPathLocationException - throw if the xpath is malformed, xpaths don't result in well defined elementpublic boolean next()
IXDAIterator
next in interface IXDAIteratornext in interface IXDAReadOnlyIterator
public void removeNS(java.lang.String aTargetXPath,
java.lang.String prefix)
throws XPathLocationException
IXDA
removeNS in interface IXDAprefix - prefix for the namespace
XPathLocationException - throw if the xpath is malformed, xpaths don't result in well defined element
public void rename(java.lang.String aTargetXPath,
java.lang.String name)
throws XPathLocationException
IXDA
rename in interface IXDAname - the new element name
XPathLocationException - throw if the xpath is malformed, xpaths don't result in well defined element
public void replace(IXDAReadOnly aSource,
java.lang.String aSourceXPath,
java.lang.String aTargetXPath)
throws XPathLocationException,
XDOIncompatibilityException
IXDA
replace in interface IXDAXPathLocationException - throw if the xpath is malformed, xpaths don't result in well defined element
XDOIncompatibilityException - throw if the implementation doesn't support this operation
public void replaceByText(java.lang.String aTargetXPath,
java.lang.String aText)
throws XPathLocationException
IXDA
replaceByText in interface IXDAaText - the text to place at locations
XPathLocationException - throw if the xpath is malformed, xpaths don't result in well defined element
public void setText(java.lang.String aTargetXPath,
java.lang.String aText)
throws XPathLocationException
IXDA
setText in interface IXDAXPathLocationException - throw if the xpath is malformed, xpaths don't result in well defined element
public void serialize(java.io.Writer aWriter,
java.lang.String aTargetXPath,
boolean indent)
throws XPathLocationException,
java.io.IOException
IXDAReadOnly
serialize in interface IXDAReadOnlyaWriter - the writer to write the serialized document toaTargetXPath - the xpathindent - true if the document should be re-indented
XPathLocationException - throw if the xpath is malformed or
doesn't point to a single unique element
java.io.IOException - throw if the writer cannot be written to
public void serialize(java.io.Writer aWriter,
boolean indent)
throws java.io.IOException
IXDAReadOnly
serialize in interface IXDAReadOnlyaWriter - the writer to write the serialized document toindent - true if the document should be re-indented
java.io.IOException - throw if the writer cannot be written topublic java.lang.String toString(boolean aIndent)
aIndent - Set to true to cause tidy (human-readable) output of the document.
AccessViolationException - Thrown when the client thread doesn't have a lock.public java.lang.String toString()
toString in class java.lang.Objectpublic org.w3c.dom.Document toDOMQuick()
public org.w3c.dom.Document toDOM()
public java.lang.String getCurrentXPath()
IXDAIterator
getCurrentXPath in interface IXDAIteratorgetCurrentXPath in interface IXDAReadOnlyIteratorpublic java.lang.String getPrefix(java.lang.String aNamespace)
|
NetKernel APIs |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||