Package org.apache.tapestry.ioc.services

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


        List<String> propertyNames = newList();

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

            if (!pa.isRead())
                continue;

            if (pa.getAnnotation(NonVisual.class) != null)
                continue;

            if (filterReadOnlyProperties && !pa.isUpdate())
                continue;

            String editorType = _registry.get(pa.getType());

            // If an unregistered type, then ignore the property.

            if (editorType.equals(""))
                continue;
View Full Code Here


    {
        List<PropertyOrder> properties = newList();

        for (String name : propertyNames)
        {
            PropertyAdapter pa = classAdapter.getPropertyAdapter(name);

            if (pa.getAnnotation(Order.class) != null)
                continue;

            Method readMethod = pa.getReadMethod();

            // Kind of assuming that line number information will be availble here.

            properties.add(new PropertyOrder(name, computeDepth(readMethod), classFactory
                    .getMethodLineNumber(readMethod)));
View Full Code Here

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

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

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

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

                        expression));

            return method;
        }

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

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

        Method m = adapter.getReadMethod();

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

    {
        List<PropertyOrder> properties = newList();

        for (String name : propertyNames)
        {
            PropertyAdapter pa = classAdapter.getPropertyAdapter(name);

            if (pa.getAnnotation(Order.class) != null) continue;

            Method readMethod = pa.getReadMethod();

            MethodLocation location = classFactory.getMethodLocation(readMethod);

            int lineNumber = location != null ? location.getLineNumber() : 0;
View Full Code Here

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

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

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

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

                        expression));

            return method;
        }

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

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

        Method m = adapter.getReadMethod();

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

            // Indexed properties will have a null propertyType (and a non-null
            // indexedPropertyType). We ignore indexed properties.

            if (pd.getPropertyType() == null) continue;

            PropertyAdapter pa = new PropertyAdapterImpl(pd);

            _adapters.put(pa.getName(), pa);
        }
    }
View Full Code Here

        adaptorFor(propertyName).set(instance, value);
    }

    private PropertyAdapter adaptorFor(String name)
    {
        PropertyAdapter pa = _adapters.get(name);

        if (pa == null)
            throw new IllegalArgumentException(ServiceMessages.noSuchProperty(_beanType, name));

        return pa;
View Full Code Here

    @Test
    public void property_adapter_read_only_property()
    {
        ClassPropertyAdapter cpa = _access.getAdapter(Bean.class);
        PropertyAdapter pa = cpa.getPropertyAdapter("readOnly");

        assertTrue(pa.isRead());
        assertFalse(pa.isUpdate());

        assertNull(pa.getWriteMethod());
        assertEquals(pa.getReadMethod(), findMethod(Bean.class, "getReadOnly"));
    }
View Full Code Here

TOP

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

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.