Examples of PropertyStorage


Examples of org.apache.myfaces.extensions.validator.core.storage.PropertyStorage

    {
        public PropertyInformation extract(Class targetClass, String targetProperty)
        {
            PropertyInformation propertyInformation = new DefaultPropertyInformation();

            PropertyStorage storage = ReflectionUtils.getPropertyStorage();
            addPropertyAccessAnnotations(storage, targetClass, targetProperty, propertyInformation);
            addFieldAccessAnnotations(storage, targetClass, targetProperty, propertyInformation);

            return propertyInformation;
        }
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.core.storage.PropertyStorage

    public void testTargetPropertyAnnotationDefault() throws Exception
    {
        Method method = ReflectionUtils.getMethod(ConstraintSourceUtils.class, "getTargetPropertyMetaData",
                PropertyStorage.class, Class.class, String.class);
        Assert.assertNotNull(method);
        PropertyStorage storage = ReflectionUtils.getPropertyStorage();
        Annotation target = (Annotation) ReflectionUtils.invokeMethodOfClass(ConstraintSourceUtils.class, method,
                storage, ConstraintSourceAwareBean.class, "property3");

        Assert.assertEquals("test1", ExtValAnnotationUtils.extractValueOf(target, Object.class));
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.core.storage.PropertyStorage

    public void testTargetPropertyAnnotationCustomConfig() throws Exception
    {
        Method method = ReflectionUtils.getMethod(ConstraintSourceUtils.class, "getTargetPropertyMetaData",
                PropertyStorage.class, Class.class, String.class);
        Assert.assertNotNull(method);
        PropertyStorage storage = ReflectionUtils.getPropertyStorage();
        Annotation target = (Annotation) ReflectionUtils.invokeMethodOfClass(ConstraintSourceUtils.class, method,
                storage, ConstraintSourceAwareBean.class, "property4");

        Assert.assertEquals("test2", ExtValAnnotationUtils.extractValueOf(target, Object.class));
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.core.storage.PropertyStorage

    public void testTargetPropertyIdAnnotationDefault() throws Exception
    {
        Method method = ReflectionUtils.getMethod(ConstraintSourceUtils.class, "getTargetPropertyMetaData",
                PropertyStorage.class, Class.class, String.class);
        Assert.assertNotNull(method);
        PropertyStorage propertyStorage = ReflectionUtils.getPropertyStorage();
        Annotation target = (Annotation) ReflectionUtils.invokeMethodOfClass(ConstraintSourceUtils.class, method,
                propertyStorage, ConstraintSourceAwareBean.class, "property5");

        Assert.assertEquals(ConstraintSource.class.getName(), ((Class) ExtValAnnotationUtils.extractValueOf(target,
                Object.class)).getName());
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.core.storage.PropertyStorage

    public void testTargetPropertyIdAnnotationCustomConfig() throws Exception
    {
        Method method = ReflectionUtils.getMethod(ConstraintSourceUtils.class, "getTargetPropertyMetaData",
                PropertyStorage.class, Class.class, String.class);
        Assert.assertNotNull(method);
        PropertyStorage propertyStorage = ReflectionUtils.getPropertyStorage();
        Annotation target = (Annotation) ReflectionUtils.invokeMethodOfClass(ConstraintSourceUtils.class, method,
                propertyStorage, ConstraintSourceAwareBean.class, "property6");

        Assert.assertEquals(CustomConstraintSource.class.getName(), ((Class) ExtValAnnotationUtils.extractValueOf(target,
                Object.class)).getName());
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.core.storage.PropertyStorage

    public void testTargetPropertyAnnotationDefault() throws Exception
    {
        Method method = ReflectionUtils.getMethod(ConstraintSourceUtils.class, "getTargetPropertyMetaData",
                PropertyStorage.class, Class.class, String.class);
        assertNotNull(method);
        PropertyStorage storage = ReflectionUtils.getPropertyStorage();
        Annotation target = (Annotation) ReflectionUtils.invokeMethodOfClass(ConstraintSourceUtils.class, method,
                storage, ConstraintSourceAwareBean.class, "property3");

        assertEquals("test1", ExtValAnnotationUtils.extractValueOf(target, Object.class));
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.core.storage.PropertyStorage

    public void testTargetPropertyAnnotationCustomConfig() throws Exception
    {
        Method method = ReflectionUtils.getMethod(ConstraintSourceUtils.class, "getTargetPropertyMetaData",
                PropertyStorage.class, Class.class, String.class);
        assertNotNull(method);
        PropertyStorage storage = ReflectionUtils.getPropertyStorage();
        Annotation target = (Annotation) ReflectionUtils.invokeMethodOfClass(ConstraintSourceUtils.class, method,
                storage, ConstraintSourceAwareBean.class, "property4");

        assertEquals("test2", ExtValAnnotationUtils.extractValueOf(target, Object.class));
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.core.storage.PropertyStorage

    public void testTargetPropertyIdAnnotationDefault() throws Exception
    {
        Method method = ReflectionUtils.getMethod(ConstraintSourceUtils.class, "getTargetPropertyMetaData",
                PropertyStorage.class, Class.class, String.class);
        assertNotNull(method);
        PropertyStorage propertyStorage = ReflectionUtils.getPropertyStorage();
        Annotation target = (Annotation) ReflectionUtils.invokeMethodOfClass(ConstraintSourceUtils.class, method,
                propertyStorage, ConstraintSourceAwareBean.class, "property5");

        assertEquals(ConstraintSource.class.getName(), ((Class) ExtValAnnotationUtils.extractValueOf(target,
                Object.class)).getName());
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.core.storage.PropertyStorage

    public void testTargetPropertyIdAnnotationCustomConfig() throws Exception
    {
        Method method = ReflectionUtils.getMethod(ConstraintSourceUtils.class, "getTargetPropertyMetaData",
                PropertyStorage.class, Class.class, String.class);
        assertNotNull(method);
        PropertyStorage propertyStorage = ReflectionUtils.getPropertyStorage();
        Annotation target = (Annotation) ReflectionUtils.invokeMethodOfClass(ConstraintSourceUtils.class, method,
                propertyStorage, ConstraintSourceAwareBean.class, "property6");

        assertEquals(CustomConstraintSource.class.getName(), ((Class) ExtValAnnotationUtils.extractValueOf(target,
                Object.class)).getName());
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.core.storage.PropertyStorage

        return getPropertyStorage().containsField(entity, property);
    }

    private void tryToCachedField(Class entity, String property, Field field)
    {
        PropertyStorage propertyStorage = getPropertyStorage();
        if (!propertyStorage.containsField(entity, property))
        {
            propertyStorage.storeField(entity, property, field);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.