Package org.apache.avalon.framework.configuration

Examples of org.apache.avalon.framework.configuration.DefaultConfigurationSerializer


                modulesConf.addChild(moduleConf);
            }
           
            config.addChild(createConfig(ELEMENT_BREADCRUMB_PREFIX, getBreadcrumbPrefix()));
           
            DefaultConfigurationSerializer serializer = new DefaultConfigurationSerializer();
            serializer.setIndent(true);
            serializer.serializeToFile(getConfigurationFile(), config);

        } catch (final Exception e) {
            throw new RuntimeException("Problem with config file: " + configFile.getAbsolutePath(),
                    e);
        }
View Full Code Here


                result.setSaveConfig(config);
                try {
                    if (config.saveAsXml()) {
                        if (SaveService.isSaveTestLogFormat20()) {
                            if (serializer == null) {
                                serializer = new DefaultConfigurationSerializer();
                            }
                            out.write(OldSaveService.getSerializedSampleResult(result, serializer, config));
                        } else { // !LogFormat20
                            SaveService.saveSampleResult(event, out);
                        }
View Full Code Here

    }


    public static void saveSubTree(HashTree subTree, OutputStream writer) throws IOException {
        Configuration config = (Configuration) getConfigsFromTree(subTree).get(0);
        DefaultConfigurationSerializer saver = new DefaultConfigurationSerializer();

        saver.setIndent(true);
        try {
            saver.serialize(writer, config);
        } catch (SAXException e) {
            throw new IOException("SAX implementation problem");
        } catch (ConfigurationException e) {
            throw new IOException("Problem using Avalon Configuration tools");
        }
View Full Code Here

    public static void saveSubTree(HashTree subTree, OutputStream writer)
        throws IOException
    {
        Configuration config =
            (Configuration) getConfigsFromTree(subTree).get(0);
        DefaultConfigurationSerializer saver =
            new DefaultConfigurationSerializer();

        saver.setIndent(true);
        try
        {
            saver.serialize(writer, config);
        }
        catch (SAXException e)
        {
            throw new IOException("SAX implementation problem");
        }
View Full Code Here

            DefaultConfiguration templateConfig = new DefaultConfiguration("template");
            templateConfig.setAttribute("id", template.getId());
            templatesConfig.addChild(templateConfig);
            config.addChild(templatesConfig);
            OutputStream oStream = configSource.getOutputStream();
            new DefaultConfigurationSerializer().serialize(oStream, config);
            if (oStream != null) {
                oStream.flush();
                try {
                    oStream.close();
                } catch (Throwable t) {
View Full Code Here

    /**
     * Save the role
     * @throws AccessControlException if the save fails
     */
    public void save() throws AccessControlException {
        DefaultConfigurationSerializer serializer = new DefaultConfigurationSerializer();
        Configuration config = createConfiguration();
        File xmlPath = getConfigurationDirectory();
        File xmlfile = new File(xmlPath, getId() + FileRoleManager.SUFFIX);

        try {
            serializer.serializeToFile(xmlfile, config);
        } catch (Exception e) {
            throw new AccessControlException(e);
        }
    }
View Full Code Here

    /**
     * @see org.apache.lenya.ac.User#save()
     */
    public void save() throws AccessControlException {
        DefaultConfigurationSerializer serializer = new DefaultConfigurationSerializer();
        Configuration config = createConfiguration();

        try {
            serializer.serializeToFile(getFile(), config);
        } catch (Exception e) {
            throw new AccessControlException(e);
        }
    }
View Full Code Here

    /**
     * Save this group
     * @throws AccessControlException if the save failed
     */
    public void save() throws AccessControlException {
        DefaultConfigurationSerializer serializer = new DefaultConfigurationSerializer();
        Configuration config = createConfiguration();
        File xmlfile = getFile();

        try {
            serializer.serializeToFile(xmlfile, config);
        } catch (Exception e) {
            throw new AccessControlException(e);
        }
    }
View Full Code Here

    /**
     * @see org.apache.lenya.ac.impl.AbstractIPRange#save()
     */
    public void save() throws AccessControlException {
        DefaultConfigurationSerializer serializer = new DefaultConfigurationSerializer();
        Configuration config = createConfiguration();

        try {
            serializer.serializeToFile(getFile(), config);
        } catch (Exception e) {
            throw new AccessControlException(e);
        }
    }
View Full Code Here

     * No-arg constructor.
     */
    public ResultCollector()
    {
        current = -1;
        serializer = new DefaultConfigurationSerializer();
        setErrorLogging(false);
    }
View Full Code Here

TOP

Related Classes of org.apache.avalon.framework.configuration.DefaultConfigurationSerializer

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.