Exemplo n.º 1
0
 /**
  * Add a representation to a method's input or output list. Follow references to representations
  * across WADL file boundaries
  *
  * @param list the list to add the representation to
  * @param representation the WADL representation element to process
  * @param file the URI of the current WADL file being processed
  */
 protected void addRepresentation(
     List<RepresentationNode> list, RepresentationType representation, URI file) {
   String href = representation.getHref();
   if (href != null && href.length() > 0) {
     // dereference resource
     if (!href.startsWith("#")) {
       // referecnce to element in another document
       file = getReferencedFile(file, href);
     }
     representation = dereferenceLocalHref(file, href, RepresentationType.class);
   }
   if (representation != null) {
     RepresentationNode n = new RepresentationNode(representation);
     list.add(n);
   }
 }
Exemplo n.º 2
0
 /**
  * Extract the id from a representation element and add to the representation map.
  *
  * @param file the URI of the current WADL file being processed
  * @param r the representation element
  * @throws javax.xml.bind.JAXBException if the WADL file is invalid or if the code generator
  *     encounters a problem.
  * @throws java.io.IOException if the specified WADL file cannot be read.
  */
 protected void extractRepresentationId(RepresentationType r, URI file)
     throws JAXBException, IOException {
   processIDHref(file, r.getId(), r.getHref(), r);
 }