Package org.qi4j.api.constraint

Examples of org.qi4j.api.constraint.ConstraintViolationException


        {
            List<ConstraintViolation> violations = constraints.checkConstraints( value );
            if( !violations.isEmpty() )
            {
                Iterable<Class<?>> empty = empty();
                throw new ConstraintViolationException( "", empty, (Member) accessor, violations );
            }
        }
    }


        if( associationConstraints != null )
        {
            List<ConstraintViolation> violations = associationConstraints.checkConstraints( association );
            if( !violations.isEmpty() )
            {
                throw new ConstraintViolationException( (Composite) association.get(), (Member) accessor, violations );
            }
        }
    }

        {
            List<ConstraintViolation> violations = constraints.checkConstraints( composite );
            if( !violations.isEmpty() )
            {
                Iterable<Class<?>> empty = empty();
                throw new ConstraintViolationException( "", empty, (Member) accessor, violations );
            }
        }
    }

        {
            List<ConstraintViolation> violations = associationConstraints.checkConstraints( manyAssociation );
            if( !violations.isEmpty() )
            {
                Iterable<Class<?>> empty = empty();
                throw new ConstraintViolationException( "", empty, (Member) accessor, violations );
            }
        }
    }

        {
            state.checkConstraints();
        }
        catch( ConstraintViolationException e )
        {
            throw new ConstraintViolationException( identity.identity(), entityModel.types(), e.mixinTypeName(), e.methodName(), e
                .constraintViolations() );
        }
    }

        // Check if any constraint failed
        if( violations != null )
        {
            if( instance instanceof Composite )
            {
                throw new ConstraintViolationException( (Composite) instance, method, violations );
            }
            if( instance instanceof CompositeInstance )
            {
                throw new ConstraintViolationException( (Composite) ( (CompositeInstance) instance ).proxy(), method, violations );
            }
            Iterable<? extends Class<?>> types = iterable( instance.getClass() );
            throw new ConstraintViolationException( instance.toString(), (Iterable<Class<?>>) types, method, violations );
        }
    }

        {
            List<ConstraintViolation> violations = constraints.checkConstraints( value );
            if( !violations.isEmpty() )
            {
                Iterable<Class<?>> empty = empty();
                throw new ConstraintViolationException( "<new instance>", empty, ( (Member) accessor ), violations );
            }
        }
    }

            {
                List<ConstraintViolation> violations = constraints.checkConstraints( value );
                if( !violations.isEmpty() )
                {
                    Iterable<Class<?>> empty = empty();
                    throw new ConstraintViolationException( "<new instance>", empty, ( (Member) accessor ), violations );
                }
            }
        }

TOP

Related Classes of org.qi4j.api.constraint.ConstraintViolationException

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.