/** * Extract the id from a resource_type element and add to the resource map. Also extract the ids * from any contained method and its representation or fault elements. * * @param file the URI of the current WADL file being processed * @param r the resource_type 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 extractResourceTypeIds(ResourceType r, URI file) throws JAXBException, IOException { String id = processIDHref(file, r.getId(), null, r); if (id != null) ifaceMap.put(id, null); for (Method child : r.getMethod()) { extractMethodIds((Method) child, file); } }
/** * Build an abstract tree for a resource types in a WADL file * * @param ifaceId the identifier of the resource type * @param a the application element of the root WADL file */ protected void buildResourceTypes(String ifaceId, Application a) { try { URI file = new URI(ifaceId.substring(0, ifaceId.indexOf('#'))); ResourceType type = (ResourceType) idMap.get(ifaceId); ResourceTypeNode node = new ResourceTypeNode(type); for (Method m : type.getMethod()) { addMethodToResourceType(node, m, file); } ifaceMap.put(ifaceId, node); } catch (URISyntaxException ex) { ex.printStackTrace(); } }