private void adjustReturnedAndBodyType(IMethodModel method_, boolean hasGlobalConsumes) {

    if (!(method_ instanceof MethodModel)) {
      return;
    }
    MethodModel method = (MethodModel) method_;

    ITypeModel returnedType = method.getReturnedType();
    if (returnedType != null) {
      if (returnedType instanceof ProxyType) {
        ITypeModel rt = registry.getType(returnedType.getFullyQualifiedName());
        method.setReturnedType(rt);
      }
    }

    boolean hasConsumes = hasGlobalConsumes;

    IAnnotationModel apiOperation = method.getAnnotation(API_OPERATION);
    if (apiOperation != null) {
      IAnnotationModel[] subAnn = apiOperation.getSubAnnotations(JAVAX_CONSUMES.toLowerCase());
      if (subAnn != null) {
        hasConsumes = true;
      }
    }

    IAnnotationModel consumes = method.getAnnotation(JAVAX_CONSUMES);
    if (consumes != null) {
      hasConsumes = true;
    }
    if (!hasConsumes) {
      return;
    }

    IParameterModel[] parameters = method.getParameters();
    for (IParameterModel param_ : parameters) {

      String paramType = param_.getParameterType();
      //			if(paramType.startsWith("java.")){
      //				continue;
      //			}
      if (isPrimitive(paramType)) {
        continue;
      }
      if (param_.hasAnnotation("QueryParam")) {
        continue;
      }
      if (param_.hasAnnotation("HeaderParam")) {
        continue;
      }
      if (param_.hasAnnotation("PathParam")) {
        continue;
      }
      if (param_.hasAnnotation("FormParam")) {
        continue;
      }
      if (param_.hasAnnotation("Context")) {
        continue;
      }

      ITypeModel type = registry.getType(paramType);
      if (type == null) {
        continue;
      }
      //			IAnnotationModel typeAnnotation = type.getAnnotation(JAVAX_XML_TYPE);
      //			if(typeAnnotation==null){
      //				continue;
      //			}
      method.setBodyType(type);
      if (registry.isTargetType(paramType)) {
        break;
      }
    }
  }