Skip to content
Permalink
Browse files
Moved EmptyOMLocation to org.apache.axiom.util.stax and renamed it to…
… DummyLocation. Also made it a singleton: no need to create a new instance on every call of XMLStreamReader#getLocation().
  • Loading branch information
veithen committed Apr 28, 2010
1 parent 9c977ea commit 817155b974733c2c378390218a754746a1bb6c41
Showing 1 changed file with 2 additions and 8 deletions.
@@ -30,8 +30,8 @@
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;

import org.apache.axiom.om.impl.EmptyOMLocation;
import org.apache.axiom.om.impl.llom.util.NamespaceContextImpl;
import org.apache.axiom.util.stax.DummyLocation;
import org.apache.commons.io.IOUtils;

/**
@@ -69,12 +69,6 @@
// TODO: This class has been copied from Synapse (package org.apache.synapse.util).
// Once it has been moved to Axis2 or Axiom, remove the duplicate from Synapse.
public class WrappedTextNodeStreamReader implements XMLStreamReader {
/**
* Location object returned by {@link #getLocation()}.
* It always returns -1 for the location and null for the publicId and systemId.
*/
private final static Location EMPTY_LOCATION = new EmptyOMLocation();

/**
* The qualified name of the wrapper element.
*/
@@ -210,7 +204,7 @@ public void require(int type, String namespaceURI, String localName) throws XMLS

public Location getLocation() {
// We do not support location information
return EMPTY_LOCATION;
return DummyLocation.INSTANCE;
}

public void close() throws XMLStreamException {

0 comments on commit 817155b

Please sign in to comment.