Package org.qi4j.api.constraint

Examples of org.qi4j.api.constraint.ConstraintViolationException


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


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

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

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

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

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

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

        // 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 );
            }
            throw new ConstraintViolationException( instance.toString(), instance.getClass()
                .getName(), method, 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( association );
            if( !violations.isEmpty() )
            {
                Iterable<Class<?>> empty = empty();
                throw new ConstraintViolationException( "", 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.