Package org.restlet.resource

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


     *         {@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

            .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

Related Classes of org.restlet.resource.DomRepresentation

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.