Package org.eclipse.xsd.util

Examples of org.eclipse.xsd.util.JAXPConfiguration


  }
 
  private static void doSerialize(OutputStream outputStream, Document document, Map options) throws IOException
  {
    JAXPPool jaxpPool = null;
    JAXPConfiguration config = null;
    String encoding = null;
   
    if (options != null)
    {
      jaxpPool = (JAXPPool)options.get(WSDL_JAXP_POOL);
      config = (JAXPConfiguration)options.get(WSDL_JAXP_CONFIG);
      encoding = (String)options.get(WSDL_ENCODING);
    }
   
    if (jaxpPool == null)
    {
      if (config == null)
      {
        doSerialize(outputStream, document, encoding);
      }
      else
      {
        try
        {
          Transformer transformer = config.createTransformer(encoding);
          // Be sure to use actual encoding of the transformer which might be non-null even if encoding started as null.
          encoding = transformer.getOutputProperty(OutputKeys.ENCODING);
          Writer writer = encoding == null ? new OutputStreamWriter(outputStream) : new OutputStreamWriter(outputStream, encoding);
          transformer.transform(new DOMSource(document), new StreamResult(writer));
        }
View Full Code Here


   * @throws IOException
   */
  private static Document getDocument(InputSource inputSource, ErrorHandler errorHandler, Map options) throws IOException
  {
    JAXPPool jaxpPool = null;
    JAXPConfiguration config = null;
    if (options != null)
    {
      jaxpPool = (JAXPPool)options.get(WSDL_JAXP_POOL);
      config = (JAXPConfiguration)options.get(WSDL_JAXP_CONFIG);
    }

    if (jaxpPool == null)
    {
      if (config == null)
      {
        return getDocument(inputSource, errorHandler);
      }
      else
      {
        try
        {
          DocumentBuilder documentBuilder = config.createDocumentBuilder(errorHandler);
          Document document = documentBuilder.parse(inputSource);
          return document;
        }
        catch (ParserConfigurationException exception)
        {
View Full Code Here

   *
   * @param options a Map of String to Object, passed along through the ResourceSet and Resource.
   */
  public WSDLParser(Map options)
  {
    JAXPConfiguration config = null;
    if (options != null)
    {
      jaxpPool = (JAXPPool)options.get(WSDLResourceImpl.WSDL_JAXP_POOL);
      config = (JAXPConfiguration)options.get(WSDLResourceImpl.WSDL_JAXP_CONFIG);
    }
    try
    {
      if (jaxpPool == null)
      {     
        if (config != null)
        {
          saxParser = config.createSAXParser(this);
        }
        else
        {
          saxParser = new DefaultJAXPConfiguration().createSAXParser(this);
        }
View Full Code Here

TOP

Related Classes of org.eclipse.xsd.util.JAXPConfiguration

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.