--- old/src/java.xml/share/classes/javax/xml/stream/XMLStreamReader.java 2015-04-21 18:33:58.064094842 +0400
+++ new/src/java.xml/share/classes/javax/xml/stream/XMLStreamReader.java 2015-04-21 18:33:57.976094842 +0400
@@ -57,9 +57,9 @@
* javax.xml.stream.notations and javax.xml.stream.entities.
* When the current event is a DTD the following call will return a
* list of Notations
- * List l = (List) getProperty("javax.xml.stream.notations");
+ * {@code List l = (List) getProperty("javax.xml.stream.notations");}
* The following call will return a list of entity declarations:
- * List l = (List) getProperty("javax.xml.stream.entities");
+ * {@code List l = (List) getProperty("javax.xml.stream.entities");}
* These properties can only be accessed during a DTD event and
* are defined to return null if the information is not available.
*
@@ -97,12 +97,13 @@
* getElementText(), nextTag()
*
*
+ *
Given the following XML: NOTE: empty element (such as <tag/>) will be reported
+ * NOTE: empty element (such as {@code
- * <foo><!--description-->content text<![CDATA[<greeting>Hello</greeting>]]>other content</foo>
+ * {@code
* The behavior of calling next() when being on foo will be:
* 1- the comment (COMMENT)
* 2- then the characters section (CHARACTERS)
@@ -192,14 +193,14 @@
* 4- then the next characters section (another CHARACTERS)
* 5- then the END_ELEMENT
*
- *
Precondition: the current event is START_ELEMENT.
- *
Postcondition: the current event is the corresponding END_ELEMENT.
+ *
Precondition: the current event is START_ELEMENT.
+ *
Postcondition: the current event is the corresponding END_ELEMENT.
*
- *
The method does the following (implementations are free to optimized
+ *
The method does the following (implementations are free to optimized
* but must do equivalent processing):
*
* if(getEventType() != XMLStreamConstants.START_ELEMENT) {
- * throw new XMLStreamException(
- * "parser must be on START_ELEMENT to read next text", getLocation());
+ * throw new XMLStreamException(
+ * "parser must be on START_ELEMENT to read next text", getLocation());
* }
+ *
* int eventType = next();
* StringBuffer content = new StringBuffer();
- * while(eventType != XMLStreamConstants.END_ELEMENT ) {
- * if(eventType == XMLStreamConstants.CHARACTERS
- * || eventType == XMLStreamConstants.CDATA
- * || eventType == XMLStreamConstants.SPACE
- * || eventType == XMLStreamConstants.ENTITY_REFERENCE) {
- * buf.append(getText());
- * } else if(eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
- * || eventType == XMLStreamConstants.COMMENT) {
- * // skipping
- * } else if(eventType == XMLStreamConstants.END_DOCUMENT) {
- * throw new XMLStreamException(
- * "unexpected end of document when reading element text content", this);
- * } else if(eventType == XMLStreamConstants.START_ELEMENT) {
- * throw new XMLStreamException(
- * "element text content may not contain START_ELEMENT", getLocation());
- * } else {
- * throw new XMLStreamException(
- * "Unexpected event type "+eventType, getLocation());
- * }
- * eventType = next();
+ * while(eventType != XMLStreamConstants.END_ELEMENT) {
+ * if(eventType == XMLStreamConstants.CHARACTERS
+ * || eventType == XMLStreamConstants.CDATA
+ * || eventType == XMLStreamConstants.SPACE
+ * || eventType == XMLStreamConstants.ENTITY_REFERENCE) {
+ * buf.append(getText());
+ * } else if(eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
+ * || eventType == XMLStreamConstants.COMMENT) {
+ * // skipping
+ * } else if(eventType == XMLStreamConstants.END_DOCUMENT) {
+ * throw new XMLStreamException(
+ * "unexpected end of document when reading element text content", this);
+ * } else if(eventType == XMLStreamConstants.START_ELEMENT) {
+ * throw new XMLStreamException(
+ * "element text content may not contain START_ELEMENT", getLocation());
+ * } else {
+ * throw new XMLStreamException(
+ * "Unexpected event type "+eventType, getLocation());
+ * }
+ * eventType = next();
* }
* return buf.toString();
*
@@ -268,33 +270,33 @@
* are encountered, an exception is thrown. This method should
* be used when processing element-only content seperated by white space.
*
- *
Precondition: none
- *
Postcondition: the current event is START_ELEMENT or END_ELEMENT
+ *
Precondition: none
+ *
Postcondition: the current event is START_ELEMENT or END_ELEMENT
* and cursor may have moved over any whitespace event.
*
- *
Essentially it does the following (implementations are free to optimized
+ *
Essentially it does the following (implementations are free to optimized
* but must do equivalent processing):
- *
+ *
* XMLStreamException may be thrown if there are any XML errors in the underlying source.
* The "targetStart" argument must be greater than or equal to 0 and less than the length of "target",
* Length must be greater than 0 and "targetStart + length" must be less than or equal to length of "target".
@@ -564,8 +566,8 @@
* @param length the number of characters to copy
* @return the number of characters actually copied
* @throws XMLStreamException if the underlying XML source is not well-formed
- * @throws IndexOutOfBoundsException if targetStart < 0 or > than the length of target
- * @throws IndexOutOfBoundsException if length < 0 or targetStart + length > length of target
+ * @throws IndexOutOfBoundsException if targetStart {@literal <} 0 or {@literal >} than the length of target
+ * @throws IndexOutOfBoundsException if length {@literal <} 0 or targetStart + length {@literal >} length of target
* @throws UnsupportedOperationException if this method is not supported
* @throws NullPointerException is if target is null
*/
{@code
* int eventType = next();
- * while((eventType == XMLStreamConstants.CHARACTERS && isWhiteSpace()) // skip whitespace
- * || (eventType == XMLStreamConstants.CDATA && isWhiteSpace())
+ * while((eventType == XMLStreamConstants.CHARACTERS && isWhiteSpace()) // skip whitespace
+ * || (eventType == XMLStreamConstants.CDATA && isWhiteSpace())
* // skip whitespace
* || eventType == XMLStreamConstants.SPACE
* || eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
* || eventType == XMLStreamConstants.COMMENT
* ) {
- * eventType = next();
+ * eventType = next();
* }
- * if (eventType != XMLStreamConstants.START_ELEMENT && eventType != XMLStreamConstants.END_ELEMENT) {
- * throw new String XMLStreamException("expected start or end tag", getLocation());
+ * if (eventType != XMLStreamConstants.START_ELEMENT && eventType != XMLStreamConstants.END_ELEMENT) {
+ * throw new String XMLStreamException("expected start or end tag", getLocation());
* }
- * return eventType;
+ * return eventType; }
*
*
* @return the event type of the element read (START_ELEMENT or END_ELEMENT)
* @throws XMLStreamException if the current event is not white space, PROCESSING_INSTRUCTION,
* START_ELEMENT or END_ELEMENT
- * @throws NoSuchElementException if this is called when hasNext() returns false
+ * @throws java.util.NoSuchElementException if this is called when hasNext() returns false
*/
public int nextTag() throws XMLStreamException;
@@ -309,7 +311,7 @@
public boolean hasNext() throws XMLStreamException;
/**
- * Frees any resources associated with this Reader. This method does not close the
+ * Frees any resources associated with this Reader. This method does not close the
* underlying input source.
* @throws XMLStreamException if there are errors freeing associated resources
*/
@@ -542,7 +544,7 @@
* If the number of characters actually copied is less than the "length", then there is no more text.
* Otherwise, subsequent calls need to be made until all text has been retrieved. For example:
*
- *
+ *
+ * } {@code
* int length = 1024;
* char[] myBuffer = new char[ length ];
*
@@ -553,7 +555,7 @@
* if (nCopied < length)
* break;
* }
- *