Package org.apache.ws.jaxme.util

Examples of org.apache.ws.jaxme.util.NamespaceSupport


    return new AttributesImpl();
  }

  protected String getAttributeQName(JMXmlSerializer.Data pData, String pURI, String pLocalName)
      throws SAXException {
    NamespaceSupport nss = pData.getNamespaceSupport();
    String prefix = nss.getAttributePrefix(pURI);
    if (prefix == null) {
      String preferredPrefix = getPreferredPrefix(pURI);
      if (preferredPrefix == null  ||  preferredPrefix.length() == 0) {
        preferredPrefix = "p";
      }
View Full Code Here


    }
  }

  protected String getElementQName(JMXmlSerializer.Data pData, String pURI,
                             String pLocalName) throws SAXException {
    NamespaceSupport nss = pData.getNamespaceSupport();
    String prefix = nss.getPrefix(pURI);
    if (prefix == null) {
      prefix = pData.getNewPrefix(pURI, getPreferredPrefix(pURI));
      pData.getContentHandler().startPrefixMapping(prefix, pURI);
    }
    if (prefix.length() == 0) {
View Full Code Here

    handler.endElement(pNamespaceURI, pLocalName, qName);
  }

  public void marshal(JMXmlSerializer.Data pData, QName pName, Object pElement)
      throws SAXException {
    NamespaceSupport nss = pData.getNamespaceSupport();
    int context = nss.getContext();
    ContentHandler handler = pData.getContentHandler();
    String uri = pName.getNamespaceURI();
    if (uri == null) uri = "";
    String name = pName.getLocalPart();
    String qName = getElementQName(pData, uri, name);
    handler.startElement(uri, name, qName,
                         getAttributes(pData, pElement));
    marshalChilds(pData, pElement);
    handler.endElement(uri, name, qName);
    for (;;) {
      String prefix = nss.setContext(context);
      if (prefix == null) {
        break;
      }
      handler.endPrefixMapping(prefix);
    }
View Full Code Here

    return new AttributesImpl();
  }

  protected String getAttributeQName(JMXmlSerializer.Data pData, String pURI, String pLocalName)
      throws SAXException {
    NamespaceSupport nss = pData.getNamespaceContext();
    String prefix = nss.getAttributePrefix(pURI);
    if (prefix == null) {
      String preferredPrefix = getPreferredPrefix(pURI);
      if (preferredPrefix == null  ||  preferredPrefix.length() == 0) {
        preferredPrefix = "p";
      }
View Full Code Here

    }
  }

  protected String getElementQName(JMXmlSerializer.Data pData, String pURI,
                             String pLocalName) throws SAXException {
    NamespaceSupport nss = pData.getNamespaceContext();
    String prefix = nss.getPrefix(pURI);
    if (prefix == null) {
      prefix = pData.getNewPrefix(pURI, getPreferredPrefix(pURI));
      pData.getContentHandler().startPrefixMapping(prefix, pURI);
    }
    if (prefix.length() == 0) {
View Full Code Here

    handler.endElement(pNamespaceURI, pLocalName, qName);
  }

  public void marshal(JMXmlSerializer.Data pData, QName pName, Object pElement)
      throws SAXException {
    NamespaceSupport nss = pData.getNamespaceContext();
    int context = nss.getContext();
    ContentHandler handler = pData.getContentHandler();
    String uri = pName.getNamespaceURI();
    if (uri == null) uri = "";
    String name = pName.getLocalPart();
    String qName = getElementQName(pData, uri, name);
    AttributesImpl attrs = getAttributes(pData, pElement);
    if (!pData.isRootElementCreated()) {
      createSchemaLocationAttributes(pData, attrs);
      pData.setRootElementCreated(true);
    }
    handler.startElement(uri, name, qName, attrs);
    marshalChilds(pData, pElement);
    handler.endElement(uri, name, qName);
    for (;;) {
      String prefix = nss.setContext(context);
      if (prefix == null) {
        break;
      }
      handler.endPrefixMapping(prefix);
    }
View Full Code Here

      } else {
        schemaLocationAttribute = null;
      }
    }
    if (schemaLocation != null) {
      NamespaceSupport nss = pData.getNamespaceContext();
      String xsi = nss.getPrefix(XMLConstants.XML_SCHEMA_URI);
      if (xsi == null) {
        xsi = pData.getNewPrefix(XMLConstants.XML_SCHEMA_URI, "xsi");
        pData.getContentHandler().startPrefixMapping(xsi, XMLConstants.XML_SCHEMA_URI);
      }
      String xsiQName = (xsi == null  ||  "".equals(xsi)) ?
View Full Code Here

    h.endElement(pNamespaceURI, pLocalName, qName);
    restoreContext(context);
  }

  private void restoreContext(int pContext) throws SAXException {
    NamespaceSupport nss = getNamespaceContext();
    ContentHandler h = getTarget();
    for (;;) {
      String prefix = nss.checkContext(pContext);
      if (prefix == null) {
        return;
      }
      h.endPrefixMapping(prefix);
    }
View Full Code Here

    h.endElement(pNamespaceURI, pLocalName, qName);
    restoreContext(context);
  }

  private void restoreContext(int pContext) throws SAXException {
    NamespaceSupport nss = getNamespaceContext();
    ContentHandler h = getTarget();
    for (;;) {
      String prefix = nss.checkContext(pContext);
      if (prefix == null) {
        return;
      }
      h.endPrefixMapping(prefix);
    }
View Full Code Here

    return new AttributesImpl();
  }

  protected String getAttributeQName(JMXmlSerializer.Data pData, String pURI, String pLocalName)
      throws SAXException {
    NamespaceSupport nss = pData.getNamespaceContext();
    String prefix = nss.getAttributePrefix(pURI);
    if (prefix == null) {
      String preferredPrefix = getPreferredPrefix(pURI);
      if (preferredPrefix == null  ||  preferredPrefix.length() == 0) {
        preferredPrefix = "p";
      }
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.util.NamespaceSupport

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.