Package org.apache.tapestry.spec

Examples of org.apache.tapestry.spec.PropertySpecification


public class TestComponentPropertyProxyWorker extends BaseAnnotationTestCase
{

    IPropertySpecification addProperty(EnhancementOperation op, IComponentSpecification spec, Location l,
            String propertyName) {
        IPropertySpecification pspec = new PropertySpecification();

        pspec.setName(propertyName);
        pspec.setPersistence("session");
        pspec.setLocation(l);

        spec.addPropertySpecification(pspec);
       
        return pspec;
    }
View Full Code Here


        ComponentPropertyProxyWorker worker = new ComponentPropertyProxyWorker();
        List<String> exclude = new ArrayList<String>();
        exclude.add("Entity");
        worker.setExcludedPackages(exclude);
       
        IPropertySpecification prop = new PropertySpecification();
        prop.setName("value");
        prop.setPersistence("session");
       
        assertEquals(worker.extractPropertyType(AnnotatedGenericPersistentPage.class, "value", prop), Persistent.class);
       
        prop.setGeneric(false);
        prop.setType(null);
        prop.setName("secondValue");
       
        Class type = worker.extractPropertyType(AnnotatedGenericPersistentPage.class, "secondValue", prop);
       
        assert type != null;
        assert prop.isGeneric();
       
        assertEquals(type, Persistent.class);
    }
View Full Code Here

        InitialValue iv = method.getAnnotation(InitialValue.class);

        String propertyName = AnnotationUtils.getPropertyName(method);
        String stategy = p.value();

        IPropertySpecification pspec = new PropertySpecification();

        pspec.setName(propertyName);
        pspec.setPersistence(stategy);
        pspec.setLocation(location);
        pspec.setInitialValue(iv == null ? null : iv.value());

        spec.addPropertySpecification(pspec);
    }
View Full Code Here

        String propertyName = AnnotationUtils.getPropertyName(method);

        // Define a transient property

        IPropertySpecification pspec = new PropertySpecification();

        pspec.setName(propertyName);
        pspec.setLocation(location);
        pspec.setInitialValue(iv.value());

        spec.addPropertySpecification(pspec);
    }
View Full Code Here

    }

    private List buildPropertySpecs(String name, String type, boolean persistent,
            Location location, String initialValue)
    {
        PropertySpecification ps = new PropertySpecification();
        ps.setName(name);
        ps.setType(type);
        ps.setPersistence(persistent ? "session" : null);
        ps.setInitialValue(initialValue);
        ps.setLocation(location);

        return Collections.singletonList(ps);
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.spec.PropertySpecification

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.