Package org.apache.tapestry5.beaneditor

Examples of org.apache.tapestry5.beaneditor.Validate


        verify();
    }

    private Validate newValidate(String value)
    {
        Validate annotation = newMock(Validate.class);

        expect(annotation.value()).andReturn(value).atLeastOnce();

        return annotation;
    }
View Full Code Here


    @Test
    public void field_annotations_are_visible()
    {
        PropertyConduit conduit = source.create(CompositeBean.class, "simple.firstName");

        Validate annotation = conduit.getAnnotation(Validate.class);

        assertNotNull(annotation);

        assertEquals(annotation.value(), "required");
    }
View Full Code Here

    @Test
    public void field_annotations_are_visible()
    {
        PropertyConduit conduit = source.create(CompositeBean.class, "simple.firstName");

        Validate annotation = conduit.getAnnotation(Validate.class);

        assertNotNull(annotation);

        assertEquals(annotation.value(), "required");
    }
View Full Code Here

    @Test
    public void field_annotations_are_visible()
    {
        PropertyConduit conduit = source.create(CompositeBean.class, "simple.firstName");

        Validate annotation = conduit.getAnnotation(Validate.class);

        assertNotNull(annotation);

        assertEquals(annotation.value(), "required");
    }
View Full Code Here

    @Test
    public void single_constraint()
    {
        PropertyConduit conduit = mockPropertyConduit();
        Validate validate = newValidate("required");

        train_getAnnotation(conduit, Validate.class, validate);

        replay();
View Full Code Here

    @Test
    public void multiple_constraints()
    {
        PropertyConduit conduit = mockPropertyConduit();
        Validate validate = newValidate("required,minlength=3");

        train_getAnnotation(conduit, Validate.class, validate);

        replay();
View Full Code Here

        verify();
    }

    private Validate newValidate(String value)
    {
        Validate annotation = newMock(Validate.class);

        expect(annotation.value()).andReturn(value).atLeastOnce();

        return annotation;
    }
View Full Code Here

public class ValidateAnnotationConstraintGenerator implements ValidationConstraintGenerator
{

    public List<String> buildConstraints(Class propertyType, AnnotationProvider annotationProvider)
    {
        Validate annotation = annotationProvider.getAnnotation(Validate.class);

        if (annotation == null)
            return null;

        return Arrays.asList(annotation.value().split(","));
    }
View Full Code Here

    {
        List<OptionModel> options = CollectionFactory.newList();

        for (Locale l : supportedLocales)
        {
            options.add(new OptionModelImpl(l.getDisplayName(l), l));
        }

        return new SelectModelImpl(null, options);
    }
View Full Code Here

    {
        this.parent = parent;
        this.transformer = transformer;
        this.logger = logger;
        this.internalRequestGlobals = internalRequestGlobals;
        this.changeTracker = new URLChangeTracker(classpathURLConverter);

        initializeService();
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.beaneditor.Validate

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.