Package org.jdom2.input

Examples of org.jdom2.input.StAXStreamBuilder.build()


    protected Element resolveRequestPayloadArgument(MethodParameter parameter, Source requestPayload) throws Exception {
        if (requestPayload instanceof DOMSource) {
            Node node = ((DOMSource) requestPayload).getNode();
            DOMBuilder domBuilder = new DOMBuilder();
            if (node.getNodeType() == Node.ELEMENT_NODE) {
                return domBuilder.build((org.w3c.dom.Element) node);
            }
            else if (node.getNodeType() == Node.DOCUMENT_NODE) {
                Document document = domBuilder.build((org.w3c.dom.Document) node);
                return document.getRootElement();
            }
View Full Code Here


            DOMBuilder domBuilder = new DOMBuilder();
            if (node.getNodeType() == Node.ELEMENT_NODE) {
                return domBuilder.build((org.w3c.dom.Element) node);
            }
            else if (node.getNodeType() == Node.DOCUMENT_NODE) {
                Document document = domBuilder.build((org.w3c.dom.Document) node);
                return document.getRootElement();
            }
        }
        // we have no other option than to transform
        JDOMResult jdomResult = new JDOMResult();
View Full Code Here

        }
        if (!alwaysTransform && source instanceof DOMSource) {
            Node node = ((DOMSource) source).getNode();
            DOMBuilder domBuilder = new DOMBuilder();
            if (node.getNodeType() == Node.ELEMENT_NODE) {
                return domBuilder.build((org.w3c.dom.Element) node);
            }
            else if (node.getNodeType() == Node.DOCUMENT_NODE) {
                Document document = domBuilder.build((org.w3c.dom.Document) node);
                return document.getRootElement();
            }
View Full Code Here

            DOMBuilder domBuilder = new DOMBuilder();
            if (node.getNodeType() == Node.ELEMENT_NODE) {
                return domBuilder.build((org.w3c.dom.Element) node);
            }
            else if (node.getNodeType() == Node.DOCUMENT_NODE) {
                Document document = domBuilder.build((org.w3c.dom.Document) node);
                return document.getRootElement();
            }
        }
        // we have no other option than to transform
        JDOMResult jdomResult = new JDOMResult();
View Full Code Here

   *
   */
  public WireFeed build(org.w3c.dom.Document document) throws IllegalArgumentException, FeedException {
    DOMBuilder domBuilder = new DOMBuilder();
    try {
      Document jdomDoc = domBuilder.build(document);
      return build(jdomDoc);
    } catch (IllegalArgumentException ex) {
      throw ex;
    } catch (Exception ex) {
      throw new ParsingFeedException("Invalid XML", ex);
View Full Code Here

     *
     */
    public WireFeed build(org.w3c.dom.Document document) throws IllegalArgumentException,FeedException {
        DOMBuilder domBuilder = new DOMBuilder();       
        try {
            Document jdomDoc = domBuilder.build(document);
            return build(jdomDoc);
        }
        catch (IllegalArgumentException ex) {
            throw ex;
        }
View Full Code Here

     *
     */
    public WireFeed build(final org.w3c.dom.Document document) throws IllegalArgumentException, FeedException {
        final DOMBuilder domBuilder = new DOMBuilder();
        try {
            final Document jdomDoc = domBuilder.build(document);
            return this.build(jdomDoc);
        } catch (final IllegalArgumentException ex) {
            throw ex;
        } catch (final Exception ex) {
            throw new ParsingFeedException("Invalid XML", ex);
View Full Code Here

            return revisionTimestamp;
        }

        public ParsePage invoke() throws JDOMException, IOException {
            SAXBuilder builder = new SAXBuilder();
            Document doc = builder.build(new ByteArrayInputStream(pageString.getBytes()));
            pageTitle = textToString(titleXPath.evaluateFirst(doc));
            wikitext = textToString(textXPath.evaluate(doc));
            sourceUrl = "http://en.wikipedia.org/wiki/" + pageTitle;
            String revisionTimestampString = textToString(revisionTimestampXPath.evaluateFirst(doc));
            revisionTimestamp = null;
View Full Code Here

            }
        } else if(variable.contentEquals("LastChange")){
          
            SAXBuilder sxb = new SAXBuilder();
            try {
                Document document = sxb.build(new InputSource(new StringReader(value)));
                Element root = document.getRootElement();
                List<Element> children = root.getChildren();
                Iterator<Element> iterator = children.iterator();
                while (iterator.hasNext()) { //for each instanceID
                    Element current = iterator.next();
View Full Code Here

    @Override
    public HierarchicalStreamReader createReader(final Reader reader) {
        try {
            final SAXBuilder builder = new SAXBuilder();
            final Document document = builder.build(reader);
            return new JDom2Reader(document, getNameCoder());
        } catch (final IOException e) {
            throw new StreamException(e);
        } catch (final JDOMException e) {
            throw new StreamException(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.