Package org.apache.isis.core.metamodel.facets.properties.validating.regexannot

Examples of org.apache.isis.core.metamodel.facets.properties.validating.regexannot.RegExFacetFacetOnPropertyAnnotationFactory


        assertEquals("^A.*", regExFacet.validation());
        assertEquals(false, regExFacet.caseSensitive());
    }

    public void testRegExAnnotationPickedUpOnProperty() {
        final RegExFacetFacetOnPropertyAnnotationFactory facetFactory = new RegExFacetFacetOnPropertyAnnotationFactory();

        class Customer {
            @SuppressWarnings("unused")
            @RegEx(validation = "^A.*", caseSensitive = false)
            public String getFirstName() {
                return null;
            }
        }
        final Method method = findMethod(Customer.class, "getFirstName");

        facetFactory.process(new ProcessMethodContext(Customer.class, null, null, method, methodRemover, facetedMethod));

        final Facet facet = facetedMethod.getFacet(RegExFacet.class);
        assertNotNull(facet);
        assertTrue(facet instanceof RegExFacetOnPropertyAnnotation);
        final RegExFacetOnPropertyAnnotation regExFacet = (RegExFacetOnPropertyAnnotation) facet;
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.facets.properties.validating.regexannot.RegExFacetFacetOnPropertyAnnotationFactory

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.