Package org.apache.tapestry.ioc.services

Examples of org.apache.tapestry.ioc.services.ClassPropertyAdapter


    }

    @Test
    public void properties_with_order_annotation_filtered()
    {
        ClassPropertyAdapter adapter = _access.getAdapter(PropertyOrderBean.class);

        List<String> names = adapter.getPropertyNames();

        names.remove("class");

        List<String> sorted = TapestryInternalUtils.orderProperties(adapter, _classFactory, names);
View Full Code Here


    private Method writeMethodForTerm(Class activeType, String expression, String term)
    {
        if (term.endsWith(PARENS)) return null;

        ClassPropertyAdapter classAdapter = _access.getAdapter(activeType);
        PropertyAdapter adapter = classAdapter.getPropertyAdapter(term);

        if (adapter == null)
            throw new RuntimeException(ServicesMessages.noSuchProperty(
                    activeType,
                    term,
                    expression,
                    classAdapter.getPropertyNames()));

        return adapter.getWriteMethod();
    }
View Full Code Here

                        expression));

            return method;
        }

        ClassPropertyAdapter classAdapter = _access.getAdapter(activeType);
        PropertyAdapter adapter = classAdapter.getPropertyAdapter(term);

        if (adapter == null)
            throw new RuntimeException(ServicesMessages.noSuchProperty(
                    activeType,
                    term,
                    expression,
                    classAdapter.getPropertyNames()));

        Method m = adapter.getReadMethod();

        if (m == null && mustExist)
            throw new RuntimeException(ServicesMessages.writeOnlyProperty(
View Full Code Here

        return getAdapter(instance.getClass());
    }

    public ClassPropertyAdapter getAdapter(Class forClass)
    {
        ClassPropertyAdapter result = _adapters.get(forClass);

        if (result == null)
        {
            result = buildAdapter(forClass);
            _adapters.put(forClass, result);
View Full Code Here

        notNull(beanClass, "beanClass");
        notNull(resources, "resources");

        Messages messages = resources.getMessages();

        ClassPropertyAdapter adapter = _propertyAccess.getAdapter(beanClass);

        final BeanModel model = new BeanModelImpl(beanClass, _propertyConduitSource, _typeCoercer,
                messages);

        List<String> propertyNames = newList();

        Map<String, Runnable> worksheet = newMap();

        for (final String propertyName : adapter.getPropertyNames())
        {
            PropertyAdapter pa = adapter.getPropertyAdapter(propertyName);

            if (!pa.isRead()) continue;

            if (pa.getAnnotation(NonVisual.class) != null) continue;
View Full Code Here

    private ExceptionInfo extractInfo(Throwable t)
    {
        Map<String, Object> properties = newMap();

        ClassPropertyAdapter adapter = _propertyAccess.getAdapter(t);

        for (String name : adapter.getPropertyNames())
        {
            if (_throwableProperties.contains(name)) continue;

            Object value = adapter.get(t, name);

            if (value == null) continue;

            // An interesting property, let's save it for the analysis.
View Full Code Here

        notNull(beanClass, "beanClass");
        notNull(resources, "resources");

        Messages messages = resources.getMessages();

        ClassPropertyAdapter adapter = _propertyAccess.getAdapter(beanClass);

        BeanModel model = new BeanModelImpl(beanClass, _propertyConduitSource, _typeCoercer,
                messages);

        List<String> propertyNames = newList();

        for (String propertyName : adapter.getPropertyNames())
        {
            PropertyAdapter pa = adapter.getPropertyAdapter(propertyName);

            if (!pa.isRead())
                continue;

            if (pa.getAnnotation(NonVisual.class) != null)
View Full Code Here

    }

    @Test
    public void property_order_basic()
    {
        ClassPropertyAdapter adapter = _access.getAdapter(DataBean.class);

        List<String> names = adapter.getPropertyNames();

        names.remove("class");

        List<String> sorted = TapestryInternalUtils.orderProperties(null, adapter, _classFactory, names);
View Full Code Here

    }

    @Test
    public void property_order_on_subclass()
    {
        ClassPropertyAdapter adapter = _access.getAdapter(DataBeanSubclass.class);

        List<String> names = adapter.getPropertyNames();

        names.remove("class");

        List<String> sorted = TapestryInternalUtils.orderProperties(null, adapter, _classFactory, names);
View Full Code Here

    }

    @Test
    public void properties_with_order_annotation_filtered()
    {
        ClassPropertyAdapter adapter = _access.getAdapter(PropertyOrderBean.class);

        List<String> names = adapter.getPropertyNames();

        names.remove("class");

        List<String> sorted = TapestryInternalUtils.orderProperties(null, adapter, _classFactory, names);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ioc.services.ClassPropertyAdapter

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.