public void process(ResourceDefinition resource) { // add resourceAPI level authentication schemes if resource authentication schemes are absent if (resource.getSecuredBy().isEmpty()) { ResourceAPI resourceAPI = (ResourceAPI) resource.eContainer(); if (resourceAPI != null) { resource.getSecuredBy().addAll(resourceAPI.getSecuredBy()); } } for (Method method : resource.getMethods()) { // add resource level authentication schemes if method authentication schemes are absent if (method.getSecuredBy().isEmpty()) { if (resource != null) { method.getSecuredBy().addAll(resource.getSecuredBy()); } } } } }
public void generateAutoRealizations() { for (ResourceDefinition resource : resourceAPI.getOwnedResourceDefinitions()) { processResource(resource); for (Method method : resource.getMethods()) { processMessage(method.getRequest()); for (TypedMessage message : method.getResponses()) { processMessage(message); } } } }
EList<Method> _methods = resource.getMethods(); for (final Method method : _methods) {
public void normalize(ZenModel model) { if (TagUtils.getTagWithName(model, TagUtils.NORMALIZED).isPresent()) { return; } new InheritedPropertiesProcessor().addInheritedProperties(model); for (ResourceAPI resourceAPI : model.getResourceAPIs()) { for (ResourceDefinition resource : resourceAPI.getOwnedResourceDefinitions()) { new SecuredByProcessor().process(resource); for (Method method : resource.getMethods()) { processMethod(method); } } } DocumentationSpaceProcessor documentationSpaceProcessor = new DocumentationSpaceProcessor(); for (Documentation doc : EcoreUtil2.getAllContentsOfType(model, Documentation.class)) { documentationSpaceProcessor.process(doc); } try { generateAutoRealizations(model); } catch (Exception e) { e.printStackTrace(); } TagUtils.addTag(model, TagUtils.NORMALIZED); }
private CharSequence generateResourceType(final ResourceDefinition resourceDef) { StringConcatenation _builder = new StringConcatenation(); _builder.append("<resource_type id=\""); String _idInTrace = this.traceHelper.getIdInTrace(resourceDef); _builder.append(_idInTrace); _builder.append("Type\">"); _builder.newLineIfNotEmpty(); CharSequence _generateParameters = this.generateParameters(resourceDef); _builder.append(_generateParameters); _builder.newLineIfNotEmpty(); { EList<Method> _methods = resourceDef.getMethods(); for(final Method method : _methods) { CharSequence _generateMethod = this.generateMethod(method, ((ServiceDataResource) resourceDef)); _builder.append(_generateMethod); _builder.newLineIfNotEmpty(); } } _builder.append("</resource_type>"); _builder.newLine(); return _builder; }
@Override public CharSequence generateResource(final ResourceDefinition resourceDef) { StringConcatenation _builder = new StringConcatenation(); _builder.append("<resource id=\""); String _name = resourceDef.getName(); _builder.append(_name); _builder.append("\" path=\""); URI _uRI = resourceDef.getURI(); _builder.append(_uRI); _builder.append("\">"); _builder.newLineIfNotEmpty(); CharSequence _generateParameters = this.generateParameters(resourceDef); _builder.append(_generateParameters); _builder.newLineIfNotEmpty(); { EList<Method> _methods = resourceDef.getMethods(); for(final Method method : _methods) { CharSequence _generateMethod = this.generateMethod(method, ((ServiceDataResource) resourceDef)); _builder.append(_generateMethod); _builder.newLineIfNotEmpty(); } } _builder.append("</resource>"); _builder.newLine(); return _builder; } }
this.createSwaggerOperation(path, it); }; res.getMethods().forEach(_function_1); return path;
_builder.newLineIfNotEmpty(); EList<Method> _methods = resource.getMethods(); for(final Method method : _methods) { _builder.append(" ");
_builder.newLineIfNotEmpty(); EList<Method> _methods = resource.getMethods(); for(final Method method : _methods) { _builder.append(" "); EList<Method> _methods_1 = resource.getMethods(); for(final Method method_1 : _methods_1) { _builder.append(" ");
_builder.newLine(); EList<Method> _methods = resource.getMethods(); for(final Method method : _methods) { _builder.append(" ");