src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/TagInfoset.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -23,10 +23,12 @@
  * questions.
  */
 
 package com.sun.xml.internal.ws.encoding;
 
+import java.util.List;
+
 import org.xml.sax.helpers.AttributesImpl;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
 
 import javax.xml.stream.XMLStreamReader;

@@ -219,6 +221,37 @@
         else        return s;
     }
 
     private static final String[] EMPTY_ARRAY = new String[0];
     private static final AttributesImpl EMPTY_ATTRIBUTES = new AttributesImpl();
+
+    public String getNamespaceURI(String prefix) {
+        int size = ns.length/2;
+        for(int i=0; i<size; i++){
+            String p = ns[i*2  ];
+            String n = ns[i*2+1];
+            if (prefix.equals(p)) return n;
+        }
+        return null;
+    }
+
+    public String getPrefix(String namespaceURI) {
+        int size = ns.length/2;
+        for(int i=0; i<size; i++){
+            String p = ns[i*2  ];
+            String n = ns[i*2+1];
+            if (namespaceURI.equals(n)) return p;
+        }
+        return null;
+    }
+    //Who wants this?
+    public List<String> allPrefixes(String namespaceURI) {
+        int size = ns.length/2;
+        List<String> l = new java.util.ArrayList<String>();
+        for(int i=0; i<size; i++){
+            String p = ns[i*2  ];
+            String n = ns[i*2+1];
+            if (namespaceURI.equals(n)) l.add(p);
+        }
+        return l;
+    }
 }