Starting on SAAJ 1.1 support.
This commit is contained in:
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Copyright 2006 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.xml.sax;
|
||||
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.DTDHandler;
|
||||
import org.xml.sax.EntityResolver;
|
||||
import org.xml.sax.ErrorHandler;
|
||||
import org.xml.sax.SAXNotRecognizedException;
|
||||
import org.xml.sax.XMLReader;
|
||||
|
||||
/**
|
||||
* Abstract base class for SAX <code>XMLReader</code> implementations.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see #setContentHandler(org.xml.sax.ContentHandler)
|
||||
* @see #setDTDHandler(org.xml.sax.DTDHandler)
|
||||
* @see #setEntityResolver(org.xml.sax.EntityResolver)
|
||||
* @see #setErrorHandler(org.xml.sax.ErrorHandler)
|
||||
*/
|
||||
public abstract class AbstractXmlReader implements XMLReader {
|
||||
|
||||
private DTDHandler dtdHandler;
|
||||
|
||||
protected ContentHandler contentHandler;
|
||||
|
||||
private EntityResolver entityResolver;
|
||||
|
||||
protected ErrorHandler errorHandler;
|
||||
|
||||
public ContentHandler getContentHandler() {
|
||||
return contentHandler;
|
||||
}
|
||||
|
||||
public void setContentHandler(ContentHandler contentHandler) {
|
||||
this.contentHandler = contentHandler;
|
||||
}
|
||||
|
||||
public void setDTDHandler(DTDHandler dtdHandler) {
|
||||
this.dtdHandler = dtdHandler;
|
||||
}
|
||||
|
||||
public DTDHandler getDTDHandler() {
|
||||
return dtdHandler;
|
||||
}
|
||||
|
||||
public EntityResolver getEntityResolver() {
|
||||
return entityResolver;
|
||||
}
|
||||
|
||||
public void setEntityResolver(EntityResolver entityResolver) {
|
||||
this.entityResolver = entityResolver;
|
||||
}
|
||||
|
||||
public ErrorHandler getErrorHandler() {
|
||||
return errorHandler;
|
||||
}
|
||||
|
||||
public void setErrorHandler(ErrorHandler errorHandler) {
|
||||
this.errorHandler = errorHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws a <code>SAXNotRecognizedException</code> exception.
|
||||
*
|
||||
* @throws org.xml.sax.SAXNotRecognizedException
|
||||
* always
|
||||
*/
|
||||
public boolean getFeature(String name) throws SAXNotRecognizedException {
|
||||
throw new SAXNotRecognizedException(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws a <code>SAXNotRecognizedException</code> exception.
|
||||
*
|
||||
* @throws org.xml.sax.SAXNotRecognizedException
|
||||
* always
|
||||
*/
|
||||
public void setFeature(String name, boolean value) throws SAXNotRecognizedException {
|
||||
throw new SAXNotRecognizedException(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws a <code>SAXNotRecognizedException</code> exception.
|
||||
*
|
||||
* @throws org.xml.sax.SAXNotRecognizedException
|
||||
* always
|
||||
*/
|
||||
public Object getProperty(String name) throws SAXNotRecognizedException {
|
||||
throw new SAXNotRecognizedException(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws a <code>SAXNotRecognizedException</code> exception.
|
||||
*
|
||||
* @throws org.xml.sax.SAXNotRecognizedException
|
||||
* always
|
||||
*/
|
||||
public void setProperty(String name, Object value) throws SAXNotRecognizedException {
|
||||
throw new SAXNotRecognizedException(name);
|
||||
}
|
||||
}
|
||||
@@ -19,16 +19,12 @@ package org.springframework.xml.stream;
|
||||
import javax.xml.stream.Location;
|
||||
import javax.xml.stream.XMLStreamException;
|
||||
|
||||
import org.springframework.xml.sax.AbstractXmlReader;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.DTDHandler;
|
||||
import org.xml.sax.EntityResolver;
|
||||
import org.xml.sax.ErrorHandler;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.SAXNotRecognizedException;
|
||||
import org.xml.sax.SAXParseException;
|
||||
import org.xml.sax.XMLReader;
|
||||
|
||||
/**
|
||||
* Abstract base class for SAX <code>XMLReader</code> implementations that use StAX as a basis.
|
||||
@@ -39,83 +35,7 @@ import org.xml.sax.XMLReader;
|
||||
* @see #setEntityResolver(org.xml.sax.EntityResolver)
|
||||
* @see #setErrorHandler(org.xml.sax.ErrorHandler)
|
||||
*/
|
||||
public abstract class StaxXmlReader implements XMLReader {
|
||||
|
||||
private DTDHandler dtdHandler;
|
||||
|
||||
private ContentHandler contentHandler;
|
||||
|
||||
private EntityResolver entityResolver;
|
||||
|
||||
private ErrorHandler errorHandler;
|
||||
|
||||
public ContentHandler getContentHandler() {
|
||||
return contentHandler;
|
||||
}
|
||||
|
||||
public void setContentHandler(ContentHandler contentHandler) {
|
||||
this.contentHandler = contentHandler;
|
||||
}
|
||||
|
||||
public void setDTDHandler(DTDHandler dtdHandler) {
|
||||
this.dtdHandler = dtdHandler;
|
||||
}
|
||||
|
||||
public DTDHandler getDTDHandler() {
|
||||
return dtdHandler;
|
||||
}
|
||||
|
||||
public EntityResolver getEntityResolver() {
|
||||
return entityResolver;
|
||||
}
|
||||
|
||||
public void setEntityResolver(EntityResolver entityResolver) {
|
||||
this.entityResolver = entityResolver;
|
||||
}
|
||||
|
||||
public ErrorHandler getErrorHandler() {
|
||||
return errorHandler;
|
||||
}
|
||||
|
||||
public void setErrorHandler(ErrorHandler errorHandler) {
|
||||
this.errorHandler = errorHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws a <code>SAXNotRecognizedException</code> exception.
|
||||
*
|
||||
* @throws SAXNotRecognizedException always
|
||||
*/
|
||||
public boolean getFeature(String name) throws SAXNotRecognizedException {
|
||||
throw new SAXNotRecognizedException(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws a <code>SAXNotRecognizedException</code> exception.
|
||||
*
|
||||
* @throws SAXNotRecognizedException always
|
||||
*/
|
||||
public void setFeature(String name, boolean value) throws SAXNotRecognizedException {
|
||||
throw new SAXNotRecognizedException(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws a <code>SAXNotRecognizedException</code> exception.
|
||||
*
|
||||
* @throws SAXNotRecognizedException always
|
||||
*/
|
||||
public Object getProperty(String name) throws SAXNotRecognizedException {
|
||||
throw new SAXNotRecognizedException(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws a <code>SAXNotRecognizedException</code> exception.
|
||||
*
|
||||
* @throws SAXNotRecognizedException always
|
||||
*/
|
||||
public void setProperty(String name, Object value) throws SAXNotRecognizedException {
|
||||
throw new SAXNotRecognizedException(name);
|
||||
}
|
||||
public abstract class StaxXmlReader extends AbstractXmlReader {
|
||||
|
||||
/**
|
||||
* Parses the StAX XML reader passed at construction-time.
|
||||
|
||||
Reference in New Issue
Block a user