Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlOptions


//        if (!webXmlExists) {
                webXml.getParentFile().mkdirs();
                try {
                    FileWriter outFile = new FileWriter(webXml);

                    XmlOptions opts = new XmlOptions();
                    opts.setSaveAggressiveNamespaces();
                    opts.setSaveSyntheticDocumentElement(WebAppDocument.type.getDocumentElementName());
                    opts.setUseDefaultNamespace();
                    opts.setSavePrettyPrint();

    //                WebAppDocument doc = WebAppDocument.Factory.newInstance();
    //                doc.setWebApp(webApp);

                    outFile.write(shortWebApp.xmlText(opts));
View Full Code Here


    public void removePropertyChangeListener(PropertyChangeListener pcl) {
        pcs.removePropertyChangeListener(pcl);
    }

    public void toXML(OutputStream outputStream) throws IOException {
        XmlOptions options = new XmlOptions();
        options.setSavePrettyPrint();
        options.setSavePrettyPrintIndent(4);
        options.setUseDefaultNamespace();
        xmlObject.save(outputStream, options);
    }
View Full Code Here

            environmentType = (EnvironmentType) xmlObject;
        } else {
            environmentType = (EnvironmentType) xmlObject.copy().changeType(EnvironmentType.type);
        }
        try {
            XmlOptions xmlOptions = new XmlOptions();
            xmlOptions.setLoadLineNumbers();
            Collection errors = new ArrayList();
            xmlOptions.setErrorListener(errors);
            if (!environmentType.validate(xmlOptions)) {
                throw new XmlException("Invalid deployment descriptor: " + errors + "\nDescriptor: " + environmentType.toString(), null, errors);
            }
        } catch (XmlException e) {
            throw new DeploymentException(e);
View Full Code Here

    }

    public String getAsText() {
        Environment environment = (Environment) getValue();
        EnvironmentType environmentType = buildEnvironmentType(environment);
        XmlOptions xmlOptions = new XmlOptions();
        xmlOptions.setSaveSyntheticDocumentElement(QNAME);
        xmlOptions.setSavePrettyPrint();
        return environmentType.xmlText(xmlOptions);
    }
View Full Code Here

        }

        GerWebAppDocument webAppDocument = GerWebAppDocument.Factory.newInstance();
        webAppDocument.setWebApp(getWebApp());
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        XmlOptions options = new XmlOptions();
        options.setSavePrettyPrint();
        options.setSavePrettyPrintIndent(4);
        options.setUseDefaultNamespace();
        webAppDocument.save(outputStream, options);
        outputStream.close();
        deploymentPlan = new String(outputStream.toByteArray(), "US-ASCII");
        return deploymentPlan;
    }
View Full Code Here

                    xmlCursor.removeAttribute(SERVER_SIDE_QNAME);
                } while (xmlCursor.toNextSibling(LOGIN_MODULE_QNAME));
            }
            xmlCursor.pop();
            //validate
            XmlOptions xmlOptions = new XmlOptions();
            xmlOptions.setLoadLineNumbers();
            Collection errors = new ArrayList();
            xmlOptions.setErrorListener(errors);
            if (!loginConfig.validate(xmlOptions)) {
                throw new DeploymentException("Invalid login configuration:\n" + errors + "\nDescriptor: " + loginConfig.toString());
            }
            //find the login modules
            Set<String> loginModuleNames = new HashSet<String>();
View Full Code Here

        }

        GerApplicationDocument appDocument = GerApplicationDocument.Factory.newInstance();
        appDocument.setApplication(enterpriseApp);
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        XmlOptions options = new XmlOptions();
        options.setSavePrettyPrint();
        options.setSavePrettyPrintIndent(4);
        options.setUseDefaultNamespace();
        appDocument.save(outputStream, options);
        outputStream.close();
        deploymentPlan = new String(outputStream.toByteArray(), "US-ASCII");
        return deploymentPlan;
    }
View Full Code Here

      } catch (InvalidFormatException e){
        throw new POIXMLException(e);
      }
    }
    if(extPart != null){
      XmlOptions xmlOptions = new XmlOptions(POIXMLDocumentPart.DEFAULT_XML_OPTIONS);

      Map<String, String> map = new HashMap<String, String>();
      map.put("http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", "vt");
      xmlOptions.setSaveSuggestedPrefixes(map);

      OutputStream out = extPart.getOutputStream();
      ext.props.save(out, xmlOptions);
      out.close();
    }
    if(custPart != null){
      XmlOptions xmlOptions = new XmlOptions(POIXMLDocumentPart.DEFAULT_XML_OPTIONS);

      Map<String, String> map = new HashMap<String, String>();
      map.put("http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", "vt");
      xmlOptions.setSaveSuggestedPrefixes(map);

      OutputStream out = custPart.getOutputStream();
      cust.props.save(out, xmlOptions);
      out.close();
    }
View Full Code Here

    @Override
    public String getAsText() {
        JavabeanType javabeanType = getJavabeanType(getValue());
       
        XmlOptions xmlOptions = new XmlOptions();
        xmlOptions.setSaveSyntheticDocumentElement(QNAME);
        xmlOptions.setSavePrettyPrint();
        return javabeanType.xmlText(xmlOptions);
    }
View Full Code Here

            environmentType = (EnvironmentType) xmlObject;
        } else {
            environmentType = (EnvironmentType) xmlObject.copy().changeType(EnvironmentType.type);
        }
        try {
            XmlOptions xmlOptions = new XmlOptions();
            xmlOptions.setLoadLineNumbers();
            Collection errors = new ArrayList();
            xmlOptions.setErrorListener(errors);
            if (!environmentType.validate(xmlOptions)) {
                throw new XmlException("Invalid deployment descriptor: " + errors + "\nDescriptor: " + environmentType.toString(), null, errors);
            }
        } catch (XmlException e) {
            throw new DeploymentException(e);
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.XmlOptions

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.