Package org.apache.isis.core.metamodel.facets.FacetFactory

Examples of org.apache.isis.core.metamodel.facets.FacetFactory.ProcessParameterContext


            @SuppressWarnings("unused")
            public void someAction(@RegEx(validation = "^A.*", caseSensitive = false) final int foo) {}
        }
        final Method method = findMethod(Customer.class, "someAction", new Class[] { int.class });

        facetFactory.processParams(new ProcessParameterContext(method, 0, facetedMethodParameter));

        assertNull(facetedMethod.getFacet(RegExFacet.class));
    }
View Full Code Here


            @SuppressWarnings("unused")
            public void someAction(@Mask("###") final String foo) {}
        }
        final Method method = findMethod(Customer.class, "someAction", new Class[] { String.class });

        facetFactory.processParams(new ProcessParameterContext(method, 0, facetedMethodParameter));

        final Facet facet = facetedMethodParameter.getFacet(MaskFacet.class);
        assertNotNull(facet);
        assertTrue(facet instanceof MaskFacetAnnotationForParameter);
        final MaskFacetAnnotationForParameter maskFacet = (MaskFacetAnnotationForParameter) facet;
View Full Code Here

            @SuppressWarnings("unused")
            public void someAction(@Mask("###") final int foo) {}
        }
        final Method method = findMethod(Customer.class, "someAction", new Class[] { int.class });

        facetFactory.processParams(new ProcessParameterContext(method, 0, facetedMethodParameter));

        assertNotNull(facetedMethodParameter.getFacet(MaskFacet.class));
    }
View Full Code Here

            @SuppressWarnings("unused")
            public void someAction(@Optional final String foo) {}
        }
        final Method method = findMethod(Customer.class, "someAction", new Class[] { String.class });

        facetFactory.processParams(new ProcessParameterContext(method, 0, facetedMethodParameter));

        final Facet facet = facetedMethodParameter.getFacet(MandatoryFacet.class);
        assertNotNull(facet);
        assertTrue(facet instanceof MandatoryFacetInvertedByOptionalForParameter);
    }
View Full Code Here

            @SuppressWarnings("unused")
            public void someAction(@Optional final int foo) {}
        }
        final Method method = findMethod(Customer.class, "someAction", new Class[] { int.class });

        facetFactory.processParams(new ProcessParameterContext(method, 0, facetedMethodParameter));

        assertNull(facetedMethod.getFacet(MandatoryFacet.class));
    }
View Full Code Here

            @SuppressWarnings("unused")
            public void someAction(@TypicalLength(20) final int foo) {}
        }
        final Method method = findMethod(Customer.class, "someAction", new Class[] { int.class });

        facetFactory.processParams(new ProcessParameterContext(method, 0, facetedMethodParameter));

        final Facet facet = facetedMethodParameter.getFacet(TypicalLengthFacet.class);
        assertNotNull(facet);
        assertTrue(facet instanceof TypicalLengthFacetAnnotationOnParameter);
        final TypicalLengthFacetAnnotationOnParameter typicalLengthFacetAnnotation = (TypicalLengthFacetAnnotationOnParameter) facet;
View Full Code Here

        MustSatisfySpecificationOnParameterFacetFactory facetFactory = new MustSatisfySpecificationOnParameterFacetFactory();
       
        mockery.checking(new Expectations() {{
            one(mockFacetedMethodParameter).addFacet(with(anInstanceOf(MustSatisfySpecificationOnParameterFacet.class)));
        }});
        facetFactory.processParams(new ProcessParameterContext(changeLastNameMethodWith, 0, mockFacetedMethodParameter));
    }
View Full Code Here

        MustSatisfySpecificationOnParameterFacetFactory facetFactory = new MustSatisfySpecificationOnParameterFacetFactory();

        mockery.checking(new Expectations() {{
            never(mockFacetedMethodParameter).addFacet(with(anInstanceOf(MustSatisfySpecificationOnParameterFacet.class)));
        }});
        facetFactory.processParams(new ProcessParameterContext(changeLastNameMethodWithout, 0, mockFacetedMethodParameter));
    }
View Full Code Here

            public void someAction(@TypicalLength(20) final int foo) {
            }
        }
        final Method method = findMethod(Customer.class, "someAction", new Class[] { int.class });

        facetFactory.processParams(new ProcessParameterContext(method, 0, facetedMethodParameter));

        final Facet facet = facetedMethodParameter.getFacet(TypicalLengthFacet.class);
        assertNotNull(facet);
        assertTrue(facet instanceof TypicalLengthFacetAnnotationOnParameter);
        final TypicalLengthFacetAnnotationOnParameter typicalLengthFacetAnnotation = (TypicalLengthFacetAnnotationOnParameter) facet;
View Full Code Here

            final Method method,
            final int paramNum,
            final FacetedMethodParameter facetedMethodParameter) {
        final List<FacetFactory> factoryList = getFactoryListByFeatureType(FeatureType.ACTION_PARAMETER);
        for (final FacetFactory facetFactory : factoryList) {
            facetFactory.processParams(new ProcessParameterContext(method, paramNum, facetedMethodParameter));
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.facets.FacetFactory.ProcessParameterContext

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.