|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.jaxup.dom4j.Dom4JDocumentUpdater
XML document creating and updating methods for the DOM4J document object model.
| Constructor Summary | |
Dom4JDocumentUpdater()
|
|
| Method Summary | |
void |
appendChild(Object element,
Object child,
int position)
Inserts a node into the document by appending it to the children of the parent, or if the position parameter isn't -1, by inserting it at that position in the list of children of the parent. |
Object |
createAttribute(Object contextNode,
String uri,
String qname,
String value)
Creates an attribute node. |
Object |
createComment(Object contextNode,
String comment)
Creates a comment node with the given text as the comment. |
Object |
createDocument()
Creates an empty XML document. |
Object |
createElement(Object contextNode,
String uri,
String qname)
Creates an element node. |
Object |
createNamespace(Object contextNode,
String prefix,
String uri)
Creates a namespace node. |
Object |
createProcessingInstruction(Object contextNode,
String target,
String data)
Creates a processing-instruction node of the given target and data. |
Object |
createText(Object contextNode,
String text)
Creates a text node of the given text. |
static Navigator |
getModifiedNavigator()
|
Navigator |
getNavigator()
Returns a jaxen Navigator instance that can be used to navigate the document that is being updated by this Updater. |
void |
insertAfter(Object refNode,
Object node)
Inserts a node into the document after the refNode, as a sibling of the ref Node. |
void |
insertBefore(Object refNode,
Object node)
Inserts a node into the document before the refNode, as a sibling of the ref Node. |
void |
remove(Object node)
Removes a node from the document that it is in. |
void |
setAttribute(Object element,
Object attribute)
Sets an attribute on an element node, replacing an existing attribute with the same name. |
void |
setAttributeValue(Object attribute,
String value)
Changes the value of an existing attribute. |
void |
setNamespace(Object element,
Object namespace)
Binds a namespace node to an element node. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Dom4JDocumentUpdater()
| Method Detail |
public Object createDocument()
throws UpdateException
Updater
createDocument in interface UpdaterUpdateException - A document could not be created.public static Navigator getModifiedNavigator()
public Navigator getNavigator()
Updater
getNavigator in interface UpdaterNavigator
public Object createComment(Object contextNode,
String comment)
throws InvalidContextException
Updater
createComment in interface UpdatercontextNode - A node in the document in which the comment will be
used.comment - The text of the comment to create.
InvalidContextException - The contextNode parameter is not of a
class or interface that the document model recognizes for a node.
public Object createText(Object contextNode,
String text)
throws InvalidContextException
Updater
createText in interface UpdatercontextNode - A node in the document in which the text will be used.
InvalidContextException - The contextNode parameter is not of a
class or interface that the document model recognizes for a node.
public Object createElement(Object contextNode,
String uri,
String qname)
throws InvalidContextException
Updater
createElement in interface UpdatercontextNode - A node in the document in which the element will be
used.uri - The namespace uri of the new element, or nullqname - The qualified name (prefix, semicolon, localname) of the new
element.
InvalidContextException - The contextNode parameter is not of a
class or interface that the document model recognizes for a node.
public Object createNamespace(Object contextNode,
String prefix,
String uri)
throws InvalidContextException
Updater
createNamespace in interface UpdatercontextNode - A node in the document in which the namespace will be
used.prefix - The namespace prefix that will be bound to the namespace
uri.uri - The namespace uri of the new namespace node.
InvalidContextException - The contextNode parameter is not of a
class or interface that the document model recognizes for a node.
public Object createAttribute(Object contextNode,
String uri,
String qname,
String value)
throws InvalidContextException
Updater
createAttribute in interface UpdatercontextNode - A node in the document in which the attribute will be
used.uri - The namespace uri of the new attribute, or null
to indicate that the attribute will not be in a namespace.qname - The qualified name (prefix, semicolon, localname) of the new
attribute.value - The value of the new attribute.
InvalidContextException - The contextNode parameter is not of a
class or interface that the document model recognizes for a node.
public Object createProcessingInstruction(Object contextNode,
String target,
String data)
throws InvalidContextException
Updater
createProcessingInstruction in interface UpdatercontextNode - A node in the document in which the text will be used.target - The target for the processing instruction to create.data - The data for the processing instruction to create. The format
of the data depends on the syntax defined by the target; many targets
define a syntax simular to the attribute list of an element node.
InvalidContextException - The contextNode parameter is not of a
class or interface that the document model recognizes for a node.
public void insertBefore(Object refNode,
Object node)
throws UpdateException
Updater
insertBefore in interface UpdaterrefNode - The reference node, before which the new node will be
inserted as a sibling.node - The node that will be inserted.
UpdateException - Another exception occurred during update.
public void insertAfter(Object refNode,
Object node)
throws UpdateException
Updater
insertAfter in interface UpdaterrefNode - The reference node, after which the new node will be
inserted as a sibling.node - The node that will be inserted.
UpdateException - Another exception occurred during update.
public void appendChild(Object element,
Object child,
int position)
throws UpdateException
Updater
appendChild in interface Updaterelement - The parent node, which must be either a document
or element node.child - The node that will be appended / inserted.position - The position in the child list where the child node will
be inserted, or -1 to append the new child to the list of children.
UpdateException - Another exception occurred during update.
public void remove(Object node)
throws UpdateException
Updater
remove in interface Updaternode - The node to remove.
UpdateException - Another exception occurred during update.
public void setAttribute(Object element,
Object attribute)
throws UpdateException
Updater
setAttribute in interface Updaterelement - The element node to set the attribute on.attribute - The attribute node to set on the element.
UpdateException - Another exception occurred during update.
public void setNamespace(Object element,
Object namespace)
throws UpdateException
Updater
setNamespace in interface Updaterelement - The element node to bind the namespace node to.namespace - The namespace node to bind to the element node.
UpdateException - Another exception occurred during update.
public void setAttributeValue(Object attribute,
String value)
throws UpdateException
Updater
setAttributeValue in interface UpdaterUpdateException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||