Author: dims
Date: Tue Nov 3 19:10:40 2009
New Revision: 832515
URL: http://svn.apache.org/viewvc?rev=832515&view=rev
Log:
Deleting extra code by extending StreamReaderDelegate
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/xop/XOPDecodingStreamReader.java
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/xop/XOPDecodingStreamReader.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/xop/XOPDecodingStreamReader.java?rev=832515&r1=832514&r2=832515&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/xop/XOPDecodingStreamReader.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/xop/XOPDecodingStreamReader.java
Tue Nov 3 19:10:40 2009
@@ -29,6 +29,7 @@
import javax.xml.stream.Location;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.util.StreamReaderDelegate;
import org.apache.axiom.ext.stax.datahandler.DataHandlerProvider;
import org.apache.axiom.ext.stax.datahandler.DataHandlerReader;
@@ -55,7 +56,7 @@
* {...@link DataHandlerReader#getDataHandlerProvider()}, then the {...@link
MimePartProvider} will only
* be invoked when {...@link DataHandlerProvider#getDataHandler()} is called.
*/
-public class XOPDecodingStreamReader implements XMLStreamReader,
DataHandlerReader {
+public class XOPDecodingStreamReader extends StreamReaderDelegate implements
XMLStreamReader, DataHandlerReader {
private static final String SOLE_CHILD_MSG =
"Expected xop:Include as the sole child of an element information
item (see section " +
"3.2 of http://www.w3.org/TR/xop10/)";
@@ -101,6 +102,7 @@
* stream.
*/
public XOPDecodingStreamReader(XMLStreamReader parent, MimePartProvider
mimePartProvider) {
+ super(parent);
this.parent = parent;
this.mimePartProvider = mimePartProvider;
}
@@ -217,50 +219,6 @@
}
}
- public void close() throws XMLStreamException {
- parent.close();
- }
-
- public int getAttributeCount() {
- return parent.getAttributeCount();
- }
-
- public String getAttributeLocalName(int index) {
- return parent.getAttributeLocalName(index);
- }
-
- public QName getAttributeName(int index) {
- return parent.getAttributeName(index);
- }
-
- public String getAttributeNamespace(int index) {
- return parent.getAttributeNamespace(index);
- }
-
- public String getAttributePrefix(int index) {
- return parent.getAttributePrefix(index);
- }
-
- public String getAttributeType(int index) {
- return parent.getAttributeType(index);
- }
-
- public String getAttributeValue(int index) {
- return parent.getAttributeValue(index);
- }
-
- public boolean isAttributeSpecified(int index) {
- return parent.isAttributeSpecified(index);
- }
-
- public String getAttributeValue(String namespaceURI, String localName) {
- return parent.getAttributeValue(namespaceURI, localName);
- }
-
- public String getCharacterEncodingScheme() {
- return parent.getCharacterEncodingScheme();
- }
-
public String getElementText() throws XMLStreamException {
if (parent.getEventType() != START_ELEMENT) {
throw new XMLStreamException("The current event is not a
START_ELEMENT event");
@@ -317,10 +275,6 @@
}
}
- public String getEncoding() {
- return parent.getEncoding();
- }
-
public String getPrefix() {
if (dh != null) {
throw new IllegalStateException();
@@ -357,11 +311,6 @@
return parent.getLocation();
}
- // Attention!
- public NamespaceContext getNamespaceContext() {
- return parent.getNamespaceContext();
- }
-
public String getNamespaceURI(String prefix) {
String uri = parent.getNamespaceURI(prefix);
if ("xop".equals(prefix) && uri != null) {
@@ -394,14 +343,6 @@
}
}
- public String getPIData() {
- return parent.getPIData();
- }
-
- public String getPITarget() {
- return parent.getPITarget();
- }
-
private static String toBase64(DataHandler dh) throws XMLStreamException {
try {
return Base64Utils.encode(dh);
@@ -477,22 +418,6 @@
}
}
- public String getVersion() {
- return parent.getVersion();
- }
-
- public boolean hasNext() throws XMLStreamException {
- return parent.hasNext();
- }
-
- public boolean isStandalone() {
- return parent.isStandalone();
- }
-
- public boolean standaloneSet() {
- return parent.standaloneSet();
- }
-
public boolean hasText() {
return dh != null || parent.hasText();
}