Package org.qi4j.api.constraint

Examples of org.qi4j.api.constraint.Constraints


                    continue nextConstraint;
                }
            }

            // Check the annotation itself
            Constraints constraints = annotationType.getAnnotation( Constraints.class );
            if( constraints != null )
            {
                for( Class<? extends Constraint<?, ?>> constraintClass : constraints.value() )
                {
                    if( helper.appliesTo( constraintClass, annotationType, valueType ) )
                    {
                        constraintModels.add( new ConstraintModel( constraintAnnotation, constraintClass ) );
                        continue nextConstraint;
View Full Code Here


        return Iterables.toList( Iterables.flattenIterables( Iterables.map( new Function<Type, Iterable<Class<? extends Constraint<?, ?>>>>()
        {
            @Override
            public Iterable<Class<? extends Constraint<?, ?>>> map( Type type )
            {
                Constraints constraints = Annotations.getAnnotation( type, Constraints.class );
                if( constraints == null )
                    return Iterables.empty();
                else
                    return iterable( constraints.value() );
            }
        }, types ) ) );
    }
View Full Code Here

                    continue nextConstraint;
                }
            }

            // Check the annotation itself
            Constraints constraints = annotationType.getAnnotation( Constraints.class );
            if( constraints != null )
            {
                for( Class<? extends Constraint<?, ?>> constraintClass : constraints.value() )
                {
                    if( helper.appliesTo( constraintClass, annotationType, valueType ) )
                    {
                        constraintModels.add( new ConstraintModel( constraintAnnotation, constraintClass ) );
                        continue nextConstraint;
View Full Code Here

        Function<Type, Iterable<Class<? extends Constraint<?, ?>>>> function = new Function<Type, Iterable<Class<? extends Constraint<?, ?>>>>()
        {
            @Override
            public Iterable<Class<? extends Constraint<?, ?>>> map( Type type )
            {
                Constraints constraints = Annotations.annotationOn( type, Constraints.class );
                if( constraints == null )
                {
                    return empty();
                }
                else
                {
                    return iterable( constraints.value() );
                }
            }
        };
        Iterable<Class<? extends Constraint<?, ?>>> flatten = flattenIterables( map( function, allTypes ) );
        return toList( flatten );
View Full Code Here

                    methodConstraintBindings.add( new RequiresValidBinding( requiresValid, validation ) );
                }
            }
            else if( annotation.annotationType().getAnnotation( ConstraintDeclaration.class ) != null )
            {
                Constraints constraints = annotation.annotationType().getAnnotation( Constraints.class );

                for( Class<? extends Constraint<?, ?>> aClass : constraints.value() )
                {
                    try
                    {
                        Constraint<Annotation, Object> constraint = (Constraint<Annotation, Object>) aClass.newInstance();
                        Class roleClass = (Class) ( (ParameterizedType) aClass.getGenericInterfaces()[ 0 ] ).getActualTypeArguments()[ 1 ];
View Full Code Here

        for( Annotation annotation : aClass.getAnnotations() )
        {
            if( annotation.annotationType().getAnnotation( ConstraintDeclaration.class ) != null )
            {
                Constraints constraints = annotation.annotationType().getAnnotation( Constraints.class );

                for( Class<? extends Constraint<?, ?>> constraintClass : constraints.value() )
                {
                    try
                    {
                        Constraint<Annotation, Object> constraint = (Constraint<Annotation, Object>) constraintClass.newInstance();
                        Class roleClass = (Class) ( (ParameterizedType) constraint.getClass()
View Full Code Here

TOP

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

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.