Package javax.validation

Examples of javax.validation.Constraint


        AccessStrategy access, AppendValidation validations) throws InvocationTargetException, IllegalAccessException {

        if (annotation instanceof Valid || annotation instanceof Validate) {
            desc.setCascaded(true);
        } else {
            Constraint vcAnno = annotation.annotationType().getAnnotation(Constraint.class);
            if (vcAnno != null) {
                Class<? extends ConstraintValidator<A, ?>>[] validatorClasses;
                validatorClasses = findConstraintValidatorClasses(annotation, vcAnno);
                applyConstraint(annotation, validatorClasses, null, ClassUtils.primitiveToWrapper((Class<?>) access
                    .getJavaType()), access, validations);
View Full Code Here


        /**
         * An annotation is considered a constraint definition if its retention
         * policy contains RUNTIME and if the annotation itself is annotated
         * with javax.validation.Constraint.
         */
        Constraint vcAnno = annotation.annotationType().getAnnotation(Constraint.class);
        if (vcAnno != null) {
            ConstraintDefinitionValidator.validateConstraintDefinition(annotation);
            Class<? extends ConstraintValidator<A, ?>>[] validatorClasses;
            validatorClasses = findConstraintValidatorClasses(annotation, vcAnno);
            return applyConstraint(annotation, validatorClasses, prop, owner, access, appender);
View Full Code Here

   * @param annotationType The annotation type to test.
   *
   * @return <code>true</code> if the annotation fulfills the above condtions, <code>false</code> otherwise.
   */
  public boolean isConstraintAnnotation(Class<? extends Annotation> annotationType) {
    Constraint constraint = annotationType.getAnnotation( Constraint.class );
    if ( constraint == null ) {
      return false;
    }

    assertMessageParameterExists( annotationType );
View Full Code Here

   *
   * @return <code>true</code> if the annotation fulfills the above condtions, <code>false</code> otherwise.
   */
  public boolean isConstraintAnnotation(Annotation annotation) {

    Constraint constraint = annotation.annotationType()
        .getAnnotation( Constraint.class );
    if ( constraint == null ) {
      return false;
    }

View Full Code Here

        payload = createClassSet((Class[]) wrapper.getValue("payload"));

        message = new Message(wrapper.getString("message"));

        // resolving the validator class
        Constraint  constraint = annotationType.getAnnotation(Constraint.class);
        Class<? extends ConstraintValidator<?, ?>>[] validatorClasses = constraint.validatedBy();
        if (validatorClasses.length == 0) {
            validatorClass = DefaultValidators.getValidatorClass(annotation, type);
        } else {
            for (Class<? extends ConstraintValidator<?, ?>> validatorClass : validatorClasses) {
                if (constraintValidatorSupportsType(validatorClass, propertyClass)) {
View Full Code Here

   *
   * @return <code>true</code> if the annotation fulfills the above condtions, <code>false</code> otherwise.
   */
  public boolean isConstraintAnnotation(Annotation annotation) {

    Constraint constraint = annotation.annotationType()
        .getAnnotation( Constraint.class );
    if ( constraint == null ) {
      return false;
    }

View Full Code Here

   * @param annotationType The annotation type to test.
   *
   * @return <code>true</code> if the annotation fulfills the above condtions, <code>false</code> otherwise.
   */
  public boolean isConstraintAnnotation(Class<? extends Annotation> annotationType) {
    Constraint constraint = annotationType.getAnnotation( Constraint.class );
    if ( constraint == null ) {
      return false;
    }

    assertMessageParameterExists( annotationType );
View Full Code Here

   * @param annotationType The annotation type to test.
   *
   * @return <code>true</code> if the annotation fulfills the above condtions, <code>false</code> otherwise.
   */
  public boolean isConstraintAnnotation(Class<? extends Annotation> annotationType) {
    Constraint constraint = annotationType.getAnnotation( Constraint.class );
    if ( constraint == null ) {
      return false;
    }

    assertMessageParameterExists( annotationType );
View Full Code Here

   *
   * @return <code>true</code> if the annotation fulfills the above condtions, <code>false</code> otherwise.
   */
  public boolean isConstraintAnnotation(Annotation annotation) {

    Constraint constraint = annotation.annotationType()
        .getAnnotation( Constraint.class );
    if ( constraint == null ) {
      return false;
    }

View Full Code Here

   *
   * @return <code>true</code> if the annotation fulfills the above condtions, <code>false</code> otherwise.
   */
  public boolean isConstraintAnnotation(Annotation annotation) {

    Constraint constraint = annotation.annotationType()
        .getAnnotation( Constraint.class );
    if ( constraint == null ) {
      return false;
    }

View Full Code Here

TOP

Related Classes of javax.validation.Constraint

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.