Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMElement.build()


                                            XMLStreamReader reader = XMLInputFactory.newInstance()
                                                    .createXMLStreamReader(
                                                            new ByteArrayInputStream((byte[]) newResource.getContent()));
                                            StAXOMBuilder builder = new StAXOMBuilder(reader);
                                            OMElement serviceElement = builder.getDocumentElement();
                                            serviceElement.build();
                                            OMFactory fac = OMAbstractFactory.getOMFactory();
                                            //adding required fields at the top of the xml which will help to easily read in service side
                                            Iterator it = serviceElement.getChildrenWithLocalName("newServicePath");
                                            if (it.hasNext()) {
                                                while (it.hasNext()) {
View Full Code Here


        OMElement resourceElem = null;
        Resource childResource = registry.get(resourcePath);
        try {
            resourceElem = new StAXOMBuilder(
                    childResource.getContentStream()).getDocumentElement();
            resourceElem.build();
            String fileNameProperty
                    = childResource.getProperty(ServiceBusConstants.DEFINITION_FILE_NAME);
            if (fileNameProperty != null) {
                resourceElem.addAttribute(ServiceBusConstants.DEFINITION_FILE_NAME,
                        fileNameProperty, resourceElem.getOMFactory().createOMNamespace("", ""));
View Full Code Here

            inputStream = new BufferedInputStream(new FileInputStream(new File(path)));
            XMLStreamReader parser = XMLInputFactory.newInstance().
                    createXMLStreamReader(inputStream);
            StAXOMBuilder builder = new StAXOMBuilder(parser);
            OMElement omElement = builder.getDocumentElement();
            omElement.build();
            return omElement;
        } catch (FileNotFoundException e) {
            throw new MessageBoxConfigurationException(MessageBoxConstants.MESSAGE_BOX_CONF
                                                       + "cannot be found in the path : " + path, e);
        } catch (XMLStreamException e) {
View Full Code Here

            inputStream = new BufferedInputStream(new FileInputStream(new File(path)));
            XMLStreamReader parser = XMLInputFactory.newInstance().
                    createXMLStreamReader(inputStream);
            StAXOMBuilder builder = new StAXOMBuilder(parser);
            OMElement omElement = builder.getDocumentElement();
            omElement.build();
            return omElement;
        } catch (FileNotFoundException e) {
            throw new EventBrokerConfigurationException(EventBrokerConstants.EB_CONF
                    + "cannot be found in the path : " + path, e);
        } catch (XMLStreamException e) {
View Full Code Here

            return null;
        }

        try {
            document = new StAXOMBuilder(is).getDocumentElement();
            document.build();
            is.close();
        } catch (XMLStreamException e) {
            handleException("Error while parsing the content of the file: " + file.getName(), e);
        } catch (IOException e) {
            log.warn("Error while closing the input stream from the file: " + file.getName(), e);
View Full Code Here

    private void createPriorityConfiguration(String fileName) throws AxisFault {
        OMElement definitions = null;
        try {
            FileInputStream fis = new FileInputStream(fileName);
            definitions = new StAXOMBuilder(fis).getDocumentElement();
            definitions.build();
        } catch (FileNotFoundException e) {
            handleException("Priority configuration file cannot be found : " + fileName, e);
        } catch (XMLStreamException e) {
            handleException("Error parsing priority configuration xml file " + fileName, e);
        }
View Full Code Here

        try {
            inStream = connection.getInputStream();
            StAXOMBuilder builder = new StAXOMBuilder(inStream);
            OMElement doc = builder.getDocumentElement();
            doc.build();
            return doc;
        } catch (Exception e) {
            if (log.isDebugEnabled()) {
                log.info("Content at URL : " + url + " is non XML..");
            }
View Full Code Here

            if (newServicePath != null && !newServicePath.contains(SYSTEM_GOVERNANCE_TRUNK)) {
                newServicePath = newServicePath.substring(0,newServicePath.lastIndexOf(RegistryConstants.PATH_SEPARATOR));
                newServicePath = newServicePath.substring(0,newServicePath.lastIndexOf(RegistryConstants.PATH_SEPARATOR));

                filledService.build();
                OMFactory fac = OMAbstractFactory.getOMFactory();
                Iterator it = filledService.getChildrenWithLocalName("newServicePath");
                if (it.hasNext()) {
                    while (it.hasNext()) {
                        OMElement next = (OMElement) it.next();
View Full Code Here

            inputStream = new BufferedInputStream(new FileInputStream(new File(path)));
            XMLStreamReader parser = XMLInputFactory.newInstance().
                    createXMLStreamReader(inputStream);
            StAXOMBuilder builder = new StAXOMBuilder(parser);
            OMElement omElement = builder.getDocumentElement();
            omElement.build();
            return omElement;
        } catch (FileNotFoundException e) {
            throw new BrokerConfigException(BrokerConstants.BROKER_CONF
                    + "cannot be found in the path : " + path, e);
        } catch (XMLStreamException e) {
View Full Code Here

    FileInputStream fis = null;
    boolean changed = false;
    try {
      fis = new FileInputStream(configFilePath);
      OMElement configElement = (new StAXOMBuilder(fis)).getDocumentElement();
      configElement.build();
      Iterator<OMElement> configElements = configElement.getChildrenWithName(
          new QName(DBSFields.CONFIG));
      int emptyConfigs = 0;
      while (configElements.hasNext()) {
        OMElement config = configElements.next();
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.