gpt4 book ai didi

org.apache.axis2.util.XMLPrettyPrinter.prettify()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 09:25:05 24 4
gpt4 key购买 nike

本文整理了Java中org.apache.axis2.util.XMLPrettyPrinter.prettify()方法的一些代码示例,展示了XMLPrettyPrinter.prettify()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLPrettyPrinter.prettify()方法的具体详情如下:
包路径:org.apache.axis2.util.XMLPrettyPrinter
类名称:XMLPrettyPrinter
方法名:prettify

XMLPrettyPrinter.prettify介绍

[英]Pretty prints contents of the xml file.
[中]Pretty打印xml文件的内容。

代码示例

代码示例来源:origin: apache/axis2-java

/**
 * calls the xml pretty printers
 *
 * @param file
 */
protected void prettifyFile(File file) {
  XMLPrettyPrinter.prettify(file);
}

代码示例来源:origin: apache/axis2-java

protected void prettifyFile(File file) {
    XMLPrettyPrinter.prettify(file);
  }
}

代码示例来源:origin: wso2/wso2-synapse

private void writeToFile(OMElement content, File file) throws Exception {
  File tempFile = File.createTempFile("syn_mx_", ".xml");
  OutputStream out = FileUtils.openOutputStream(tempFile);
  XMLPrettyPrinter.prettify(content, out);
  out.flush();
  out.close();
  FileUtils.copyFile(tempFile, file);
  FileUtils.deleteQuietly(tempFile);
}

代码示例来源:origin: org.apache.synapse/synapse-core

private void writeToFile(OMElement content, File file) throws Exception {
  File tempFile = File.createTempFile("syn_mx_", ".xml");
  OutputStream out = FileUtils.openOutputStream(tempFile);
  XMLPrettyPrinter.prettify(content, out);
  out.flush();
  out.close();
  FileUtils.copyFile(tempFile, file);
  FileUtils.deleteQuietly(tempFile);
}

代码示例来源:origin: apache/axis2-java

public void writeSchema(XmlSchema schema, String schemaFileName) {
  try {
    if (schema != null) {
      //create a output file
      File outputFile = FileWriter.createClassFile(baseFolder,
                             null,
                             schemaFileName.substring(0,
                                         schemaFileName.lastIndexOf(
                                             ".")),
                             ".xsd");
      FileOutputStream fos = new FileOutputStream(outputFile);
      //set the options for the schemas
      schema.write(fos,getDefaultOptionMap());
      fos.flush();
      fos.close();
      XMLPrettyPrinter.prettify(outputFile);
    }
  } catch (Exception e) {
    throw new RuntimeException("Schema writing failed!", e);
  }
}

代码示例来源:origin: org.apache.synapse/synapse-core

protected void writeToFile(OMElement content, String fileName) throws Exception {
  // this is not good, but I couldn't think of a better design :-(
  SynapseArtifactDeploymentStore deploymentStore =
      getSynapseConfiguration().getArtifactDeploymentStore();
  deploymentStore.addRestoredArtifact(fileName);
  OutputStream out = FileUtils.openOutputStream(new File(fileName));
  XMLPrettyPrinter.prettify(content, out);
  out.flush();
  out.close();
}

代码示例来源:origin: wso2/wso2-synapse

protected void writeToFile(OMElement content, String fileName) throws Exception {
  // this is not good, but I couldn't think of a better design :-(
  SynapseArtifactDeploymentStore deploymentStore =
      getSynapseConfiguration().getArtifactDeploymentStore();
  deploymentStore.addRestoredArtifact(fileName);
  OutputStream out = FileUtils.openOutputStream(new File(fileName));
  XMLPrettyPrinter.prettify(content, out);
  out.flush();
  out.close();
}

代码示例来源:origin: org.wso2.carbon.data/org.wso2.carbon.dataservices.core

writer.write(dsContents);
  writer.close();
  XMLPrettyPrinter.prettify(new File(dataservicesFile));
} catch (IOException e) {
  String message = "Error in writing the contract first data service to the repository";

代码示例来源:origin: apache/axis2-java

public String readWSDLFromFile(String path) throws Exception {
  File file=new File(path);
  XMLPrettyPrinter.prettify(file);    //this is used to correct unnecessary formatting in the file
  return readFile(path);
}

代码示例来源:origin: apache/axis2-java

private static void invokeTimeService() {
  String endPointUrl = "xmpp://synapse.demo.0@gmail.com/" + "TimeService";
  EndpointReference targetEPR = new EndpointReference(endPointUrl);
  try {
    ConfigurationContext ctx =
    ConfigurationContextFactory.createConfigurationContextFromURIs(
        XMPPSampleClient.class.getResource("axis2.xml"), null);
    OMElement payload = getPayload();
    Options options = new Options();
    options.setProperty(XMPPConstants.XMPP_SERVER_TYPE, XMPPConstants.XMPP_SERVER_TYPE_GOOGLETALK);
    options.setProperty(XMPPConstants.XMPP_SERVER_URL, XMPPConstants.GOOGLETALK_URL);
    options.setProperty(XMPPConstants.XMPP_SERVER_USERNAME, "synapse.demo.0");
    options.setProperty(XMPPConstants.XMPP_SERVER_PASSWORD, "mailpassword");
    options.setTo(targetEPR);
    options.setAction("urn:getServerTime");
    ServiceClient sender = new ServiceClient(ctx,null);
    sender.setOptions(options);
    OMElement result = sender.sendReceive(payload);
    XMLPrettyPrinter.prettify(result, System.out);
  } catch (Exception e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: org.apache.axis2/axis2-kernel

/**
 * Retrieves the WSDL data associated with the given serviceURL.
 * @param out The output stream for the WSDL data to be written, NOTE: the stream is not closed after the operation, 
 *            it is the responsibility of the caller to close the stream after usage.
 * @param serviceURL The fist element of this array i.e. serviceURL[0] is taken in retrieving the target service.
 */
private void getWSDL(OutputStream out, String[] serviceURL)
    throws AxisFault {
  // Retrieve WSDL using the same data retrieval path for GetMetadata
  // request.
  DataRetrievalRequest request = new DataRetrievalRequest();
  request.putDialect(DRConstants.SPEC.DIALECT_TYPE_WSDL);
  request.putOutputForm(OutputForm.INLINE_FORM);
  MessageContext context = new MessageContext();
  context.setAxisService(this);
  context.setTo(new EndpointReference(serviceURL[0]));
  Data[] result = getData(request, context);
  OMElement wsdlElement;
  if (result != null && result.length > 0) {
    wsdlElement = (OMElement) (result[0].getData());
    try {
      XMLPrettyPrinter.prettify(wsdlElement, out);
      out.flush();
    } catch (Exception e) {
      throw AxisFault.makeFault(e);
    }
  }
}

代码示例来源:origin: apache/axis2-java

/**
 * Retrieves the WSDL data associated with the given serviceURL.
 * @param out The output stream for the WSDL data to be written, NOTE: the stream is not closed after the operation, 
 *            it is the responsibility of the caller to close the stream after usage.
 * @param serviceURL The fist element of this array i.e. serviceURL[0] is taken in retrieving the target service.
 */
private void getWSDL(OutputStream out, String[] serviceURL)
    throws AxisFault {
  // Retrieve WSDL using the same data retrieval path for GetMetadata
  // request.
  DataRetrievalRequest request = new DataRetrievalRequest();
  request.putDialect(DRConstants.SPEC.DIALECT_TYPE_WSDL);
  request.putOutputForm(OutputForm.INLINE_FORM);
  MessageContext context = new MessageContext();
  context.setAxisService(this);
  context.setTo(new EndpointReference(serviceURL[0]));
  Data[] result = getData(request, context);
  OMElement wsdlElement;
  if (result != null && result.length > 0) {
    wsdlElement = (OMElement) (result[0].getData());
    try {
      XMLPrettyPrinter.prettify(wsdlElement, out);
      out.flush();
    } catch (Exception e) {
      throw AxisFault.makeFault(e);
    }
  }
}

代码示例来源:origin: org.apache.axis2/axis2-kernel

XMLPrettyPrinter.prettify(wsdlElement, out);
  out.flush();
} catch (Exception e) {

代码示例来源:origin: apache/axis2-java

XMLPrettyPrinter.prettify(wsdlElement, out);
  out.flush();
} catch (Exception e) {

代码示例来源:origin: org.apache.axis2/axis2-kernel

XMLPrettyPrinter.prettify(wsdlElement, out);
  out.flush();
} catch (Exception e) {

代码示例来源:origin: apache/axis2-java

XMLPrettyPrinter.prettify(wsdlElement, out);
  out.flush();
} catch (Exception e) {

代码示例来源:origin: apache/axis2-java

wsdlElement.serialize(out);
} else {
  XMLPrettyPrinter.prettify(wsdlElement, out);
  wsdlElement.serialize(out);
} else {
  XMLPrettyPrinter.prettify(wsdlElement, out);

代码示例来源:origin: org.apache.axis2/axis2-java2wsdl

wsdlElement.serialize(out);
} else {
  XMLPrettyPrinter.prettify(wsdlElement, out);
  wsdlElement.serialize(out);
} else {
  XMLPrettyPrinter.prettify(wsdlElement, out);

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com