This commit is contained in:
@@ -24,7 +24,8 @@ import org.xml.sax.SAXNotRecognizedException;
|
||||
import org.xml.sax.XMLReader;
|
||||
|
||||
/**
|
||||
* Abstract base class for SAX <code>XMLReader</code> implementations.
|
||||
* Abstract base class for SAX <code>XMLReader</code> implementations. Contains properties as defined in {@link
|
||||
* XMLReader}, and does not recognize any features
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see #setContentHandler(org.xml.sax.ContentHandler)
|
||||
@@ -36,11 +37,11 @@ public abstract class AbstractXmlReader implements XMLReader {
|
||||
|
||||
private DTDHandler dtdHandler;
|
||||
|
||||
protected ContentHandler contentHandler;
|
||||
private ContentHandler contentHandler;
|
||||
|
||||
private EntityResolver entityResolver;
|
||||
|
||||
protected ErrorHandler errorHandler;
|
||||
private ErrorHandler errorHandler;
|
||||
|
||||
public ContentHandler getContentHandler() {
|
||||
return contentHandler;
|
||||
|
||||
@@ -68,8 +68,8 @@ public abstract class StaxXmlReader extends AbstractXmlReader {
|
||||
catch (XMLStreamException ex) {
|
||||
SAXParseException saxException = new SAXParseException(ex.getMessage(), null, null,
|
||||
ex.getLocation().getLineNumber(), ex.getLocation().getColumnNumber(), ex);
|
||||
if (errorHandler != null) {
|
||||
errorHandler.fatalError(saxException);
|
||||
if (getErrorHandler() != null) {
|
||||
getErrorHandler().fatalError(saxException);
|
||||
}
|
||||
else {
|
||||
throw saxException;
|
||||
@@ -84,14 +84,12 @@ public abstract class StaxXmlReader extends AbstractXmlReader {
|
||||
* @see ContentHandler#setDocumentLocator(org.xml.sax.Locator)
|
||||
*/
|
||||
protected void setLocator(Location location) {
|
||||
if (contentHandler != null) {
|
||||
contentHandler.setDocumentLocator(new StaxLocator(location));
|
||||
if (getContentHandler() != null) {
|
||||
getContentHandler().setDocumentLocator(new StaxLocator(location));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Template-method that parses the StAX reader passed at construction-time.
|
||||
*/
|
||||
/** Template-method that parses the StAX reader passed at construction-time. */
|
||||
protected abstract void parseInternal() throws SAXException, XMLStreamException;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user