diff options
| author | Chris Burdess <dog@bluezoo.org> | 2009-07-08 07:53:26 +0000 |
|---|---|---|
| committer | Chris Burdess <dog@bluezoo.org> | 2009-07-08 07:53:26 +0000 |
| commit | 2229457f8b632b6046c47c1cd6919dd2a32e730f (patch) | |
| tree | 80d3ffee9bf11e316e0898ebde835d410ad46404 /gnu/xml/stream/NamespaceImpl.java | |
| parent | 7e8b44e1c203d4549722e2cc6c40d600f809bce9 (diff) | |
| download | classpath-2229457f8b632b6046c47c1cd6919dd2a32e730f.tar.gz | |
2009-07-08 Chris Burdess <dog@gnu.org>
PR xml/40663:
* javax/xml/stream/XMLEventFactory.java,
* javax/xml/stream/XMLInputFactory.java,
* javax/xml/stream/XMLOutputFactory.java,
* javax/xml/stream/events/Namespace.java: Update API to match final
version of StAX.
* javax/xml/stream/util/ReaderDelegate.java: Removed.
* javax/xml/stream/util/StreamReaderDelegate.java: Added (renamed
from ReaderDelegate)
* gnu/xml/stream/FilteredStreamReader.java,
* gnu/xml/stream/NamespaceImpl.java,
* gnu/xml/stream/XIncludeFilter.java,
* gnu/xml/stream/XMLEventAllocatorImpl.java,
* gnu/xml/stream/XMLEventFactoryImpl.java: Update implementation to
match final version of StAX API.
Diffstat (limited to 'gnu/xml/stream/NamespaceImpl.java')
| -rw-r--r-- | gnu/xml/stream/NamespaceImpl.java | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/gnu/xml/stream/NamespaceImpl.java b/gnu/xml/stream/NamespaceImpl.java index eeb57be6c..1a595ee83 100644 --- a/gnu/xml/stream/NamespaceImpl.java +++ b/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)); |
