Package org.apache.beehive.controls.api.properties

Examples of org.apache.beehive.controls.api.properties.PropertyMap


            // If the returned value is itself a PropertyMap (i.e. a nested annotation type),
            // then wrap it in a PropertySetProxy instance before returning.
            if (value instanceof PropertyMap)
            {
                PropertyMap propertyMap = (PropertyMap)value;
                value = getProxy(propertyMap.getMapClass(), propertyMap);
            }
        }

        return value;
    }
View Full Code Here


     * The default implementation of getBeanAnnotationMap.  This returns a map based purely
     * upon annotation reflection
     */
    protected PropertyMap getBeanAnnotationMap(ControlBean bean, AnnotatedElement annotElem)
    {
        PropertyMap map = new AnnotatedElementMap(annotElem);

        // REVIEW: is this the right place to handle the general control client case?
        if ( bean != null )
            setDelegateMap( map, bean, annotElem );
       
View Full Code Here

        {
           annotClass = bean.getControlInterface();
        }
        if (annotClass != null)
        {
            PropertyMap delegateMap = bean.getAnnotationMap(annotClass);
            map.setDelegateMap(delegateMap);
        }
    }
View Full Code Here

    //
    // ControlBeanContext.getControlPropertySet
    //
    public <T extends Annotation> T getControlPropertySet(Class<T> propertySet)
    {
        PropertyMap map = _bean.getPropertyMap();

        //
        // Optional properties are not exposed to clients using traditional JavaBean
        // setters/getters (because there is way to represent an 'unset' value); for
        // these properties, the impl can tell if the PropertySet is unset because
        // this method will return null.
        //
        if (!map.containsPropertySet(propertySet))
        {
            PropertySet psAnnot = propertySet.getAnnotation(PropertySet.class);
            if (psAnnot.optional())
                return null;
        }
View Full Code Here

    //
    // ControlBeanContext.getMethodPropertySet
    //
    public <T extends Annotation> T getMethodPropertySet(Method m, Class<T> propertySet)
    {
        PropertyMap map = _bean.getAnnotationMap(m);

        //
        // Optional properties are not exposed to clients using traditional JavaBean
        // setters/getters (because there is way to represent an 'unset' value); for
        // these properties, the impl can tell if the PropertySet is unset because
        // this method will return null.
        //
        if (!map.containsPropertySet(propertySet))
        {
            PropertySet psAnnot = propertySet.getAnnotation(PropertySet.class);
            if (psAnnot.optional())
                return null;
        }
View Full Code Here

        // external config delegates) will be restored as part of the decoding process.
        //
        // BUGBUG: What about a user-created PropertyMap that was passed into the constructor?
        //
        AnnotatedElementMap aem = null;
        PropertyMap pMap = control.getPropertyMap();
        while (pMap != null)
        {
            if (pMap instanceof AnnotatedElementMap)
            {
                aem = (AnnotatedElementMap)pMap;

                //
                // Ignore a class-valued AnnotationElementMap.. this just refers to the
                // Control type, and will be automatically reassociated at construction
                // time
                //
                if (aem.getAnnotatedElement() instanceof Class)
                    aem = null;

                xmlOut.setPersistenceDelegate(AnnotatedElementMap.class,
                                              new AnnotatedElementMapPersistenceDelegate());

                break;
            }

            pMap = pMap.getDelegateMap();
        }


        //
        // Create a constructor that that uses the following form:
View Full Code Here

        //
        // Get the default map for the control class.  This contains the default property
        // values for all beans of the class.
        //
        PropertyMap classMap = getAnnotationMap(controlIntf);
        if (initProperties != null)
        {
            //
            // If the initialization map derives its values from a Java annotated element,
            // then allow container overrides on this element to be applied.  This will also
View Full Code Here

        // If the held value is a PropertyMap, then wrap it in an annotation proxy of
        // the expected type.
        if (value instanceof PropertyMap)
        {
            PropertyMap map = (PropertyMap)value;
            value = PropertySetProxy.getProxy(map.getMapClass(), map);
        }

        return value;
    }
View Full Code Here

        //
        // Ask the associated ControlBeanContext to locate and initialize a PropertyMap, then
        // store it in the local cache.
        //
        PropertyMap map = getControlBeanContext().getAnnotationMap(annotElem);
        annotCache.put(annotElem, map);

        return map;
    }
View Full Code Here

        // external config delegates) will be restored as part of the decoding process.
        //
        // BUGBUG: What about a user-created PropertyMap that was passed into the constructor?
        //
        AnnotatedElementMap aem = null;
        PropertyMap pMap = control.getPropertyMap();
        while (pMap != null)
        {
            if (pMap instanceof AnnotatedElementMap)
            {
                aem = (AnnotatedElementMap)pMap;

                //
                // Ignore a class-valued AnnotationElementMap.. this just refers to the
                // Control type, and will be automatically reassociated at construction
                // time
                //
                if (aem.getAnnotatedElement() instanceof Class)
                    aem = null;

                xmlOut.setPersistenceDelegate(AnnotatedElementMap.class,
                                              new AnnotatedElementMapPersistenceDelegate());

                break;
            }

            pMap = pMap.getDelegateMap();
        }


        //
        // Create a constructor that that uses the following form:
View Full Code Here

TOP

Related Classes of org.apache.beehive.controls.api.properties.PropertyMap

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.