Package org.xtext.httprouting.route

Examples of org.xtext.httprouting.route.RequestType


   * <!-- end-user-doc -->
   * @generated
   */
  public void setRequestType(RequestType newRequestType)
  {
    RequestType oldRequestType = requestType;
    requestType = newRequestType == null ? REQUEST_TYPE_EDEFAULT : newRequestType;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, RoutePackage.ROUTE__REQUEST_TYPE, oldRequestType, requestType));
  }
View Full Code Here


    return _builder.toString();
  }
 
  public String text(final Route route) {
    StringConcatenation _builder = new StringConcatenation();
    RequestType _requestType = route.getRequestType();
    String _name = _requestType.getName();
    _builder.append(_name, "");
    URL _url = route.getUrl();
    ICompositeNode _node = NodeModelUtils.getNode(_url);
    String _text = _node.getText();
    _builder.append(_text, "");
View Full Code Here

          }
        }
        Iterable<Route> _routes_1 = RouteJvmModelInferrer.this.routes(model);
        final Function1<Route, Boolean> _function_2 = new Function1<Route, Boolean>() {
          public Boolean apply(final Route it) {
            RequestType _requestType = it.getRequestType();
            return Boolean.valueOf(Objects.equal(_requestType, RequestType.GET));
          }
        };
        final Iterable<Route> getRoutes = IterableExtensions.<Route>filter(_routes_1, _function_2);
        boolean _isEmpty = IterableExtensions.isEmpty(getRoutes);
        boolean _not = (!_isEmpty);
        if (_not) {
          EList<JvmMember> _members_1 = it.getMembers();
          JvmOperation _requestHandlerMethod = RouteJvmModelInferrer.this.toRequestHandlerMethod(model, "doGet", getRoutes);
          RouteJvmModelInferrer.this._jvmTypesBuilder.<JvmOperation>operator_add(_members_1, _requestHandlerMethod);
        }
        Iterable<Route> _routes_2 = RouteJvmModelInferrer.this.routes(model);
        final Function1<Route, Boolean> _function_3 = new Function1<Route, Boolean>() {
          public Boolean apply(final Route it) {
            RequestType _requestType = it.getRequestType();
            return Boolean.valueOf(Objects.equal(_requestType, RequestType.POST));
          }
        };
        final Iterable<Route> postRoutes = IterableExtensions.<Route>filter(_routes_2, _function_3);
        boolean _isEmpty_1 = IterableExtensions.isEmpty(postRoutes);
        boolean _not_1 = (!_isEmpty_1);
        if (_not_1) {
          EList<JvmMember> _members_2 = it.getMembers();
          JvmOperation _requestHandlerMethod_1 = RouteJvmModelInferrer.this.toRequestHandlerMethod(model, "doPost", postRoutes);
          RouteJvmModelInferrer.this._jvmTypesBuilder.<JvmOperation>operator_add(_members_2, _requestHandlerMethod_1);
        }
        Iterable<Route> _routes_3 = RouteJvmModelInferrer.this.routes(model);
        final Function1<Route, Boolean> _function_4 = new Function1<Route, Boolean>() {
          public Boolean apply(final Route it) {
            RequestType _requestType = it.getRequestType();
            return Boolean.valueOf(Objects.equal(_requestType, RequestType.PUT));
          }
        };
        final Iterable<Route> putRoutes = IterableExtensions.<Route>filter(_routes_3, _function_4);
        boolean _isEmpty_2 = IterableExtensions.isEmpty(putRoutes);
        boolean _not_2 = (!_isEmpty_2);
        if (_not_2) {
          EList<JvmMember> _members_3 = it.getMembers();
          JvmOperation _requestHandlerMethod_2 = RouteJvmModelInferrer.this.toRequestHandlerMethod(model, "doPut", putRoutes);
          RouteJvmModelInferrer.this._jvmTypesBuilder.<JvmOperation>operator_add(_members_3, _requestHandlerMethod_2);
        }
        Iterable<Route> _routes_4 = RouteJvmModelInferrer.this.routes(model);
        final Function1<Route, Boolean> _function_5 = new Function1<Route, Boolean>() {
          public Boolean apply(final Route it) {
            RequestType _requestType = it.getRequestType();
            return Boolean.valueOf(Objects.equal(_requestType, RequestType.DELETE));
          }
        };
        final Iterable<Route> deleteRoutes = IterableExtensions.<Route>filter(_routes_4, _function_5);
        boolean _isEmpty_3 = IterableExtensions.isEmpty(deleteRoutes);
        boolean _not_3 = (!_isEmpty_3);
        if (_not_3) {
          EList<JvmMember> _members_4 = it.getMembers();
          JvmOperation _requestHandlerMethod_3 = RouteJvmModelInferrer.this.toRequestHandlerMethod(model, "doDelete", deleteRoutes);
          RouteJvmModelInferrer.this._jvmTypesBuilder.<JvmOperation>operator_add(_members_4, _requestHandlerMethod_3);
        }
        Iterable<Route> _routes_5 = RouteJvmModelInferrer.this.routes(model);
        final Function1<Route, Boolean> _function_6 = new Function1<Route, Boolean>() {
          public Boolean apply(final Route it) {
            RequestType _requestType = it.getRequestType();
            return Boolean.valueOf(Objects.equal(_requestType, RequestType.HEAD));
          }
        };
        final Iterable<Route> headRoutes = IterableExtensions.<Route>filter(_routes_5, _function_6);
        boolean _isEmpty_4 = IterableExtensions.isEmpty(headRoutes);
View Full Code Here

    };
    return this._jvmTypesBuilder.toMethod(model, name, _typeRef, _function);
  }
 
  protected String nameOfRouteMethod(final Route route) {
    RequestType _requestType = route.getRequestType();
    String _literal = _requestType.getLiteral();
    String _lowerCase = _literal.toLowerCase();
    String _firstUpper = StringExtensions.toFirstUpper(_lowerCase);
    String _plus = ("_do" + _firstUpper);
    int _index = this.index(route);
    return (_plus + Integer.valueOf(_index));
View Full Code Here

TOP

Related Classes of org.xtext.httprouting.route.RequestType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.