Package javax.validation

Examples of javax.validation.ValidationException


            throw new ConstraintViolationException(new HashSet<ConstraintViolation<?>>(violations));
        }

        // Check the uniqueness of the email address
        if (emailAlreadyExists(member.getEmail())) {
            throw new ValidationException("Unique Email Violation");
        }
    }
View Full Code Here


            throw new ConstraintViolationException(new HashSet<ConstraintViolation<?>>(violations));
        }

        // Check the uniqueness of the email address
        if (emailAlreadyExists(member.getEmail())) {
            throw new ValidationException("Unique Email Violation");
        }
    }
View Full Code Here

            throw new ConstraintViolationException(new HashSet<ConstraintViolation<?>>(violations));
        }

        //Check the uniqueness of the email address
        if (emailAlreadyExists(member.getEmail())) {
            throw new ValidationException("Unique Email Violation");
        }
    }
View Full Code Here

            @SuppressWarnings("unchecked")
            final ConstraintValidator<A, ? super T> validator =
                (ConstraintValidator<A, ? super T>) factoryContext.getFactory().getConstraintValidatorFactory()
                    .getInstance(validatorTypes.get(assignableTypes.get(0)));
            if (validator == null) {
                throw new ValidationException("Factory returned null validator for: "
                    + validatorTypes.get(assignableTypes.get(0)));

            }
            return validator;
            // NOTE: validator initialization deferred until append phase
View Full Code Here

        for (Class<? extends ConstraintValidator<A, ?>> validatorType : constraintValidatorClasses) {
            Type validatedType =
                TypeUtils.getTypeArguments(validatorType, ConstraintValidator.class).get(
                    ConstraintValidator.class.getTypeParameters()[1]);
            if (validatedType == null) {
                throw new ValidationException(String.format("Could not detect validated type for %s", validatorType));
            }
            if (validatedType instanceof GenericArrayType) {
                Type componentType = TypeUtils.getArrayComponentType(validatedType);
                if (componentType instanceof Class<?>) {
                    validatedType = Array.newInstance((Class<?>) componentType, 0).getClass();
View Full Code Here

                validatorFactoryClass.asSubclass(ValidatorFactory.class);
            }
        } catch (ValidationException ex) {
            throw ex;
        } catch (Exception ex) {
            throw new ValidationException("error building ValidatorFactory", ex);
        }

        // FIXME 2011-03-27 jw:
        // Should not use privileged action, but to avoid breaking things
        // doing it here like the former version of this class did.
View Full Code Here

      {
          return validatorFactoryClass.getConstructor(ConfigurationState.class).newInstance(configuration);
      }
      catch (final Exception ex)
      {
          throw new ValidationException("Cannot instantiate : " + validatorFactoryClass, ex);
      }
    }
View Full Code Here

      throw new IllegalArgumentException( "At least one groups has to be specified." );
    }

    for ( Class<?> clazz : groups ) {
      if ( !clazz.isInterface() ) {
        throw new ValidationException( "A group has to be an interface. " + clazz.getName() + " is not." );
      }
    }

    GroupChain chain = new GroupChain();
    for ( Class<?> clazz : groups ) {
View Full Code Here

            throw new ConstraintViolationException(new HashSet<ConstraintViolation<?>>(violations));
        }

        // Check the uniqueness of the email address
        if (emailAlreadyExists(member.getEmail())) {
            throw new ValidationException("Unique Email Violation");
        }
    }
View Full Code Here

                    in = new URL("jar:"+tmpArchiveFile.toURI().toURL()+"!/"+mappingFileName).openStream();
                } else {
                    in = bundle.getEntry(moduleName+"/"+mappingFileName).openStream();
                }
                if (in == null) {
                    throw new ValidationException("Unable to open input stream for mapping file " + mappingFileName + (moduleName != null ? " in "+moduleName : ""));
                }
            } catch (IOException e) {
                throw new ValidationException("Unable to open input stream for mapping file " + mappingFileName + (moduleName != null ? " in "+moduleName : ""), e);
            }
            target.addMapping(in);
        }
    }
View Full Code Here

TOP

Related Classes of javax.validation.ValidationException

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.