1 29 30 package com.caucho.xml.stream.events; 31 32 import javax.xml.namespace.QName ; 33 import javax.xml.stream.events.Namespace; 34 35 public class NamespaceImpl extends AttributeImpl implements Namespace { 36 private final String _namespaceURI; 37 private final String _prefix; 38 39 public NamespaceImpl(String namespaceURI, String prefix) 40 { 41 super("".equals(prefix) || prefix == null 42 ? new QName ("http://www.w3.org/2000/xmlns/", "xmlns") 43 : new QName ("http://www.w3.org/2000/xmlns/", prefix, "xmlns"), 44 namespaceURI); 45 _namespaceURI = namespaceURI; 46 _prefix = prefix; 47 } 48 49 public String getNamespaceURI() 50 { 51 return _namespaceURI; 52 } 53 54 public String getPrefix() 55 { 56 return _prefix; 57 } 58 59 public boolean isDefaultNamespaceDeclaration() 60 { 61 return _prefix == null || "".equals(_prefix); 62 } 63 64 public int getEventType() 65 { 66 return NAMESPACE; 67 } 68 } 69 | Popular Tags |