Package org.cruxframework.crux.core.shared.rest.annotation

Examples of org.cruxframework.crux.core.shared.rest.annotation.StateValidationModel


  protected RestMethodInfo getRestMethodInfo(JMethod method) throws InvalidRestMethod
    {
      Method implementationMethod = getImplementationMethod(method);
      Annotation[][] parameterAnnotations = implementationMethod.getParameterAnnotations();
    String methodURI = getRestURI(method, parameterAnnotations, implementationMethod.getAnnotation(Path.class));
      StateValidationModel validationModel = HttpMethodHelper.getStateValidationModel(implementationMethod);
      String httpMethod = HttpMethodHelper.getHttpMethod(implementationMethod.getAnnotations(), false);
      boolean isReadMethod = implementationMethod.getAnnotation(GET.class) != null;
      RestMethodInfo methodInfo = new RestMethodInfo(method, parameterAnnotations, methodURI, httpMethod, validationModel, isReadMethod);
      return methodInfo;
    }
View Full Code Here


      parameterAnnotations[i] = parameters[i].getAnnotations();
        }
   
      String methodURI = getRestURI(method, parameterAnnotations, method.getAnnotation(Path.class));
      String httpMethod = HttpMethodHelper.getHttpMethod(method.getAnnotations(), false);
      StateValidationModel validationModel = getStateValidationModel(method);
      boolean isReadMethod = method.getAnnotation(GET.class) != null;
      if (isReadMethod)
      {
        readMethods.add(methodURI);
      }
      else if (validationModel != null && !validationModel.equals(StateValidationModel.NO_VALIDATE))
      {
        updateMethods.add(methodURI);
      }
     
      RestMethodInfo methodInfo = new RestMethodInfo(method, parameterAnnotations, methodURI, httpMethod, validationModel, isReadMethod);
View Full Code Here

          List<RestMethodRegistrationInfo> methods = entry.getValue();
      if (methods.size() > 0)
          {
        for (RestMethodRegistrationInfo methodInfo : methods)
                {
          StateValidationModel stateValidationModel = HttpMethodHelper.getStateValidationModel(methodInfo.invoker.getMethod());
          if (stateValidationModel != null && !stateValidationModel.equals(StateValidationModel.NO_VALIDATE))
          {
            if (!ensureReaderMethod(methods))
            {
              logger.error(" Method: " + methodInfo.invoker.getResourceClass().getName() + "." + methodInfo.invoker.getMethod().getName() + "() " +
                  "uses a stateValidationModel. It requires a valid GET method to provides the resource for validation.");
View Full Code Here

TOP

Related Classes of org.cruxframework.crux.core.shared.rest.annotation.StateValidationModel

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.