Examples of Validate


Examples of ca.uhn.fhir.rest.annotation.Validate

    Metadata conformance = theMethod.getAnnotation(Metadata.class);
    Create create = theMethod.getAnnotation(Create.class);
    Update update = theMethod.getAnnotation(Update.class);
    Delete delete = theMethod.getAnnotation(Delete.class);
    History history = theMethod.getAnnotation(History.class);
    Validate validate = theMethod.getAnnotation(Validate.class);
    GetTags getTags = theMethod.getAnnotation(GetTags.class);
    AddTags addTags = theMethod.getAnnotation(AddTags.class);
    DeleteTags deleteTags = theMethod.getAnnotation(DeleteTags.class);
    Transaction transaction = theMethod.getAnnotation(Transaction.class);
    // ** if you add another annotation above, also add it to the next line:
    if (!verifyMethodHasZeroOrOneOperationAnnotation(theMethod, read, search, conformance, create, update, delete, history, validate, getTags, addTags, deleteTags, transaction)) {
      return null;
    }

    Class<? extends IResource> returnType;

    Class<? extends IResource> returnTypeFromRp = null;
    if (theProvider instanceof IResourceProvider) {
      returnTypeFromRp = ((IResourceProvider) theProvider).getResourceType();
      if (!verifyIsValidResourceReturnType(returnTypeFromRp)) {
        throw new ConfigurationException("getResourceType() from " + IResourceProvider.class.getSimpleName() + " type " + theMethod.getDeclaringClass().getCanonicalName() + " returned "
            + toLogString(returnTypeFromRp) + " - Must return a resource type");
      }
    }

    Class<?> returnTypeFromMethod = theMethod.getReturnType();
    if (getTags != null) {
      if (!TagList.class.equals(returnTypeFromMethod)) {
        throw new ConfigurationException("Method '" + theMethod.getName() + "' from type " + theMethod.getDeclaringClass().getCanonicalName() + " is annotated with @"
            + GetTags.class.getSimpleName() + " but does not return type " + TagList.class.getName());
      }
    } else if (MethodOutcome.class.equals(returnTypeFromMethod)) {
      // returns a method outcome
    } else if (IBundleProvider.class.equals(returnTypeFromMethod)) {
      // returns a bundle provider
    } else if (Bundle.class.equals(returnTypeFromMethod)) {
      // returns a bundle
    } else if (void.class.equals(returnTypeFromMethod)) {
      // returns a bundle
    } else if (Collection.class.isAssignableFrom(returnTypeFromMethod)) {
      returnTypeFromMethod = ReflectionUtil.getGenericCollectionTypeOfMethodReturnType(theMethod);
      if (!verifyIsValidResourceReturnType(returnTypeFromMethod) && !IResource.class.equals(returnTypeFromMethod)) {
        throw new ConfigurationException("Method '" + theMethod.getName() + "' from " + IResourceProvider.class.getSimpleName() + " type " + theMethod.getDeclaringClass().getCanonicalName()
            + " returns a collection with generic type " + toLogString(returnTypeFromMethod)
            + " - Must return a resource type or a collection (List, Set) with a resource type parameter (e.g. List<Patient> )");
      }
    } else {
      if (!IResource.class.equals(returnTypeFromMethod) && !verifyIsValidResourceReturnType(returnTypeFromMethod)) {
        throw new ConfigurationException("Method '" + theMethod.getName() + "' from " + IResourceProvider.class.getSimpleName() + " type " + theMethod.getDeclaringClass().getCanonicalName()
            + " returns " + toLogString(returnTypeFromMethod) + " - Must return a resource type (eg Patient, " + Bundle.class.getSimpleName() + ", "
            + IBundleProvider.class.getSimpleName() + ", etc., see the documentation for more details)");
      }
    }

    Class<? extends IResource> returnTypeFromAnnotation = IResource.class;
    if (read != null) {
      returnTypeFromAnnotation = read.type();
    } else if (search != null) {
      returnTypeFromAnnotation = search.type();
    } else if (history != null) {
      returnTypeFromAnnotation = history.type();
    } else if (delete != null) {
      returnTypeFromAnnotation = delete.type();
    } else if (create != null) {
      returnTypeFromAnnotation = create.type();
    } else if (update != null) {
      returnTypeFromAnnotation = update.type();
    } else if (validate != null) {
      returnTypeFromAnnotation = validate.type();
    } else if (getTags != null) {
      returnTypeFromAnnotation = getTags.type();
    } else if (addTags != null) {
      returnTypeFromAnnotation = addTags.type();
    } else if (deleteTags != null) {
View Full Code Here

Examples of ca.uhn.fhir.rest.annotation.Validate

    Metadata conformance = theMethod.getAnnotation(Metadata.class);
    Create create = theMethod.getAnnotation(Create.class);
    Update update = theMethod.getAnnotation(Update.class);
    Delete delete = theMethod.getAnnotation(Delete.class);
    History history = theMethod.getAnnotation(History.class);
    Validate validate = theMethod.getAnnotation(Validate.class);
    GetTags getTags = theMethod.getAnnotation(GetTags.class);
    AddTags addTags = theMethod.getAnnotation(AddTags.class);
    DeleteTags deleteTags = theMethod.getAnnotation(DeleteTags.class);
    Transaction transaction = theMethod.getAnnotation(Transaction.class);
    // ** if you add another annotation above, also add it to the next line:
    if (!verifyMethodHasZeroOrOneOperationAnnotation(theMethod, read, search, conformance, create, update, delete, history, validate, getTags, addTags, deleteTags, transaction)) {
      return null;
    }

    Class<? extends IResource> returnType;

    Class<? extends IResource> returnTypeFromRp = null;
    if (theProvider instanceof IResourceProvider) {
      returnTypeFromRp = ((IResourceProvider) theProvider).getResourceType();
      if (!verifyIsValidResourceReturnType(returnTypeFromRp)) {
        throw new ConfigurationException("getResourceType() from " + IResourceProvider.class.getSimpleName() + " type " + theMethod.getDeclaringClass().getCanonicalName() + " returned " + toLogString(returnTypeFromRp) + " - Must return a resource type");
      }
    }

    Class<?> returnTypeFromMethod = theMethod.getReturnType();
    if (getTags != null) {
      if (!TagList.class.equals(returnTypeFromMethod)) {
        throw new ConfigurationException("Method '" + theMethod.getName() + "' from type " + theMethod.getDeclaringClass().getCanonicalName() + " is annotated with @" + GetTags.class.getSimpleName() + " but does not return type " + TagList.class.getName());
      }
    } else if (MethodOutcome.class.equals(returnTypeFromMethod)) {
      // returns a method outcome
    } else if (IBundleProvider.class.equals(returnTypeFromMethod)) {
      // returns a bundle provider
    } else if (Bundle.class.equals(returnTypeFromMethod)) {
      // returns a bundle
    } else if (void.class.equals(returnTypeFromMethod)) {
      // returns a bundle
    } else if (Collection.class.isAssignableFrom(returnTypeFromMethod)) {
      returnTypeFromMethod = ReflectionUtil.getGenericCollectionTypeOfMethodReturnType(theMethod);
      if (!verifyIsValidResourceReturnType(returnTypeFromMethod) && !IResource.class.equals(returnTypeFromMethod)) {
        throw new ConfigurationException("Method '" + theMethod.getName() + "' from " + IResourceProvider.class.getSimpleName() + " type " + theMethod.getDeclaringClass().getCanonicalName() + " returns a collection with generic type " + toLogString(returnTypeFromMethod)
            + " - Must return a resource type or a collection (List, Set) with a resource type parameter (e.g. List<Patient> or List<IResource> )");
      }
    } else {
      if (!IResource.class.equals(returnTypeFromMethod) && !verifyIsValidResourceReturnType(returnTypeFromMethod)) {
        throw new ConfigurationException("Method '" + theMethod.getName() + "' from " + IResourceProvider.class.getSimpleName() + " type " + theMethod.getDeclaringClass().getCanonicalName() + " returns " + toLogString(returnTypeFromMethod)
            + " - Must return a resource type (eg Patient, " + Bundle.class.getSimpleName() + ", " + IBundleProvider.class.getSimpleName() + ", etc., see the documentation for more details)");
      }
    }

    Class<? extends IResource> returnTypeFromAnnotation = IResource.class;
    if (read != null) {
      returnTypeFromAnnotation = read.type();
    } else if (search != null) {
      returnTypeFromAnnotation = search.type();
    } else if (history != null) {
      returnTypeFromAnnotation = history.type();
    } else if (delete != null) {
      returnTypeFromAnnotation = delete.type();
    } else if (create != null) {
      returnTypeFromAnnotation = create.type();
    } else if (update != null) {
      returnTypeFromAnnotation = update.type();
    } else if (validate != null) {
      returnTypeFromAnnotation = validate.type();
    } else if (getTags != null) {
      returnTypeFromAnnotation = getTags.type();
    } else if (addTags != null) {
      returnTypeFromAnnotation = addTags.type();
    } else if (deleteTags != null) {
View Full Code Here

Examples of ca.uhn.fhir.rest.annotation.Validate

    Metadata conformance = theMethod.getAnnotation(Metadata.class);
    Create create = theMethod.getAnnotation(Create.class);
    Update update = theMethod.getAnnotation(Update.class);
    Delete delete = theMethod.getAnnotation(Delete.class);
    History history = theMethod.getAnnotation(History.class);
    Validate validate = theMethod.getAnnotation(Validate.class);
    GetTags getTags = theMethod.getAnnotation(GetTags.class);
    AddTags addTags = theMethod.getAnnotation(AddTags.class);
    DeleteTags deleteTags = theMethod.getAnnotation(DeleteTags.class);
    // ** if you add another annotation above, also add it to the next line:
    if (!verifyMethodHasZeroOrOneOperationAnnotation(theMethod, read, search, conformance, create, update, delete, history, validate, getTags, addTags, deleteTags)) {
      return null;
    }

    Class<? extends IResource> returnType;

    Class<? extends IResource> returnTypeFromRp = null;
    if (theProvider instanceof IResourceProvider) {
      returnTypeFromRp = ((IResourceProvider) theProvider).getResourceType();
      if (!verifyIsValidResourceReturnType(returnTypeFromRp)) {
        throw new ConfigurationException("getResourceType() from " + IResourceProvider.class.getSimpleName() + " type " + theMethod.getDeclaringClass().getCanonicalName() + " returned " + toLogString(returnTypeFromRp) + " - Must return a resource type");
      }
    }

    Class<?> returnTypeFromMethod = theMethod.getReturnType();
    if (getTags != null) {
      if (!TagList.class.equals(returnTypeFromMethod)) {
        throw new ConfigurationException("Method '" + theMethod.getName() + "' from type " + theMethod.getDeclaringClass().getCanonicalName() + " is annotated with @" + GetTags.class.getSimpleName() + " but does not return type " + TagList.class.getName());
      }
    } else if (MethodOutcome.class.equals(returnTypeFromMethod)) {
      // returns a method outcome
    } else if (Bundle.class.equals(returnTypeFromMethod)) {
      // returns a bundle
    } else if (void.class.equals(returnTypeFromMethod)) {
      // returns a bundle
    } else if (Collection.class.isAssignableFrom(returnTypeFromMethod)) {
      returnTypeFromMethod = ReflectionUtil.getGenericCollectionTypeOfMethodReturnType(theMethod);
      if (!verifyIsValidResourceReturnType(returnTypeFromMethod) && !IResource.class.equals(returnTypeFromMethod)) {
        throw new ConfigurationException("Method '" + theMethod.getName() + "' from " + IResourceProvider.class.getSimpleName() + " type " + theMethod.getDeclaringClass().getCanonicalName() + " returns a collection with generic type " + toLogString(returnTypeFromMethod)
            + " - Must return a resource type or a collection (List, Set) with a resource type parameter (e.g. List<Patient> )");
      }
    } else {
      if (!IResource.class.equals(returnTypeFromMethod) && !verifyIsValidResourceReturnType(returnTypeFromMethod)) {
        throw new ConfigurationException("Method '" + theMethod.getName() + "' from " + IResourceProvider.class.getSimpleName() + " type " + theMethod.getDeclaringClass().getCanonicalName() + " returns " + toLogString(returnTypeFromMethod)
            + " - Must return a resource type");
      }
    }

    Class<? extends IResource> returnTypeFromAnnotation = IResource.class;
    if (read != null) {
      returnTypeFromAnnotation = read.type();
    } else if (search != null) {
      returnTypeFromAnnotation = search.type();
    } else if (history != null) {
      returnTypeFromAnnotation = history.type();
    } else if (delete != null) {
      returnTypeFromAnnotation = delete.type();
    } else if (create != null) {
      returnTypeFromAnnotation = create.type();
    } else if (update != null) {
      returnTypeFromAnnotation = update.type();
    } else if (validate != null) {
      returnTypeFromAnnotation = validate.type();
    } else if (getTags != null) {
      returnTypeFromAnnotation = getTags.type();
    } else if (addTags != null) {
      returnTypeFromAnnotation = addTags.type();
    } else if (deleteTags != null) {
View Full Code Here

Examples of ch.ethz.inf.vs.californium.plugtests.resources.Validate

        add(new MultiFormat());
        add(new Link1());
        add(new Link2());
        add(new Link3());
        add(new Path());
        add(new Validate());
        add(new Create());
        add(new Shutdown());
    }
View Full Code Here

Examples of com.sk89q.intake.parametric.annotation.Validate

            return;
        }
       
        for (Annotation modifier : modifiers) {
            if (modifier instanceof Validate) {
                Validate validate = (Validate) modifier;
               
                if (!validate.regex().isEmpty()) {
                    if (!string.matches(validate.regex())) {
                        throw new ParameterException(
                                String.format(
                                        "The given text doesn't match the right " +
                                        "format (technically speaking, the 'format' is %s)",
                                        validate.regex()));
                    }
                }
            }
        }
    }
View Full Code Here

Examples of esell.Validate

     * my validation protocol
     *
     * @param args syntax : -name "full name" -license &lt;serialnumber&gt;
     */
    private boolean validate(String... args) {
        Validate jni_validateEsell = new Validate();
        /**
         * first the passed arguments issued from the user are parsed...
         */
        for (int i = 0; i < args.length; i++) {
            String arg = args[i];
            if ("-name".equals(arg)) {
                serialName = args[++i] != null ? args[i].replaceAll("\"", "") : "";
            } else if ("-license".equals(arg)) {
                serial = args[++i] != null ? args[i].replaceAll("\"", "") : "";;
            }
        }
        /**
         * ... so that the validation runtime is called with correct parameters.
         * It will return a date in the format that we can read. It matches the
         * purchased day or the day when the trial use will terminate.
         */
        Calendar ret = jni_validateEsell.runValidateSerial(serial, serialName, "", jni_validateEsell.getPublisherKey());
        if (ret != null) {
            String trial = (ProductKeyValidator.isDemoMode() ? "trial until " : "licensed use. Purchased on ") + ret;
            JXAenvUtils.log("provided serial " + jni_validateEsell.standardizeSerial(serial) + " for " + serialName + " is validated for " + trial, JXAenvUtils.LVL.SYS_NOT);
            expiringDate.setTime(ret.getTime());
            return true;
        }
        return false;
    }
View Full Code Here

Examples of eu.planets_project.services.validate.Validate

   * Depending on the setting, the IllegalArgumentException might be wrapped
   * in a SOAPFaultExcpetion, so we expect an Exception
   */
  public void clientTests()
  {
    Validate tiffCheck = ServiceCreator.createTestService(
      Validate.QNAME, TiffValidation.class,
      "/pserv-pc-libtiff/TiffValidation?wsdl", Mode.SERVER);
    test(tiffCheck);
  }
View Full Code Here

Examples of org.apache.cloudstack.api.Validate

            if ((parameterAnnotation == null) || !parameterAnnotation.expose()) {
                continue;
            }

            //TODO: Annotate @Validate on API Cmd classes, FIXME how to process Validate
            Validate validateAnnotation = field.getAnnotation(Validate.class);
            Object paramObj = unpackedParams.get(parameterAnnotation.name());
            if (paramObj == null) {
                if (parameterAnnotation.required()) {
                    throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Unable to execute API command " + cmd.getCommandName().substring(0, cmd.getCommandName().length() - 8) + " due to missing parameter "
                            + parameterAnnotation.name());
View Full Code Here

Examples of org.apache.tapestry.beaneditor.Validate

    @Test
    public void single_constraint()
    {
        PropertyConduit conduit = mockPropertyConduit();
        Validate validate = newValidate("required");

        train_getAnnotation(conduit, Validate.class, validate);

        replay();
View Full Code Here

Examples of org.apache.tapestry.beaneditor.Validate

    @Test
    public void multiple_constraints()
    {
        PropertyConduit conduit = mockPropertyConduit();
        Validate validate = newValidate("required,minlength=3");

        train_getAnnotation(conduit, Validate.class, validate);

        replay();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.