Examples of DomRepresentation


Examples of org.restlet.resource.DomRepresentation

        }
        if (!(isValid(representation))) {
            return Message.INVALID;
        }
        Message message = new Message();
        Node node = new DomRepresentation(representation)
                .getNode("/RDF/Response");
        Node firstChild = node.getFirstChild();
        while (firstChild.getNextSibling() != null) {
            String name = firstChild.getNodeName();
            String text = firstChild.getTextContent();
View Full Code Here

Examples of org.restlet.resource.DomRepresentation

     * @return <code>true</code> if the representation can be parsed as an
     *         instance of a {@link Message}
     */
    public boolean isValid(Representation representation) {
        try {
            DomRepresentation dom = new DomRepresentation(representation);
            return (dom.getDocument() != null)
                    && (dom.getNode("/RDF/Response") != null);
        } catch (Exception e) {
            return false;
        }
    }
View Full Code Here

Examples of org.restlet.resource.DomRepresentation

        if (!isValid(representation)) {
            throw new ParseException("invalid representation: "
                    + representation);
        }
        try {
            NodeSet nodes = new DomRepresentation(representation)
                    .getNodes("/RDF/URI");
            for (Node node : nodes) {
                bookmarks.add(getBookmark(node));
            }
        } catch (Exception e) {
View Full Code Here

Examples of org.restlet.resource.DomRepresentation

     *         {@link org.restlet.resource.Representation} is parseable as a
     *         list of zero or more {@link Bookmark}(s)
     */
    public boolean isValid(Representation representation) {
        return (representation != null)
                && (new DomRepresentation(representation).getNodes("/RDF/URI") != null);
    }
View Full Code Here

Examples of org.restlet.resource.DomRepresentation

            .newDocument();
        Element rootElement = ArtifactUsageSerializer.toXml(gav, doc);
        doc.appendChild(rootElement);
        // default is XML, so no need to wrap it in a Representation
        ArtifactUsageSerializer.toXml(artifactUsers, doc, rootElement);
        return new DomRepresentation(MediaType.APPLICATION_XML, doc);
      } catch (ParserConfigurationException e) {
        throw new ResourceException(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.