summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/gnu/xml/stream/NamespaceImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/gnu/xml/stream/NamespaceImpl.java')
-rw-r--r--libjava/classpath/gnu/xml/stream/NamespaceImpl.java29
1 files changed, 28 insertions, 1 deletions
diff --git a/libjava/classpath/gnu/xml/stream/NamespaceImpl.java b/libjava/classpath/gnu/xml/stream/NamespaceImpl.java
index eeb57be6cac..1a595ee83d4 100644
--- a/libjava/classpath/gnu/xml/stream/NamespaceImpl.java
+++ b/libjava/classpath/gnu/xml/stream/NamespaceImpl.java
@@ -39,6 +39,7 @@ package gnu.xml.stream;
import java.io.IOException;
import java.io.Writer;
+import javax.xml.namespace.QName;
import javax.xml.stream.Location;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.events.Namespace;
@@ -55,12 +56,15 @@ public class NamespaceImpl
protected final String prefix;
protected final String uri;
+ protected final boolean specified;
- protected NamespaceImpl(Location location, String prefix, String uri)
+ protected NamespaceImpl(Location location, String prefix, String uri,
+ boolean specified)
{
super(location);
this.prefix = prefix;
this.uri = uri;
+ this.specified = specified;
}
public int getEventType()
@@ -78,6 +82,29 @@ public class NamespaceImpl
return uri;
}
+ public boolean isSpecified()
+ {
+ return specified;
+ }
+
+ public QName getName()
+ {
+ if (isDefaultNamespaceDeclaration())
+ return new QName("", "xmlns", null);
+ else
+ return new QName("", prefix, "xmlns");
+ }
+
+ public String getDTDType()
+ {
+ return "CDATA";
+ }
+
+ public String getValue()
+ {
+ return uri;
+ }
+
public boolean isDefaultNamespaceDeclaration()
{
return (prefix == null || "".equals(prefix));
OpenPOWER on IntegriCloud