Skip to content
Browse files

Fix usage of XMLStreamConstants, and some javadoc typos

  • Loading branch information...
1 parent b3d4831 commit 7c4f97ae29f1786d009002338c49671904685312 @rolfl rolfl committed Mar 16, 2012
View
8 core/src/java/org/jdom2/input/StAXEventBuilder.java
@@ -79,15 +79,15 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
/**
* Builds a JDOM Document from a StAX-based XMLEventReader.
* <p>
- * XMLStreamReaders are pre-configured and as a result JDOM is not able to
- * alter whether the input is validated, or whether the Stream has escaped
+ * XMLSeventReaders are pre-configured and as a result JDOM is not able to
+ * alter whether the input is validated, or whether the Events have escaped
* entities or not. These (and other) characteristics are configurable by
* setting the correct features and properties on the XMLInputFactory when it
* is used to create the XMLStreamReader.
* <p>
* Useful configuration to set, or know about is:
* <ul>
- * <li>StAX streams seldom differentiate between Text and CDATA content. You
+ * <li>StAX Events seldom differentiate between Text and CDATA content. You
* will likely want to configure your StAX factory (XMLInputFactory) with
* <code>http://java.sun.com/xml/stream/properties/report-cdata-event</code>
* for the default Java StAX implementation, or the equivalent property for your
@@ -109,7 +109,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* @author Rolf Lear
*
*/
-public class StAXEventBuilder implements XMLStreamConstants {
+public class StAXEventBuilder {
/**
View
17 core/src/java/org/jdom2/input/StAXStreamBuilder.java
@@ -54,11 +54,12 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
package org.jdom2.input;
+import static javax.xml.stream.XMLStreamConstants.*;
+
import java.util.ArrayList;
import java.util.List;
import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
@@ -74,7 +75,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
import org.jdom2.input.stax.StAXFilter;
/**
- * Builds a JDOM Document from a StAX-based XMLStremReader.
+ * Builds a JDOM Document from a StAX-based XMLStreamReader.
* <p>
* XMLStreamReaders are pre-configured and as a result JDOM is not able to
* alter whether the input is validated, or whether the Stream has escaped
@@ -106,7 +107,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* @author Rolf Lear
*
*/
-public class StAXStreamBuilder implements XMLStreamConstants {
+public class StAXStreamBuilder {
/**
* Create a Document from an XMLStreamReader
@@ -122,14 +123,14 @@ private static final Document process(final JDOMFactory factory,
int state = stream.getEventType();
- if (XMLStreamConstants.START_DOCUMENT != state) {
+ if (START_DOCUMENT != state) {
throw new JDOMException("JDOM requires that XMLStreamReaders " +
"are at their beginning when being processed.");
}
final Document document = factory.document(null);
- while (state != XMLStreamConstants.END_DOCUMENT) {
+ while (state != END_DOCUMENT) {
switch (state) {
case START_DOCUMENT:
@@ -193,7 +194,7 @@ private static final Document process(final JDOMFactory factory,
int state = stream.getEventType();
- if (XMLStreamConstants.START_DOCUMENT != state) {
+ if (START_DOCUMENT != state) {
throw new JDOMException("JDOM requires that XMLStreamReaders " +
"are at their beginning when being processed.");
}
@@ -286,7 +287,7 @@ private static final Element processPrunableElement(final JDOMFactory factory,
final XMLStreamReader reader, final int topdepth, StAXFilter filter)
throws XMLStreamException, JDOMException {
- if (XMLStreamConstants.START_ELEMENT != reader.getEventType()) {
+ if (START_ELEMENT != reader.getEventType()) {
throw new JDOMException("JDOM requires that the XMLStreamReader " +
"is at the START_ELEMENT state when retrieving an " +
"Element Fragment.");
@@ -438,7 +439,7 @@ private static final Content processFragment(final JDOMFactory factory,
private static final Element processElementFragment(final JDOMFactory factory,
final XMLStreamReader reader) throws XMLStreamException, JDOMException {
- if (XMLStreamConstants.START_ELEMENT != reader.getEventType()) {
+ if (START_ELEMENT != reader.getEventType()) {
throw new JDOMException("JDOM requires that the XMLStreamReader " +
"is at the START_ELEMENT state when retrieving an " +
"Element Fragment.");

0 comments on commit 7c4f97a

Please sign in to comment.
Something went wrong with that request. Please try again.