/** * Reads a resource into string form. * * @param resource The resource to read. * @return The string form of the resource. */ protected String readResource(String resource) throws IOException, EnunciateException { HashMap<String, Object> model = new HashMap<String, Object>(); model.put("sample_service_method", getModelInternal().findExampleWebMethod()); model.put("sample_resource", getModelInternal().findExampleResourceMethod()); URL res = GWTDeploymentModule.class.getResource(resource); ByteArrayOutputStream bytes = new ByteArrayOutputStream(); PrintStream out = new PrintStream(bytes); try { processTemplate(res, model, out); out.flush(); bytes.flush(); return bytes.toString("utf-8"); } catch (TemplateException e) { throw new EnunciateException(e); } }
if (!isFacetExcluded(ei)) { model.put("endpointInterface", ei); processTemplate(eiTemplate, model); if (knownGwtModule == null) { model.put("fault", webFault); processTemplate(faultTemplate, model); processTemplate(template, model); model.put("type", typeDefinition); URL template = typeDefinition.isEnum() ? overlayEnumTypeTemplate : overlayTypeTemplate; processTemplate(template, model); processTemplate(moduleXmlTemplate, model); if (!isFacetExcluded(ei)) { model.put("endpointInterface", ei); processTemplate(endpointImplTemplate, model); if (typeDefinition.isEnum()) { model.put("type", typeDefinition); processTemplate(enumTypeMapperTemplate, model); gwt2jaxbMappings.setProperty(classnameFor.convert(typeDefinition), typeDefinition.getQualifiedName()); if (!typeDefinition.isEnum()) { model.put("type", typeDefinition); processTemplate(typeMapperTemplate, model); gwt2jaxbMappings.setProperty(classnameFor.convert(typeDefinition), typeDefinition.getQualifiedName());
if (!isGWTTransient(ei)) { model.put("endpointInterface", ei); processTemplate(eiTemplate, model); if (!isGWTTransient(webFault)) { model.put("fault", webFault); processTemplate(faultTemplate, model); model.put("type", typeDefinition); URL template = typeDefinition.isEnum() ? enumTypeTemplate : typeTemplate; processTemplate(template, model); processTemplate(moduleXmlTemplate, model); if (!isGWTTransient(ei)) { model.put("endpointInterface", ei); processTemplate(endpointImplTemplate, model); if ((!typeDefinition.isEnum()) && (!isGWTTransient(typeDefinition))) { model.put("type", typeDefinition); processTemplate(typeMapperTemplate, model); if (!isGWTTransient(webFault)) { model.put("fault", webFault); processTemplate(faultMapperTemplate, model);