private static boolean checkMethodType(final TypedMessage message, final MethodTypeSelector methodType) { final HTTPMethods op = ContextMatcher.getMethod(message).getHttpMethod(); boolean _or = false; boolean _equals = Objects.equal(methodType, null);
protected CharSequence generateHttpMethodAnnotation(final Method method) { StringConcatenation _builder = new StringConcatenation(); _builder.append("@"); String _typeName = this.getTypeName(this.httpMethods.get(method.getHttpMethod())); _builder.append(_typeName); return _builder; }
protected void createDefaultRequest(Method method) { TypedRequest result = RapidmlFactory.eINSTANCE.createTypedRequest(); switch (method.getHttpMethod()) { case PUT: case POST: case PATCH: case DELETE: ResourceDefinition containingResource = (ResourceDefinition) method.eContainer(); result.setResourceType(containingResource); break; default: // do nothing; } method.setRequest(result); }
protected void createDefaultResponse(Method method) { TypedResponse result = RapidmlFactory.eINSTANCE.createTypedResponse(); result.setStatusCode(200); switch (method.getHttpMethod()) { case GET: case POST: case PATCH: case DELETE: ResourceDefinition containingResource = (ResourceDefinition) method.eContainer(); result.setResourceType(containingResource); break; default: // do nothing; } method.getResponses().add(result); }
/** * @deprecated use {@link CommonServices#getRequestTypeName(TypedRequest)} or * {@link CommonServices#getResponseTypeName(TypedResponse)} instead * @param message typed message * @return generated type name for XSD generator that avoid name clashes */ @Deprecated public static String getMessageTypeName(TypedMessage message) { Method method = (Method) message.eContainer(); String methodName = method.getHttpMethod().getName().toLowerCase() + method.getContainingResourceDefinition().getName(); final Structure type = message.getActualType(); ImmutableList<TypedMessage> list = ImmutableList.copyOf(Iterators.filter( Iterators.filter(method.getContainingResourceDefinition().eAllContents(), TypedMessage.class), new Predicate<TypedMessage>() { @Override public boolean apply(TypedMessage input) { return input.getActualType() == type; } })); String baseName = Strings.toFirstUpper(methodName) + '_' + message.getActualType().getName(); if (list.size() > 1) { return baseName + '_' + (list.indexOf(message) + 1); } return baseName; }
HTTPMethods _httpMethod = method.getHttpMethod(); if (_httpMethod != null) { switch (_httpMethod) {
param.setRequired(true); String _name = method.getHttpMethod().getName(); if (_name != null) { switch (_name) {
_builder.newLineIfNotEmpty(); _builder.append("<span class=\"label label-primary resource-method\">"); HTTPMethods _httpMethod = method.getHttpMethod(); _builder.append(_httpMethod); _builder.append("</span>");
_builder.append("\t\t"); _builder.append("app."); String _lowerCase = method.getHttpMethod().getLiteral().toLowerCase(); _builder.append(_lowerCase, "\t\t"); _builder.append("(`${app.locals.basePath}");
_builder.append(" "); _builder.append("\"type\": \""); HTTPMethods _httpMethod = method.getHttpMethod(); _builder.append(_httpMethod, " "); _builder.append("\",");
HTTPMethods _httpMethod = method.getHttpMethod(); _builder.append(_httpMethod, "\t"); _builder.append(" ");
protected CharSequence generateMethod(final Method method, final ServiceDataResource containingDataResource) { StringConcatenation _builder = new StringConcatenation(); _builder.append("<method name=\""); HTTPMethods _httpMethod = method.getHttpMethod(); _builder.append(_httpMethod); _builder.append("\" id=\"");