Prefixed all abstract classes with Abstract
This commit is contained in:
@@ -19,13 +19,12 @@ package org.springframework.xml.stream;
|
||||
import javax.xml.namespace.QName;
|
||||
import javax.xml.stream.XMLStreamException;
|
||||
|
||||
import org.springframework.xml.namespace.QNameUtils;
|
||||
import org.springframework.xml.namespace.SimpleNamespaceContext;
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import org.springframework.xml.namespace.QNameUtils;
|
||||
import org.springframework.xml.namespace.SimpleNamespaceContext;
|
||||
|
||||
/**
|
||||
* Abstract base class for SAX <code>ContentHandler</code> implementations that use StAX as a basis. All methods
|
||||
* delegate to internal template methods, capable of throwing a <code>XMLStreamException</code>. Additionally, an
|
||||
@@ -33,7 +32,7 @@ import org.springframework.xml.namespace.SimpleNamespaceContext;
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
*/
|
||||
public abstract class StaxContentHandler implements ContentHandler {
|
||||
public abstract class AbstractStaxContentHandler implements ContentHandler {
|
||||
|
||||
private SimpleNamespaceContext namespaceContext = new SimpleNamespaceContext();
|
||||
|
||||
@@ -67,7 +66,7 @@ public abstract class StaxContentHandler implements ContentHandler {
|
||||
/**
|
||||
* Binds the given prefix to the given namespaces.
|
||||
*
|
||||
* @see SimpleNamespaceContext#bindNamespaceUri(String, String)
|
||||
* @see SimpleNamespaceContext#bindNamespaceUri(String,String)
|
||||
*/
|
||||
public final void startPrefixMapping(String prefix, String uri) {
|
||||
namespaceContext.bindNamespaceUri(prefix, uri);
|
||||
@@ -35,7 +35,7 @@ import org.xml.sax.SAXParseException;
|
||||
* @see #setEntityResolver(org.xml.sax.EntityResolver)
|
||||
* @see #setErrorHandler(org.xml.sax.ErrorHandler)
|
||||
*/
|
||||
public abstract class StaxXmlReader extends AbstractXmlReader {
|
||||
public abstract class AbstractStaxXmlReader extends AbstractXmlReader {
|
||||
|
||||
/**
|
||||
* Parses the StAX XML reader passed at construction-time.
|
||||
@@ -41,7 +41,7 @@ import org.xml.sax.Locator;
|
||||
* @see XMLEvent
|
||||
* @see XMLEventConsumer
|
||||
*/
|
||||
public class StaxEventContentHandler extends StaxContentHandler {
|
||||
public class StaxEventContentHandler extends AbstractStaxContentHandler {
|
||||
|
||||
private final XMLEventFactory eventFactory;
|
||||
|
||||
@@ -115,9 +115,7 @@ public class StaxEventContentHandler extends StaxContentHandler {
|
||||
eventConsumer.add(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and returns a list of <code>NameSpace</code> objects from the <code>NamespaceContext</code>.
|
||||
*/
|
||||
/** Creates and returns a list of <code>NameSpace</code> objects from the <code>NamespaceContext</code>. */
|
||||
private List createNamespaces(SimpleNamespaceContext namespaceContext) {
|
||||
List namespaces = new ArrayList();
|
||||
String defaultNamespaceUri = namespaceContext.getNamespaceURI(XMLConstants.DEFAULT_NS_PREFIX);
|
||||
|
||||
@@ -45,7 +45,7 @@ import org.xml.sax.helpers.AttributesImpl;
|
||||
* @see #setEntityResolver(org.xml.sax.EntityResolver)
|
||||
* @see #setErrorHandler(org.xml.sax.ErrorHandler)
|
||||
*/
|
||||
public class StaxEventXmlReader extends StaxXmlReader {
|
||||
public class StaxEventXmlReader extends AbstractStaxXmlReader {
|
||||
|
||||
private final XMLEventReader reader;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.xml.sax.Locator;
|
||||
* @author Arjen Poutsma
|
||||
* @see XMLStreamWriter
|
||||
*/
|
||||
public class StaxStreamContentHandler extends StaxContentHandler {
|
||||
public class StaxStreamContentHandler extends AbstractStaxContentHandler {
|
||||
|
||||
private final XMLStreamWriter streamWriter;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import org.xml.sax.helpers.AttributesImpl;
|
||||
* @see #setEntityResolver(org.xml.sax.EntityResolver)
|
||||
* @see #setErrorHandler(org.xml.sax.ErrorHandler)
|
||||
*/
|
||||
public class StaxStreamXmlReader extends StaxXmlReader {
|
||||
public class StaxStreamXmlReader extends AbstractStaxXmlReader {
|
||||
|
||||
private final XMLStreamReader reader;
|
||||
|
||||
@@ -154,10 +154,8 @@ public class StaxStreamXmlReader extends StaxXmlReader {
|
||||
}
|
||||
|
||||
QName qName = reader.getName();
|
||||
getContentHandler().startElement(qName.getNamespaceURI(),
|
||||
qName.getLocalPart(),
|
||||
QNameUtils.toQualifiedName(qName),
|
||||
getAttributes());
|
||||
getContentHandler().startElement(qName.getNamespaceURI(), qName.getLocalPart(),
|
||||
QNameUtils.toQualifiedName(qName), getAttributes());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,11 +171,8 @@ public class StaxStreamXmlReader extends StaxXmlReader {
|
||||
if (type == null) {
|
||||
type = "";
|
||||
}
|
||||
attributes.addAttribute(namespace,
|
||||
reader.getAttributeLocalName(i),
|
||||
QNameUtils.toQualifiedName(reader.getAttributeName(i)),
|
||||
type,
|
||||
reader.getAttributeValue(i));
|
||||
attributes.addAttribute(namespace, reader.getAttributeLocalName(i),
|
||||
QNameUtils.toQualifiedName(reader.getAttributeName(i)), type, reader.getAttributeValue(i));
|
||||
}
|
||||
|
||||
return attributes;
|
||||
|
||||
Reference in New Issue
Block a user