code: @Override
      public void setPrefix(String prefix, String uri)
          throws XMLStreamException
      {
          if (prefix == null) {
              throw new NullPointerException("Can not pass null 'prefix' value");
          }
          // Are we actually trying to set the default namespace?
          if (prefix.length() == 0) {
              setDefaultNamespace(uri);
              return;
          }
          if (uri == null) {
              throw new NullPointerException("Can not pass null 'uri' value");
          }
  
          /* Let's verify that xml/xmlns are never (mis)declared; as
           * mandated by XML NS specification
           */
          {
              if (prefix.equals("xml")) {
                  if (!uri.equals(XMLConstants.XML_NS_URI)) {
                      throwOutputError(ErrorConsts.ERR_NS_REDECL_XML, uri);
                  }
              } else if (prefix.equals("xmlns")) { // prefix "xmlns"
                  if (!uri.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
                      throwOutputError(ErrorConsts.ERR_NS_REDECL_XMLNS, uri);
                  }
                  // At any rate; we are NOT to output it
                  return;
              } else {
                  // Neither of prefixes.. but how about URIs?
                  if (uri.equals(XMLConstants.XML_NS_URI)) {
                      throwOutputError(ErrorConsts.ERR_NS_REDECL_XML_URI, prefix);
                  } else if (uri.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
                      throwOutputError(ErrorConsts.ERR_NS_REDECL_XMLNS_URI, prefix);
                  }
              }
          }
  
          if (mSuggestedPrefixes == null) {
              mSuggestedPrefixes = new HashMap<String,String>(16);
          }
          mSuggestedPrefixes.put(uri, prefix);
  
      }
docs: public void setNamespaceContext(NamespaceContext context)