Package org.apache.commons.xmlio.in

Examples of org.apache.commons.xmlio.in.SimpleImporter


    public static void install(String id, InputStream inputStream) {
        logger.log(Level.FINE, "Installing messages '"+id+"'");
        try {
            Map applicationMessages = new HashMap();
            SimpleImporter importer = new SimpleImporter();
            importer.setIncludeLeadingCDataIntoStartElementCallback(true);
            ConfigurationHandler handler = new ConfigurationHandler();
            importer.addSimpleImportHandler(handler);
            importer.parse(new InputSource(inputStream));
            Map parsedMessages = handler.getMessages();
            applicationMessages.putAll(parsedMessages);
            messages.putAll(applicationMessages);
            installedMessages.put(id, applicationMessages.keySet());
        } catch (Exception exception) {
View Full Code Here


        }

        public List getEvents() {
            List events = new ArrayList();
            try {
                SimpleImporter importer = new SimpleImporter();
                importer.setIncludeLeadingCDataIntoStartElementCallback(true);
                ResponseHandler handler = new ResponseHandler(events);
                importer.addSimpleImportHandler(handler);
                importer.parse(new InputSource(getResponseBodyAsStream()));
                return handler.getEvents();
            } catch (Throwable exception) {
                logger.log(Level.SEVERE, "Exception while polling for new events: ", exception);
            }
            return events;
View Full Code Here

TOP

Related Classes of org.apache.commons.xmlio.in.SimpleImporter

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.