|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents a position between two logical tokens in an XML document.
The tokens themselves are not exposed as objects, but their type and properties
are discoverable through methods on the cursor. In particular, the general
category of token is represented by a TokenType
.
You use an XmlCursor instance to navigate through and manipulate an XML
instance document.
Once you obtain an XML document, you can create a cursor to represent
a specific place in the XML. Because you can use a cursor with or
without a schema corresponding to the XML, cursors are an ideal
way to handle XML without a schema. You can create a new cursor by
calling the newCursor
method
exposed by an object representing
the XML, whether it was parsed into a strong type compiled from
schema or an XmlObject
(as in the no-schema case).
With an XmlCursor, you can also:
TokenType
class. <sample x='y'> <value>foo</value> </sample>STARTDOC
currentTokenType()
method
will return the type of the token that is immediately after the cursor.
You can also use a number of convenience methods that test for a particular
token type. These include the methods isStart(),
isStartdoc(), isText(), isAttr(), and so on. Each returns a boolean
value indicating whether the token that follows the cursor is the type
in question.
<doc> ::= STARTDOC <attributes> <content> ENDDOC <element> ::= START <attributes> <content> END <attributes> ::= ( ATTR | NAMESPACE ) * <content> ::= ( COMMENT | PROCINST | TEXT | <element> ) *Note that a legitimate sequence is STARTDOC ENDDOC, the result of creating a brand new instance of an empty document. Also note that attributes may only follow container tokens (STARTDOC or START)
Nested Class Summary | |
static interface |
XmlCursor.ChangeStamp
Represents the state of a dcoument at a particular point in time. |
static class |
XmlCursor.TokenType
An enumeration that identifies the type of an XML token. |
static class |
XmlCursor.XmlBookmark
Subclasses of XmlBookmark can be used to annotate an XML document. |
static interface |
XmlCursor.XmlMark
An abstract XmlCursor factory. |
Method Summary | |
void |
addToSelection()
Appends the current location of the cursor to the selection. |
void |
beginElement(QName name)
Inserts a new element around this cursor, giving the element the specified qualified name. |
void |
beginElement(String localName)
Inserts a new element around this cursor, giving the element the specified local name. |
void |
beginElement(String localName,
String uri)
Inserts a new element around this cursor, giving the element the specified local name and associating it with the specified namespace. |
void |
clearBookmark(Object key)
Clears the bookmark whose key is specified, if the bookmark exists at this cursor's location. |
void |
clearSelections()
Clears this cursor's selection, but does not modify the document. |
int |
comparePosition(XmlCursor cursor)
Returns an integer indicating whether this cursor is before, after, or at the same position as the specified cursor. |
int |
copyChars(int maxCharacterCount,
XmlCursor toHere)
Copies characters to the position immediately after the specified cursor. |
boolean |
copyXml(XmlCursor toHere)
Copies the XML immediately after this cursor to the location specified by the toHere cursor. |
boolean |
copyXmlContents(XmlCursor toHere)
Copies the contents of the container (STARTDOC OR START) immediately to the right of the cursor to the location specified by the toHere cursor. |
XmlCursor.TokenType |
currentTokenType()
Returns the type of the current token. |
void |
dispose()
Deallocates resources needed to manage the cursor, rendering this cursor inoperable. |
XmlCursor |
execQuery(String query)
Executes the specified XQuery expression against the XML this cursor is in. |
XmlCursor |
execQuery(String query,
XmlOptions options)
Executes the specified XQuery expression against the XML this cursor is in, and using the specified options. |
void |
getAllBookmarkRefs(Collection listToFill)
Retrieves all the bookmarks at this location, adding them to the specified collection. |
void |
getAllNamespaces(Map addToThis)
Adds to the specified map, all the namespaces in scope at the container where this cursor is positioned. |
String |
getAttributeText(QName attrName)
When at a START or STARTDOC, returns the attribute text for the given attribute. |
XmlCursor.XmlBookmark |
getBookmark(Object key)
Retrieves the bookmark with the specified key at this cursor's location. |
String |
getChars()
Returns characters to the right of the cursor up to the next token. |
int |
getChars(char[] returnedChars,
int offset,
int maxCharacterCount)
Copies characters up to the specified maximum number, counting right from this cursor's location to the character at maxCharacterCount. |
XmlCursor.ChangeStamp |
getDocChangeStamp()
Returns the current change stamp for the document the current cursor is in. |
QName |
getName()
Returns the name of the current token. |
XmlObject |
getObject()
Returns the strongly-typed XmlObject at the current START, STARTDOC, or ATTR. |
int |
getSelectionCount()
Returns the count of the current selection. |
String |
getTextValue()
Gets the text value of the current document, element, attribute, comment, procinst or text token. |
int |
getTextValue(char[] returnedChars,
int offset,
int maxCharacterCount)
Copies the text value of the current document, element, attribute, comment, processing instruction or text token, counting right from this cursor's location up to maxCharacterCount, and copies the returned text into returnedChars. |
boolean |
hasNextSelection()
Returns whether or not there is a next selection. |
boolean |
hasNextToken()
True if there is a next token. |
boolean |
hasPrevToken()
True if there is a previous token. |
void |
insertAttribute(QName name)
Inserts a new attribute immediately before this cursor's location, giving it the specified name. |
void |
insertAttribute(String localName)
Inserts a new attribute immediately before this cursor's location, giving it the specified local name. |
void |
insertAttribute(String localName,
String uri)
Inserts a new attribute immediately before this cursor's location, giving it the specified local name and associating it with the specified namespace. |
void |
insertAttributeWithValue(QName name,
String value)
Inserts an attribute immediately before the cursor's location, giving it the specified name and value. |
void |
insertAttributeWithValue(String Name,
String value)
Inserts a new attribute immediately before this cursor's location, giving it the specified value and name. |
void |
insertAttributeWithValue(String name,
String uri,
String value)
Inserts an attribute immediately before the cursor's location, giving it the specified name and value, and associating it with the specified namespace. |
void |
insertChars(String text)
Inserts the specified text immediately before this cursor's location. |
void |
insertComment(String text)
Inserts an XML comment immediately before the cursor's location, giving it the specified content. |
void |
insertElement(QName name)
Inserts an element immediately before this cursor's location, giving the element the specified qualified name. |
void |
insertElement(String localName)
Inserts an element immediately before this cursor's location, giving the element the specified local name. |
void |
insertElement(String localName,
String uri)
Inserts a new element immediately before this cursor's location, giving the element the specified local name and associating it with specified namespace |
void |
insertElementWithText(QName name,
String text)
Inserts a new element immediately before this cursor's location, giving the element the specified qualified name and content. |
void |
insertElementWithText(String localName,
String text)
Inserts a new element immediately before this cursor's location, giving the element the specified local name and content. |
void |
insertElementWithText(String localName,
String uri,
String text)
Inserts a new element immediately before this cursor's location, giving the element the specified local name, associating it with the specified namespace, and giving it the specified content. |
void |
insertNamespace(String prefix,
String namespace)
Inserts a namespace declaration immediately before the cursor's location, giving it the specified prefix and URI. |
void |
insertProcInst(String target,
String text)
Inserts an XML processing instruction immediately before the cursor's location, giving it the specified target and text. |
boolean |
isAnyAttr()
True if this token is any attribute. |
boolean |
isAtSamePositionAs(XmlCursor cursor)
Determines if this cursor is at the same position as the specified cursor. |
boolean |
isAttr()
True if this token is an ATTR token type, meaning just before an attribute. |
boolean |
isComment()
True if this token is a COMMENT token type, meaning just before a comment. |
boolean |
isContainer()
True if this token is a container token. |
boolean |
isEnd()
True if this token is an END token type, meaning just before an element's end. |
boolean |
isEnddoc()
True if this token is an ENDDOC token type, meaning at the very end of the document. |
boolean |
isFinish()
True if this token is a finish token. |
boolean |
isInSameDocument(XmlCursor cursor)
Determines if the specified cursor is in the same document as this cursor. |
boolean |
isLeftOf(XmlCursor cursor)
Determines if this cursor is to the left of (or before) the specified cursor. |
boolean |
isNamespace()
True if this token is a NAMESPACE token type, meaning just before a namespace declaration. |
boolean |
isProcinst()
True if this token is a PROCINST token type, meaning just before a processing instruction. |
boolean |
isRightOf(XmlCursor cursor)
Determines if this cursor is to the right of (or after) the specified cursor. |
boolean |
isStart()
True if this token is a START token type, meaning just before an element's start. |
boolean |
isStartdoc()
True if the current token is a STARTDOC token type, meaning at the very root of the document. |
boolean |
isText()
True if the this token is a TEXT token type, meaning just before or inside text. |
int |
moveChars(int maxCharacterCount,
XmlCursor toHere)
Moves characters immediately after this cursor to the position immediately after the specified cursor. |
boolean |
moveXml(XmlCursor toHere)
Moves the XML immediately after this cursor to the location specified by the toHere cursor, shifting XML at that location to the right to make room. |
boolean |
moveXmlContents(XmlCursor toHere)
Moves the contents of the container (STARTDOC OR START) immediately after this cursor to the location specified by the toHere cursor. |
String |
namespaceForPrefix(String prefix)
Returns the namespace URI indicated by the given prefix. |
boolean |
pop()
Restores the cursor location most recently saved with the push() method. |
String |
prefixForNamespace(String namespaceURI)
Returns a prefix that can be used to indicate a namespace URI. |
XmlCursor.TokenType |
prevTokenType()
Returns the type of the previous token. |
void |
push()
Saves the current location of this cursor on an internal stack of saved positions (independent of selection). |
boolean |
removeAttribute(QName attrName)
When at a START or STARTDOC, removes the attribute with the given name. |
int |
removeChars(int maxCharacterCount)
Removes characters up to the specified maximum number, counting right from this cursor's location to the character at maxCharacterCount. |
boolean |
removeXml()
Removes the XML that is immediately after this cursor. |
boolean |
removeXmlContents()
Removes the contents of the container (STARTDOC OR START) immediately after this cursor. |
void |
selectPath(String path)
Executes the specified XPath expression against the XML that this cursor is in. |
void |
selectPath(String path,
XmlOptions options)
Executes the specified XPath expression against the XML that this cursor is in. |
boolean |
setAttributeText(QName attrName,
String value)
When at a START or STARTDOC, sets the attribute text for the given attribute. |
void |
setBookmark(XmlCursor.XmlBookmark bookmark)
Sets a bookmark to the document at this cursor's location. |
void |
setName(QName name)
Sets the name of the current token. |
void |
setTextValue(char[] sourceChars,
int offset,
int length)
Sets the text value of the XML at this cursor's location (if that XML's token type is START, STARTDOC, ATTR, COMMENT or PROCINST) to the contents of the specified character array. |
void |
setTextValue(String text)
Sets the text value of the XML at this cursor's location if that XML's token type is START, STARTDOC, ATTR, COMMENT or PROCINST. |
boolean |
toBookmark(XmlCursor.XmlBookmark bookmark)
Moves this cursor to the same position as the bookmark. |
boolean |
toChild(int index)
Moves the cursor to the child element specified by index. |
boolean |
toChild(QName name)
Moves the cursor to the first child element of the specified qualified name. |
boolean |
toChild(QName name,
int index)
Moves the cursor to the specified index child element of the specified name, where that element is the . |
boolean |
toChild(String name)
Moves the cursor to the first child element of the specified name in no namespace. |
boolean |
toChild(String namespace,
String name)
Moves the cursor to the first child element of the specified name in the specified namespace. |
boolean |
toCursor(XmlCursor moveTo)
Moves this cursor to the same position as the moveTo cursor. |
void |
toEndDoc()
Moves the cursor to the ENDDOC token, which is the end of the document. |
XmlCursor.TokenType |
toEndToken()
Moves the cursor to the END or ENDDOC token corresponding to the current START or STARTDOC, and returns END or ENDDOC. |
boolean |
toFirstAttribute()
Moves the cursor to the first attribute of this element, or returns false and does not move the cursor if there are no attributes. |
boolean |
toFirstChild()
Moves the cursor to the first child element, or returns false and does not move the cursor if there are no element children. |
XmlCursor.TokenType |
toFirstContentToken()
Moves the cursor to the first token in the content of the current START or STARTDOC. |
boolean |
toLastAttribute()
Moves the cursor to the last attribute of this element, or returns false and does not move the cursor if there are no attributes. |
boolean |
toLastChild()
Moves the cursor to the last element child, or returns false and does not move the cursor if there are no element children. |
boolean |
toNextAttribute()
Moves the cursor to the next sibling attribute, or returns false and does not move the cursor if there is no next sibling attribute. |
XmlCursor.XmlBookmark |
toNextBookmark(Object key)
Moves this cursor to the location after its current position where a bookmark with the given key exists. |
int |
toNextChar(int maxCharacterCount)
Moves the cursor forward by the specified number of characters, and stops at the next non-TEXT token. |
boolean |
toNextSelection()
Moves this cursor to the next location in the selection, if any. |
boolean |
toNextSibling()
Moves the cursor to the next sibling element, or returns false and does not move the cursor if there is no next sibling element. |
boolean |
toNextSibling(QName name)
Moves the cursor to the next sibling element of the specified qualified name. |
boolean |
toNextSibling(String name)
Moves the cursor to the next sibling element of the specified name in no namespace. |
boolean |
toNextSibling(String namespace,
String name)
Moves the cursor to the next sibling element of the specified name in the specified namespace. |
XmlCursor.TokenType |
toNextToken()
Moves the cursor to the next token. |
boolean |
toParent()
Moves the cursor to the parent element or STARTDOC, or returns false and does not move the cursor if there is no parent. Works if you're in attributes or content. |
boolean |
toPrevAttribute()
Moves the cursor to the previous sibling attribute, or returns false and does not move the cursor if there is no previous sibling attribute. |
XmlCursor.XmlBookmark |
toPrevBookmark(Object key)
Moves this cursor to the location before its current position where a bookmark with the given key exists. |
int |
toPrevChar(int maxCharacterCount)
Moves the cursor backwards by the number of characters given. |
boolean |
toPrevSibling()
Moves the cursor to the previous sibling element, or returns false and does not move the cursor if there is no previous sibling element. |
XmlCursor.TokenType |
toPrevToken()
Moves the cursor to the previous token. |
boolean |
toSelection(int i)
Moves this cursor to the specified location in the selection. |
void |
toStartDoc()
Moves the cursor to the STARTDOC token, which is the root of the document. |
Methods inherited from interface org.apache.xmlbeans.XmlTokenSource |
documentProperties, dump, getDomNode, monitor, newCursor, newDomNode, newDomNode, newInputStream, newInputStream, newReader, newReader, newXMLInputStream, newXMLInputStream, newXMLStreamReader, newXMLStreamReader, save, save, save, save, save, save, save, save, xmlText, xmlText |
Method Detail |
public void dispose()
public boolean toCursor(XmlCursor moveTo)
moveTo
- The cursor at the location to which this cursor
should be moved.
public void push()
public boolean pop()
public void selectPath(String path)
hasNextSelection()
and toNextSelection()
(similar to
Iterator
).cursor.selectPath("./purchase-order/line-item");Note that this method does not support top-level XPath functions.
path
- The path expression to execute.
XmlRuntimeException
- If the query expression is invalid.public void selectPath(String path, XmlOptions options)
cursor.selectPath("./purchase-order/line-item");Note that this method does not support top-level XPath functions.
path
- The path expression to execute.options
- Options for the query. For example, you can call
the XmlOptions.setXqueryCurrentNodeVar(String)
method to specify a particular name for the query expression
variable that indicates the context node.
XmlRuntimeException
- If the query expression is invalid.public boolean hasNextSelection()
public boolean toNextSelection()
selectPath(java.lang.String)
and addToSelection()
methods.
public boolean toSelection(int i)
i
- The index of the desired location.
public int getSelectionCount()
public void addToSelection()
public void clearSelections()
public boolean toBookmark(XmlCursor.XmlBookmark bookmark)
bookmark
- The bookmark at the location to which this
cursor should be moved.
public XmlCursor.XmlBookmark toNextBookmark(Object key)
key
- The key held by the next bookmark at the location to
which this cursor should be moved.
public XmlCursor.XmlBookmark toPrevBookmark(Object key)
key
- The key held by the previous bookmark at the location to
which this cursor should be moved.
public QName getName()
In the following example, xmlObject
represents
an XML instance whose root element is not preceded by any other XML.
This code prints the root element name (here, the local name, or
name without URI).
XmlCursor cursor = xmlObject.newCursor(); cursor.toFirstContentToken(); String elementName = cursor.getName().getLocalPart(); System.out.println(elementName);
public void setName(QName name)
name
- The new name for the current token.public String namespaceForPrefix(String prefix)
prefix
- The namespace prefix for the requested namespace.
public String prefixForNamespace(String namespaceURI)
namespaceURI
- The namespace URI corresponding to the requested
prefix.
public void getAllNamespaces(Map addToThis)
addToThis
- The Map to add the namespaces to.public XmlObject getObject()
public XmlCursor.TokenType currentTokenType()
public boolean isStartdoc()
public boolean isEnddoc()
public boolean isStart()
public boolean isEnd()
public boolean isText()
public boolean isAttr()
public boolean isNamespace()
public boolean isComment()
public boolean isProcinst()
public boolean isContainer()
public boolean isFinish()
public boolean isAnyAttr()
public XmlCursor.TokenType prevTokenType()
public boolean hasNextToken()
public boolean hasPrevToken()
public XmlCursor.TokenType toNextToken()
public XmlCursor.TokenType toPrevToken()
public XmlCursor.TokenType toFirstContentToken()
public XmlCursor.TokenType toEndToken()
public int toNextChar(int maxCharacterCount)
maxCharacterCount
- The maximum number of characters by which
the cursor should be moved.
public int toPrevChar(int maxCharacterCount)
toNextChar
method.
maxCharacterCount
- The maximum number of characters by which
the cursor should be moved.
public boolean toNextSibling()
public boolean toPrevSibling()
public boolean toParent()
public boolean toFirstChild()
public boolean toLastChild()
public boolean toChild(String name)
name
- The name of the element to move the cursor to.
public boolean toChild(String namespace, String name)
namespace
- The namespace URI for the element to move the cursor
to.name
- The name of the element to move to.
IllegalArgumentException
- If the name is not a valid local name.public boolean toChild(QName name)
name
- The name of the element to move the cursor to.public boolean toChild(int index)
index
- The position of the element in the sequence of child
elements.
public boolean toChild(QName name, int index)
name
- The name of the child element to move the cursor to.index
- The position of the element in the sequence of child
elements.
public boolean toNextSibling(String name)
name
- The name of the element to move the cursor to.
public boolean toNextSibling(String namespace, String name)
namespace
- The namespace URI for the element to move the cursor
to.name
- The name of the element to move the cursor to.
public boolean toNextSibling(QName name)
name
- The name of the element to move the cursor to.
public boolean toFirstAttribute()
public boolean toLastAttribute()
public boolean toNextAttribute()
public boolean toPrevAttribute()
public String getAttributeText(QName attrName)
attrName
- The name of the attribute whose value is requested.
public boolean setAttributeText(QName attrName, String value)
attrName
- The name of the attribute whose value is being set.value
- The new value for the attribute.
public boolean removeAttribute(QName attrName)
attrName
- The name of the attribute that should be removed.
public String getTextValue()
IllegalStateException
.
public int getTextValue(char[] returnedChars, int offset, int maxCharacterCount)
IllegalStateException
.
returnedChars
- A character array to hold the returned characters.offset
- The position within returnedChars to which the first of the
returned characters should be copied.maxCharacterCount
- The maximum number of characters after this cursor's
location to copy. A negative value specifies that all characters should be copied.
public void setTextValue(String text)
text
- The text to use as a new value.
IllegalStateException
- If the token type at this
cursor's location is not START, STARTDOC, ATTR, COMMENT or
PROCINST.public void setTextValue(char[] sourceChars, int offset, int length)
sourceChars
- A character array containing the XML's new value.offset
- The position within sourceChars from which the first of
the source characters should be copied.length
- The maximum number of characters to set as the XML's new
value.
IllegalArgumentException
- If the token type at this
cursor's location is not START, STARTDOC, ATTR, COMMENT or
PROCINST.public String getChars()
public int getChars(char[] returnedChars, int offset, int maxCharacterCount)
returnedChars
- A character array to hold the returned characters.offset
- The position within returnedChars at which the first of the
returned characters should be added.maxCharacterCount
- The maximum number of characters after this cursor's
location to return.
public void toStartDoc()
public void toEndDoc()
public boolean isInSameDocument(XmlCursor cursor)
cursor
- The cursor that may be in the same document
as this cursor.
public int comparePosition(XmlCursor cursor)
a.comparePosition(b) < 0
means a is to the left of b.a.comparePosition(b) == 0
means a is at the same position as b.a.comparePosition(b) > 0
means a is to the right of b.
cursor
- The cursor whose position should be compared
with this cursor.
IllegalArgumentException
- If the specified
cursor is not in the same document as this cursor.public boolean isLeftOf(XmlCursor cursor)
a.comparePosition(b) < 0
cursor
- The cursor whose position should be compared
with this cursor.
public boolean isAtSamePositionAs(XmlCursor cursor)
a.comparePosition(b) == 0
cursor
- The cursor whose position should be compared
with this cursor.
public boolean isRightOf(XmlCursor cursor)
a.comparePosition(b) > 0
cursor
- The cursor whose position should be compared
with this cursor.
public XmlCursor execQuery(String query)
XmlCursor results = cursor.execQuery("purchase-order/line-item[price <= 20.00]");
query
- The XQuery expression to execute.
XmlRuntimeException
- If the query expression is invalid.public XmlCursor execQuery(String query, XmlOptions options)
query
- The XQuery expression to execute.options
- Options for the query. For example, you can call
the XmlOptions.setXqueryCurrentNodeVar(String)
method to specify a particular name for the query expression
variable that indicates the context node.
XmlRuntimeException
- If the query expression is invalid.public XmlCursor.ChangeStamp getDocChangeStamp()
public void setBookmark(XmlCursor.XmlBookmark bookmark)
bookmark
- The bookmark to set.public XmlCursor.XmlBookmark getBookmark(Object key)
getKey
method is not overridden on
the bookmark, then the bookmark's class is used as the key.
key
- The key for the bookmark to retrieve.
public void clearBookmark(Object key)
key
- The for the bookmark to clear.public void getAllBookmarkRefs(Collection listToFill)
listToFill
- The collection that will contain bookmarks
returned by this method.public boolean removeXml()
IllegalArgumentException
- If the cursor is at a
STARTDOC token.public boolean moveXml(XmlCursor toHere)
toHere
- The cursor at the location to which the XML should
be moved.
IllegalArgumentException
- If the operation is not allowed
at the cursor's location. This includes attempting to move an end token or the
document as a whole. Also, moving to a location before the start document or moving
an attribute to a location other than after another attribute or start token
will throw.public boolean copyXml(XmlCursor toHere)
toHere
- The cursor at the location to which the XML should
be copied.
IllegalArgumentException
- If the operation is not allowed
at the cursor's location.public boolean removeXmlContents()
public boolean moveXmlContents(XmlCursor toHere)
toHere
- The cursor at the location to which the XML should be moved.
public boolean copyXmlContents(XmlCursor toHere)
toHere
- The cursor at the location to which the XML should
be copied.
public int removeChars(int maxCharacterCount)
maxCharacterCount
- The maximum number of characters after this cursor's
location to remove.
IllegalArgumentException
- If the operation is not allowed
at the cursor's location.public int moveChars(int maxCharacterCount, XmlCursor toHere)
maxCharacterCount
- The maximum number of characters after this cursor's
location to move.toHere
- The cursor to which the characters should be moved.
IllegalArgumentException
- If the operation is not allowed
at the cursor's location.public int copyChars(int maxCharacterCount, XmlCursor toHere)
maxCharacterCount
- The maximum number of characters after this cursor's
location to copy.toHere
- The cursor to which the characters should be copied.
IllegalArgumentException
- If the operation is not allowed
at the cursor's location.public void insertChars(String text)
text
- The text to insert.
IllegalArgumentException
- If the insertion is not allowed
at the cursor's location.public void insertElement(QName name)
name
- The qualified name for the element.
IllegalArgumentException
- If the insertion is not allowed
at the cursor's location.public void insertElement(String localName)
localName
- The local name for the new element.
IllegalArgumentException
- If the insertion is not allowed
at the cursor's location.public void insertElement(String localName, String uri)
localName
- The local name for the new element.uri
- The URI for the new element's namespace.
IllegalArgumentException
- If the insertion is not allowed
at the cursor's location.public void beginElement(QName name)
name
- The qualified name for the new element.
IllegalArgumentException
- If the insertion is not allowed
at the cursor's location.public void beginElement(String localName)
localName
- The local name for the new element.
IllegalArgumentException
- If the insertion is not allowed
at the cursor's location.public void beginElement(String localName, String uri)
localName
- The local name for the new element.uri
- The URI for the new element's namespace.
IllegalArgumentException
- If the insertion is not allowed
at the cursor's location.public void insertElementWithText(QName name, String text)
name
- The qualified name for the new element.text
- The content for the new element.
IllegalArgumentException
- If the insertion is not allowed
at the cursor's location.public void insertElementWithText(String localName, String text)
localName
- The local name for the new element.text
- The content for the new element.
IllegalArgumentException
- If the insertion is not allowed
at the cursor's location.public void insertElementWithText(String localName, String uri, String text)
localName
- The local name for the new element.uri
- The URI for the new element's namespace.text
- The content for the new element.
IllegalArgumentException
- If the insertion is not allowed
at the cursor's location.public void insertAttribute(String localName)
localName
- The local name for the new attribute.
IllegalArgumentException
- If the insertion is not allowed
at the cursor's location.public void insertAttribute(String localName, String uri)
localName
- The local name for the new attribute.uri
- The URI for the new attribute's namespace.
IllegalArgumentException
- If the insertion is not allowed
at the cursor's location.public void insertAttribute(QName name)
name
- The local name for the new attribute.
IllegalArgumentException
- If the insertion is not allowed
at the cursor's location.public void insertAttributeWithValue(String Name, String value)
Name
- The local name for the new attribute.value
- The value for the new attribute.
IllegalArgumentException
- If the insertion is not allowed
at the cursor's location.public void insertAttributeWithValue(String name, String uri, String value)
name
- The name for the new attribute.uri
- The URI for the new attribute's namespace.value
- The value for the new attribute.
IllegalArgumentException
- If the insertion is not allowed
at the cursor's location.public void insertAttributeWithValue(QName name, String value)
name
- The name for the new attribute.value
- The value for the new attribute.
IllegalArgumentException
- If the insertion is not allowed
at the cursor's location.public void insertNamespace(String prefix, String namespace)
prefix
- The prefix for the namespace.namespace
- The URI for the namespace.
IllegalArgumentException
- If the insertion is not allowed
at the cursor's location.public void insertComment(String text)
text
- The new comment's content.
IllegalArgumentException
- If the insertion is not allowed
at the cursor's location.public void insertProcInst(String target, String text)
target
- The target for the processing instruction.text
- The new processing instruction's text.
IllegalStateException
- If the insertion is not allowed
at the cursor's location.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |