Package javax.validation

Examples of javax.validation.ValidationException


                        new Class[] { ApacheFactoryContext.class },
                        new Object[] { factoryContext });
                }
            } catch (ClassNotFoundException e) {
            }
            throw new ValidationException("Type " + type + " not supported");
        }
    }
View Full Code Here


                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);
        }

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

        return true;
View Full Code Here

                    objectId = "<null>";
                }
            } catch (Exception e) {
                objectId = "<unknown>";
            } finally {
                return new ValidationException("error during validation of "
                    + objectId, ex);
            }
        }
    }
View Full Code Here

                if ("[".equals(token)) {
                    String sindex = tokens.nextToken();
                    int idx = Integer.parseInt(sindex);
                    token = tokens.nextToken();
                    if (!"]".equals(token)) {
                        throw new ValidationException(
                                "']' missing, invalid property format: " + propertyPath);
                    }
                    useIndexedValue(idx);
                    resolveMetaBean();
                } else if (!".".equals(token)) { // it is a property name
                    MetaProperty mp = getMetaBean().getProperty(token);
                    if (mp == null) {
                        throw new UnknownPropertyException(
                                "unknown property '" + token + "' in " + getMetaBean().getId());
                    }
                    if (getValue() != null) {
                        setValue(PropertyAccess.getProperty(getValue(), token));
                    }
                    setMetaProperty(mp);
                    resolveMetaBean();
                }
            }
        } catch (ValidationException ex) {
            throw ex; // route exception
        } catch (Exception ex) { // wrap exception
            throw new ValidationException(
                    "invalid property format: " + propertyPath, ex);

        }
    }
View Full Code Here

            }
            return value;
        } else if (value.getClass().isArray()) {
            return getAtIndex(Arrays.asList(value), idx);
        } else {
            throw new ValidationException("cannot access indexed value from " + value);
        }
    }
View Full Code Here

                providerResolver = aState.getDefaultValidationProviderResolver();
            } else {
                providerResolver = aState.getValidationProviderResolver();
            }
        } else {
            throw new ValidationException("either provider or state are required");
        }
    }
View Full Code Here

                  .getValidationProviders()) {
                if (providerClass.isAssignableFrom(provider.getClass())) {
                    return provider;
                }
            }
            throw new ValidationException(
                  "Unable to find suitable provider: " + providerClass);
        } else {
            List<ValidationProvider<?>> providers = providerResolver.getValidationProviders();
            return providers.get(0);
        }
View Full Code Here

                                // try loading the specified class
                                final Class<?> provider = cl.loadClass(line);
                                // create an instance to return
                                providers.add((ValidationProvider<?>) SecureActions.newInstance(provider));
                            } catch (ClassNotFoundException e) {
                                throw new ValidationException("Failed to load provider " +
                                    line + " configured in file " + url, e);
                            }
                        }
                        line = br.readLine();
                    }
                    br.close();
                } catch (IOException e) {
                    throw new ValidationException("Error trying to read " + url, e);
                } finally {
                    if (br != null)
                        br.close();
                }
            }
        } catch (IOException e) {
            throw new ValidationException("Error trying to read a " + SPI_CFG, e);
        }
        // caller must handle the case of no providers found
        return providers;
    }
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

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.