Package javax.validation

Examples of javax.validation.ValidationException


  
   private static class MockValidator implements Validator
   {
      public BeanDescriptor getConstraintsForClass(Class<?> clazz)
      {
         throw new ValidationException("NYI");
      }
View Full Code Here


         throw new ValidationException("NYI");
      }

      public <T> T unwrap(Class<T> type)
      {
         throw new ValidationException("NYI");
      }
View Full Code Here

            return SecureActions.newInstance(validatorFactoryClass, VALIDATOR_FACTORY_CONSTRUCTOR_ARGS,
                new Object[] { configuration });
        } catch (ValidationException ex) {
            throw ex;
        } catch (Exception ex) {
            throw new ValidationException("error building ValidatorFactory", ex);
        }
    }
View Full Code Here

            throw new IllegalArgumentException("At least one group 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.");
            }
        }

        Groups chain = new Groups();
View Full Code Here

                    // ignore
                }
                try {
                    return Class.forName(className, true, caller.getClassLoader());
                } catch (ClassNotFoundException e) {
                    throw new ValidationException("Unable to load class: " + className, e);
                }
            }
        });
    }
View Full Code Here

        Map<Type, Type> resolvedTypes = new HashMap<Type, Type>();
        Type constraintValidatorType = resolveTypes(resolvedTypes, validator);
        Type validatorType = ((ParameterizedType) constraintValidatorType)
              .getActualTypeArguments()[VALIDATOR_TYPE_INDEX];
        if (validatorType == null) {
            throw new ValidationException("null is an invalid type for a ConstraintValidator");
        } else if (validatorType instanceof GenericArrayType) {
            validatorType = getArrayType(getComponentType(validatorType));
        }
        while (resolvedTypes.containsKey(validatorType)) {
            validatorType = resolvedTypes.get(validatorType);
View Full Code Here

            try {
                Object value = m.invoke(annot);
                this.elements.put(m.getName(), value);
            } catch (IllegalArgumentException e) {
                // No args, so should not happen
                throw new ValidationException("Cannot access annotation " + annot + " element: " + m.getName());
            } catch (IllegalAccessException e) {
                throw new ValidationException("Cannot access annotation " + annot + " element: " + m.getName());
            } catch (InvocationTargetException e) {
                throw new ValidationException("Cannot access annotation " + annot + " element: " + m.getName());
            }
        }
    }
View Full Code Here

            return SecureActions.getConstructor(proxyClass, InvocationHandler.class)
                  .newInstance(handler);
        } catch (ValidationException e) {
            throw e;
        } catch (Exception e) {
            throw new ValidationException(
                  "Unable to create annotation for configured constraint", e);
        }
    }
View Full Code Here

        try {
            if (!context.getTraversableResolver().isReachable(context.getBean(), node,
                context.getRootMetaBean().getBeanClass(), beanPath, access.getElementType()))
                return false;
        } catch (RuntimeException e) {
            throw new ValidationException("Error in TraversableResolver.isReachable() for " + context.getBean(), e);
        }

        return true;
    }
View Full Code Here

            StreamSource stream = new StreamSource(inputStream);
            JAXBElement<ValidationConfigType> root =
                  unmarshaller.unmarshal(stream, ValidationConfigType.class);
            return root.getValue();
        } catch (JAXBException e) {
            throw new ValidationException("Unable to parse " + validationXmlFile, e);
        } catch (IOException e) {
            throw new ValidationException("Unable to parse " + validationXmlFile, e);
        } finally {
            IOUtils.closeQuietly(inputStream);
        }
    }
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.