Package org.rhq.core.domain.configuration

Examples of org.rhq.core.domain.configuration.PropertyMap


        PropertyMapListGridRecord[] records = new PropertyMapListGridRecord[propertyList == null ? 0 : propertyList
            .getList().size()];
        List<Property> list = propertyList.getList();
        for (int index = 0, listSize = list.size(); index < listSize; index++) {
            Property row = list.get(index);
            PropertyMap rowMap = (PropertyMap) row;
            PropertyMapListGridRecord record = new PropertyMapListGridRecord(rowMap, index, definitions);
            records[index] = record;
        }
        return records;
    }
View Full Code Here


        }
    }

    protected boolean shouldFireEventOnPropertyValueChange(FormItem formItem,
        PropertyDefinitionSimple propertyDefinitionSimple, PropertySimple propertySimple) {
        PropertyMap parentMap = propertySimple.getParentMap();
        return propertySimple.getConfiguration() != null || (parentMap != null && parentMap.getConfiguration() != null);
    }
View Full Code Here

        final List<PropertyDefinition> memberDefinitions = new ArrayList<PropertyDefinition>(
            memberMapDefinition.getOrderedPropertyDefinitions());

        final boolean newRow = (memberMap == null);
        final PropertyMap workingMap = (newRow) ? new PropertyMap(memberMapDefinition.getName()) : memberMap
            .deepCopy(true);

        final String title = (mapReadOnly) ? MSG.view_configEdit_viewRow() : MSG.view_configEdit_editRow();
        final Window popup = createPopup(title, 800, 600);
View Full Code Here

        for (String mapKey : mapKeys) {
            Object mapValue = in.get(mapKey);

            if (mapValue instanceof Map) {
                Map<String,Object> map = (Map<String, Object>) mapValue;
                PropertyMap propertyMap = getPropertyMap(mapKey, map);
                config.put(propertyMap);
            }
            else if (mapValue instanceof List) {
                List<Object> objects = (List<Object>) mapValue;
                PropertyList propertyList = getPropertyList(mapKey, objects);
View Full Code Here

    private static Object convertProperty(Property property, PropertyDefinition propertyDefinition, boolean strict) {
        Object target;

        if (property instanceof PropertyMap) {
            PropertyMap propertyMap = (PropertyMap) property;
            target = getInnerMap(propertyMap,(PropertyDefinitionMap) propertyDefinition, strict);
        } else if (property instanceof PropertyList) {
            PropertyList propertyList = (PropertyList) property;
            target = getInnerList(propertyList, (PropertyDefinitionList)propertyDefinition, strict);
        } else {
View Full Code Here

        }
        return propertyList;
    }

    private static PropertyMap getPropertyMap(String propertyName, Map<String, Object> map) {
        PropertyMap propertyMap = new PropertyMap(propertyName);
        Set<String> keys = map.keySet();
        for (String key : keys) {
            Object value = map.get(key);
            Property target;
            if (value instanceof Map) {
                target = getPropertyMap(key, (Map)value);
            } else if (value instanceof List) {
                target = getPropertyList(key, (List)value);
            } else {
                target = new PropertySimple(key,value);
            }
            propertyMap.put(target);
        }
        return propertyMap;
    }
View Full Code Here

                PropertyDefinitionList propertyDefinitionList = (PropertyDefinitionList) propertyDefinition;
                for (Property prop : propertyList.getList()) {
                    checkProperty(messages, propertyDefinitionList.getMemberDefinition(), prop);
                }
            } else if (property instanceof PropertyMap) {
                PropertyMap propertyMap = (PropertyMap) property;
                PropertyDefinitionMap propertyDefinitionMap = (PropertyDefinitionMap) propertyDefinition;
                for (Map.Entry<String,Property> entry : propertyMap.getMap().entrySet()) {
                    Property prop = entry.getValue();
                    PropertyDefinition definition = propertyDefinitionMap.get(name);
                    checkProperty(messages,definition,prop);
                }
            }
View Full Code Here

        list2.add(new PropertySimple("x", "y"));
        assert c1.equals(c2);
        assert c2.equals(c1);

        PropertyMap map1 = new PropertyMap("mapB");
        map1.setMap(new HashMap<String, Property>());
        c1.put(map1);
        PropertyMap map2 = new PropertyMap("mapB");
        map1.setMap(null);
        c2.put(map2);
        assert c1.equals(c2); // empty map is the same as a null map
        assert c2.equals(c1);

        map1.put(new PropertySimple("m", "n"));
        assert !c1.equals(c2);
        assert !c2.equals(c1);

        map2.put(new PropertySimple("m", "n"));
        assert c1.equals(c2);
        assert c2.equals(c1);

        map1.put(list1);
        map2.put(list2);
        assert c1.equals(c2); // innerList is empty, so its same as a null
        assert c2.equals(c1);
        list1.add(new PropertySimple("x", "z"));
        assert !c1.equals(c2);
        assert !c2.equals(c1);
View Full Code Here

            em.flush();
            em.refresh(c2);
            assert c1.equals(c2);
            assert c2.equals(c1);

            PropertyMap map1 = new PropertyMap("mapB");
            map1.setMap(new HashMap<String, Property>());
            c1.put(map1);
            PropertyMap map2 = new PropertyMap("mapB");
            map1.setMap(null);
            c2.put(map2);
            em.flush();
            em.refresh(c2);
            assert c1.equals(c2); // empty map is the same as a null map
            assert c2.equals(c1);

            map1.put(new PropertySimple("m", "n"));
            assert !c1.equals(c2);
            assert !c2.equals(c1);

            map2.put(new PropertySimple("m", "n"));
            em.flush();
            em.refresh(c2);
            assert c1.equals(c2);
            assert c2.equals(c1);

            map1.put(list1);
            map2.put(list2);
            em.flush();
            em.refresh(c2);
            assert c1.equals(c2); // innerList is empty, so its same as a null
            assert c2.equals(c1);
            list1.add(new PropertySimple("x", "z"));
View Full Code Here

    public void testMapCompare() {
        Configuration c1 = new Configuration();
        Configuration c2 = new Configuration();

        c1.put(new PropertyMap("mapA", new Property[] { new PropertySimple("uno", "111") }));
        c2.put(new PropertyMap("mapA", new Property[] { new PropertySimple("dos", "222") }));

        assert c1.equals(c1); // can compare itself
        assert c2.equals(c2); // can compare itself
        assert !c1.equals(c2);
        assert !c2.equals(c1);
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.configuration.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.