Examples of parseDocument()


Examples of org.jboss.staxmapper.XMLMapper.parseDocument()

        final XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(xml));
        final StandaloneXml parser = new StandaloneXml(null, null, null);
        final List<ModelNode> operationList = new ArrayList<ModelNode>();
        final XMLMapper mapper = XMLMapper.Factory.create();
        mapper.registerRootElement(new QName(namespace, "server"), parser);
        mapper.parseDocument(operationList, reader);
        final ModelNode content = operationList.get(1).get("content");
        assertEquals(false, content.get(0).get("archive").asBoolean());
        assertEquals("deployments/test.jar", content.get(0).get("path").asString());
        assertEquals("jboss.server.base.dir", content.get(0).get("relative-to").asString());
    }
View Full Code Here

Examples of org.jboss.staxmapper.XMLMapper.parseDocument()

        URL configURL = getClass().getResource(name);
        Assert.assertNotNull(name + " url is not null", configURL);
        System.out.println("configURL = " + configURL);

        BufferedReader reader = new BufferedReader(new InputStreamReader(configURL.openStream()));
        mapper.parseDocument(operations, XMLInputFactory.newInstance().createXMLStreamReader(reader));

        return operations;
    }

}
View Full Code Here

Examples of org.jboss.staxmapper.XMLMapper.parseDocument()

            });

            FileInputStream is = new FileInputStream(f);
            input = new BufferedInputStream(is);
            XMLStreamReader streamReader = XMLInputFactory.newInstance().createXMLStreamReader(input);
            mapper.parseDocument(config, streamReader);
            streamReader.close();
        } catch(Throwable t) {
            throw new CliInitializationException("Failed to parse " + f.getAbsolutePath(), t);
        } finally {
            StreamUtils.safeClose(input);
View Full Code Here

Examples of org.jboss.staxmapper.XMLMapper.parseDocument()

        try {
            final FileInputStream fis = new FileInputStream(fileName);
            try {
                BufferedInputStream input = new BufferedInputStream(fis);
                XMLStreamReader streamReader = XMLInputFactory.newInstance().createXMLStreamReader(input);
                mapper.parseDocument(updates, streamReader);
                streamReader.close();
                input.close();
                fis.close();
            } finally {
                safeClose(fis);
View Full Code Here

Examples of org.jboss.staxmapper.XMLMapper.parseDocument()

            });

            FileInputStream is = new FileInputStream(f);
            input = new BufferedInputStream(is);
            XMLStreamReader streamReader = XMLInputFactory.newInstance().createXMLStreamReader(input);
            mapper.parseDocument(config, streamReader);
            streamReader.close();
        } catch(Throwable t) {
            throw new CliInitializationException("Failed to parse " + f.getAbsolutePath(), t);
        } finally {
            StreamUtils.safeClose(input);
View Full Code Here

Examples of org.jboss.staxmapper.XMLMapper.parseDocument()

      ConfigurationBuilderHolder holder = new ConfigurationBuilderHolder(cl);
      for (int i = 0; i < xmls.length; ++i) {
         BufferedInputStream input = new BufferedInputStream(
               new ByteArrayInputStream(xmls[i].getBytes()));
         XMLStreamReader streamReader = XMLInputFactory.newInstance().createXMLStreamReader(input);
         xmlMapper.parseDocument(holder, streamReader);
      }

      return holder;
   }
}
View Full Code Here

Examples of org.jboss.staxmapper.XMLMapper.parseDocument()

        XMLMapper mapper = XMLMapper.Factory.create();
        mapper.registerRootElement(new QName(Namespace.CURRENT.getUri(), "subsystem"), Namespace.CURRENT.getXMLReader());

        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new FileInputStream(file));
        mapper.parseDocument(operations, reader);

        final ModelNode ret = operations.get(0);
        /* To Debug...
        PrintWriter writer = new PrintWriter("/tmp/jfclere.txt");
        ret.writeString(writer, false);
View Full Code Here

Examples of org.jboss.staxmapper.XMLMapper.parseDocument()

        StringReader strReader = new StringReader(xml);

        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StreamSource(strReader));
        List<ModelNode> newList = new ArrayList<ModelNode>();
        mapper.parseDocument(newList, reader);

        return newList;
    }

    public static ModelNode operationListToCompositeOperation(List<ModelNode> operations) {
View Full Code Here

Examples of org.jboss.staxmapper.XMLMapper.parseDocument()

        }
        final List<AbstractServerModelUpdate<?>> updates = new ArrayList<AbstractServerModelUpdate<?>>();
        try {
            final XMLMapper mapper = XMLMapper.Factory.create();
            extensionRegistrar.registerStandardStandaloneReaders(mapper);
            mapper.parseDocument(updates, XMLInputFactory.newInstance().createXMLStreamReader(new BufferedInputStream(new FileInputStream(standalone))));
        } catch (Exception e) {
            throw new ServerStartException("Caught exception during processing of standalone.xml", e);
        }

        final ServerStartTask startTask = new ServerStartTask(0, serviceActivators, updates, environment);
View Full Code Here

Examples of org.jboss.staxmapper.XMLMapper.parseDocument()

                    setIfSupported(inputFactory, XMLInputFactory.IS_VALIDATING, Boolean.FALSE);
                    setIfSupported(inputFactory, XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
                    final XMLStreamReader streamReader = inputFactory.createXMLStreamReader(xmlStream);
                    final ParseResult result = new ParseResult();
                    try {
                        mapper.parseDocument(result, streamReader);
                        deploymentUnit.addToAttachmentList(MessagingAttachments.PARSE_RESULT, result);
                    } finally {
                        safeClose(streamReader, f.getAbsolutePath());
                    }
                } catch (XMLStreamException e) {
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.