Examples of canSetParameter()


Examples of org.w3c.dom.DOMConfiguration.canSetParameter()

     *
     * @param pPrettyPrint {@code true} to enable pretty printing
     */
    public void setPrettyPrint(final boolean pPrettyPrint) {
        DOMConfiguration configuration = serializer.getDomConfig();
        if (configuration.canSetParameter(PARAM_PRETTY_PRINT, pPrettyPrint)) {
            configuration.setParameter(PARAM_PRETTY_PRINT, pPrettyPrint);
        }
    }

    public boolean getPrettyPrint() {
View Full Code Here

Examples of org.w3c.dom.DOMConfiguration.canSetParameter()

        && domImplementation.hasFeature("Core", "2.0")) {
      DOMImplementationLS domImplementationLS = (DOMImplementationLS) domImplementation
          .getFeature("LS", "3.0");
      LSSerializer lsSerializer = domImplementationLS.createLSSerializer();
      DOMConfiguration domConfiguration = lsSerializer.getDomConfig();
      if (domConfiguration.canSetParameter("format-pretty-print", Boolean.TRUE)) {
        lsSerializer.getDomConfig().setParameter("format-pretty-print", Boolean.TRUE);
        LSOutput lsOutput = domImplementationLS.createLSOutput();
        lsOutput.setEncoding("UTF-8");
        StringWriter stringWriter = new StringWriter();
        lsOutput.setCharacterStream(stringWriter);
View Full Code Here

Examples of org.w3c.dom.DOMConfiguration.canSetParameter()

            if (domImplementationLS != null) {
                final LSSerializer lsSerializer = domImplementationLS
                        .createLSSerializer();
                final DOMConfiguration domConfiguration = lsSerializer
                        .getDomConfig();
                if (domConfiguration.canSetParameter("format-pretty-print",
                        Boolean.TRUE)) {
                    lsSerializer.getDomConfig().setParameter(
                            "format-pretty-print", Boolean.TRUE);
                    final LSOutput lsOutput = domImplementationLS
                            .createLSOutput();
View Full Code Here

Examples of org.w3c.dom.DOMConfiguration.canSetParameter()

    static void prettyPrintWithDOM3LS(Document document, OutputStream out) {
        DOMImplementationLS domImpl = getDOMImplementationLS(document);
        LSSerializer lsSerializer = domImpl.createLSSerializer();
        DOMConfiguration domConfiguration = lsSerializer.getDomConfig();
        if (domConfiguration.canSetParameter("format-pretty-print",
                                             Boolean.TRUE)) {
            lsSerializer.getDomConfig().setParameter("format-pretty-print",
                                                     Boolean.TRUE);
            LSOutput lsOutput = domImpl.createLSOutput();
            lsOutput.setEncoding("UTF-8");
View Full Code Here

Examples of org.w3c.dom.DOMConfiguration.canSetParameter()

    public static String serialize(Document document, boolean prettyPrint) {
        DOMImplementationLS impl = getDOMImpl();
        LSSerializer serializer = impl.createLSSerializer();
        // document.normalizeDocument();
        DOMConfiguration config = serializer.getDomConfig();
        if (prettyPrint && config.canSetParameter("format-pretty-print", Boolean.TRUE)) {
            config.setParameter("format-pretty-print", true);
        }
        config.setParameter("xml-declaration", true);       
        LSOutput output = impl.createLSOutput();
        output.setEncoding("UTF-8");
View Full Code Here

Examples of org.w3c.dom.DOMConfiguration.canSetParameter()

            throws IOException {
        final DOMImplementationLS impl = DomUtil.getDOMImplementation();
        final LSParser builder = impl.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null);
        final DOMConfiguration domConfiguration = builder.getDomConfig();
        if (resourceResolver != null
                && domConfiguration.canSetParameter("resource-resolver", resourceResolver)) {
            domConfiguration.setParameter("resource-resolver", resourceResolver);
        }

        final LSInput lsInput = impl.createLSInput();
        lsInput.setByteStream(inputStream);
View Full Code Here

Examples of org.w3c.dom.DOMConfiguration.canSetParameter()

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        LSOutput destination = domImpl.createLSOutput();
        destination.setByteStream(out);
        LSSerializer serializer = domImpl.createLSSerializer();
        DOMConfiguration domConfig = serializer.getDomConfig();
        if (domConfig.canSetParameter("format-pretty-print", Boolean.TRUE)) {
            domConfig.setParameter("format-pretty-print", Boolean.TRUE);
        }
        serializer.write(dom, destination);

        requestTrace("Encoded ", request.getOperation(), " request: ", out);
View Full Code Here

Examples of org.w3c.dom.DOMConfiguration.canSetParameter()

        && domImplementation.hasFeature("Core", "2.0")) {
      DOMImplementationLS domImplementationLS = (DOMImplementationLS) domImplementation
          .getFeature("LS", "3.0");
      LSSerializer lsSerializer = domImplementationLS.createLSSerializer();
      DOMConfiguration domConfiguration = lsSerializer.getDomConfig();
      if (domConfiguration.canSetParameter("format-pretty-print", Boolean.TRUE)) {
        lsSerializer.getDomConfig().setParameter("format-pretty-print", Boolean.TRUE);
        LSOutput lsOutput = domImplementationLS.createLSOutput();
        lsOutput.setEncoding("UTF-8");
        StringWriter stringWriter = new StringWriter();
        lsOutput.setCharacterStream(stringWriter);
View Full Code Here

Examples of org.w3c.dom.DOMConfiguration.canSetParameter()

      DOMImplementationLS domImplementationLS = (DOMImplementationLS) domImplementation
          .getFeature("LS", "3.0");
      LSSerializer lsSerializer = domImplementationLS
          .createLSSerializer();
      DOMConfiguration domConfiguration = lsSerializer.getDomConfig();
      if (domConfiguration.canSetParameter("format-pretty-print",
          Boolean.TRUE)) {
        lsSerializer.getDomConfig().setParameter("format-pretty-print",
            Boolean.TRUE);
        LSOutput lsOutput = domImplementationLS.createLSOutput();
        lsOutput.setEncoding("UTF-8");
View Full Code Here

Examples of org.w3c.dom.DOMConfiguration.canSetParameter()

      DOMImplementationLS domImplementationLS = (DOMImplementationLS) domImplementation
          .getFeature("LS", "3.0");
      LSSerializer lsSerializer = domImplementationLS
          .createLSSerializer();
      DOMConfiguration domConfiguration = lsSerializer.getDomConfig();
      if (domConfiguration.canSetParameter("format-pretty-print",
          Boolean.TRUE)) {
        lsSerializer.getDomConfig().setParameter("format-pretty-print",
            Boolean.TRUE);
        LSOutput lsOutput = domImplementationLS.createLSOutput();
        lsOutput.setEncoding("UTF-16");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.