Package java.beans

Examples of java.beans.BeanDescriptor


    public void testExplicitBeanInfo() throws IntrospectionException {
        BeanInfo info = Introspector.getBeanInfo(MockFoo23.class);

        assertNull(info.getAdditionalBeanInfo());
        BeanDescriptor beanDesc = info.getBeanDescriptor();
        assertEquals("IntrospectorTest$MockFoo23", beanDesc.getName());
        assertEquals(0, info.getEventSetDescriptors().length);
        assertEquals(-1, info.getDefaultEventIndex());
        assertEquals(-1, info.getDefaultPropertyIndex());

        MethodDescriptor[] methodDesc = info.getMethodDescriptors();
View Full Code Here


    public void testExplicitBeanInfo2() throws IntrospectionException {
        BeanInfo info = Introspector.getBeanInfo(MockFox001.class);

        assertNull(info.getAdditionalBeanInfo());
        BeanDescriptor beanDesc = info.getBeanDescriptor();
        assertEquals("IntrospectorTest$MockFox001", beanDesc.getName());
        assertEquals(0, info.getEventSetDescriptors().length);
        assertEquals(-1, info.getDefaultEventIndex());
        assertEquals(-1, info.getDefaultPropertyIndex());

        MethodDescriptor[] methodDesc = info.getMethodDescriptors();
View Full Code Here

    public void testExplicitBeanInfo3() throws IntrospectionException {
        BeanInfo info = Introspector.getBeanInfo(MockFox011.class);
        // printInfo(info);

        assertNull(info.getAdditionalBeanInfo());
        BeanDescriptor beanDesc = info.getBeanDescriptor();
        assertEquals("IntrospectorTest$MockFox011", beanDesc.getName());
        assertEquals(0, info.getEventSetDescriptors().length);
        assertEquals(-1, info.getDefaultEventIndex());
        assertEquals(-1, info.getDefaultPropertyIndex());

        MethodDescriptor[] methodDesc = info.getMethodDescriptors();
View Full Code Here

                        "org.apache.harmony.beans.tests.support.mock.homonymy.mocksubject1.info",
                        "org.apache.harmony.beans.tests.support.mock.homonymy.mocksubject2.info", });

        BeanInfo beanInfo = Introspector
                .getBeanInfo(org.apache.harmony.beans.tests.support.mock.homonymy.mocksubject1.MockHomonymySubject.class);
        BeanDescriptor beanDesc = beanInfo.getBeanDescriptor();

        assertEquals(beanDesc.getName(), "mocksubject1");
        assertEquals(
                beanDesc.getBeanClass(),
                org.apache.harmony.beans.tests.support.mock.homonymy.mocksubject1.MockHomonymySubject.class);

        // set the search path in the reverse sequence
        Introspector
                .setBeanInfoSearchPath(new String[] {
                        "org.apache.harmony.beans.tests.support.mock.homonymy.mocksubject2.info",
                        "org.apache.harmony.beans.tests.support.mock.homonymy.mocksubject1.info", });

        beanInfo = Introspector
                .getBeanInfo(org.apache.harmony.beans.tests.support.mock.homonymy.mocksubject1.MockHomonymySubject.class);
        beanDesc = beanInfo.getBeanDescriptor();

        assertEquals(beanDesc.getName(), "mocksubject1");
        assertEquals(
                beanDesc.getBeanClass(),
                org.apache.harmony.beans.tests.support.mock.homonymy.mocksubject1.MockHomonymySubject.class);

    }
View Full Code Here

         * BeanDescriptor from the component metadata and calling its getValue() method, passing
         * UIComponent.COMPOSITE_COMPONENT_TYPE_KEY as the argument. If non-null, the result must be a ValueExpression
         * whose value is the component-type of the UIComponent to be created for this Resource component. Call through
         * to createComponent(java.lang.String) to create the component.
         */
        BeanDescriptor descriptor = metadata.getBeanDescriptor();
        ValueExpression componentType = (ValueExpression) descriptor.getValue(UIComponent.COMPOSITE_COMPONENT_TYPE_KEY);
        boolean annotationsApplied = false;
        if (componentType != null)
        {
            component = application.createComponent((String) componentType.getValue(context.getELContext()));
            annotationsApplied = true;
View Full Code Here

                topLevelComponent.getAttributes().get(UIComponent.BEANINFO_KEY);
        // PENDING(edburns): log error message if componentBeanInfo is null;
        if (null == componentBeanInfo) {
            return;
        }
        BeanDescriptor componentDescriptor = componentBeanInfo.getBeanDescriptor();
        // There is an entry in targetList for each attached object in the
        // <composite:interface> section of the composite component.
        List<AttachedObjectTarget> targetList = (List<AttachedObjectTarget>)
                componentDescriptor.getValue(AttachedObjectTarget.ATTACHED_OBJECT_TARGETS_KEY);
        // Each entry in targetList will vend one or more UIComponent instances
        // that is to serve as the target of an attached object in the consuming
        // page.
        List<UIComponent> targetComponents;
        String forAttributeValue, curTargetName;
View Full Code Here

                topLevelComponent.getAttributes().get(UIComponent.BEANINFO_KEY);
        // PENDING(edburns): log error message if componentBeanInfo is null;
        if (null == componentBeanInfo) {
            return;
        }
        BeanDescriptor componentDescriptor = componentBeanInfo.getBeanDescriptor();
        // There is an entry in targetList for each attached object in the
        // <composite:interface> section of the composite component.
        List<AttachedObjectTarget> targetList = (List<AttachedObjectTarget>)
                componentDescriptor.getValue(AttachedObjectTarget.ATTACHED_OBJECT_TARGETS_KEY);
        // Each entry in targetList will vend one or more UIComponent instances
        // that is to serve as the target of an attached object in the consuming
        // page.
        List<UIComponent> targetComponents;
        String forAttributeValue, curTargetName;
View Full Code Here

                topLevelComponent.getAttributes().get(UIComponent.BEANINFO_KEY);
        // PENDING(edburns): log error message if componentBeanInfo is null;
        if (null == componentBeanInfo) {
            return;
        }
        BeanDescriptor componentDescriptor = componentBeanInfo.getBeanDescriptor();
        // There is an entry in targetList for each attached object in the
        // <composite:interface> section of the composite component.
        List<AttachedObjectTarget> targetList = (List<AttachedObjectTarget>)
                componentDescriptor.getValue(AttachedObjectTarget.ATTACHED_OBJECT_TARGETS_KEY);
        // Each entry in targetList will vend one or more UIComponent instances
        // that is to serve as the target of an attached object in the consuming
        // page.
        List<UIComponent> targetComponents;
        String forAttributeValue, curTargetName;
View Full Code Here

                ValueExpression ve = attr.getValueExpression(ctx, type);
                UIComponent cc = (UIComponent) instance;
                assert (UIComponent.isCompositeComponent(cc));
                Map<String, Object> attrs = cc.getAttributes();
                BeanInfo componentMetadata = (BeanInfo) attrs.get(UIComponent.BEANINFO_KEY);
                BeanDescriptor desc = componentMetadata.getBeanDescriptor();
                Collection<String> attributesWithDeclaredDefaultValues = (Collection<String>)
                        desc.getValue(UIComponent.ATTRS_WITH_DECLARED_DEFAULT_VALUES);
                if (null != attributesWithDeclaredDefaultValues &&
                        attributesWithDeclaredDefaultValues.contains(name)) {
                    // It is necessary to remove the value from the attribute
                    // map because the ELexpression transparancy doesn't know
                    // about the value's existence.
View Full Code Here

        }
        return properties;
    }
   
    protected static BeanDescriptor getBdescriptor(Class cls) {
        BeanDescriptor beanDescriptor = new BeanDescriptor(cls, null);
        return beanDescriptor;
    }
View Full Code Here

TOP

Related Classes of java.beans.BeanDescriptor

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.