Package org.constretto.model

Examples of org.constretto.model.TaggedPropertySet


    }

    private List<TaggedPropertySet> createTaggedPropertySetsFromProperties(Map<String, String> properties) {
        List<TaggedPropertySet> taggedPropertySets = new ArrayList<TaggedPropertySet>(tags.size());
        for (String tag : tags) {
            taggedPropertySets.add(new TaggedPropertySet(tag, properties, getClass()));
        }
        return taggedPropertySets;
    }
View Full Code Here


            properties.put(keyAsString, getProperty(keyAsString));
        }

        return new ArrayList<TaggedPropertySet>() {
            {
                add(new TaggedPropertySet(ConfigurationValue.ALL_TAG, properties, SystemPropertiesStore.class));
            }
        };
    }
View Full Code Here

     */
    private List<TaggedPropertySet> getPropertySets() {
        List<TaggedPropertySet> taggedPropertySets = new ArrayList<TaggedPropertySet>();
        Set<String> tags = getTags(this.properties);
        for (String tag : tags) {
            taggedPropertySets.add(new TaggedPropertySet(tag, getPropertiesByTag(tag, this.properties), getClass()));
        }
        Map<String, String> unTaggedProperties = getUnTaggedProperties(this.properties);
        if (!unTaggedProperties.isEmpty()) {
            taggedPropertySets.add(new TaggedPropertySet(getUnTaggedProperties(this.properties), getClass()));
        }
        return taggedPropertySets;
    }
View Full Code Here

                        properties.put(key, value);
                    }
                    if (tag.equals(DEFAULT_TAG)) {
                        tag = ConfigurationValue.DEFAULT_TAG;
                    }
                    TaggedPropertySet taggedPropertySet = new TaggedPropertySet(tag, properties, getClass());
                    taggedPropertySets.add(taggedPropertySet);
                }
            }
        }
        return taggedPropertySets;
View Full Code Here

            TaggedResource taggedResource = entry.getValue();
            if (taggedResource.resource.exists()) {
                if (taggedResource.tags.isEmpty()) {
                    HashMap<String, String> property = new HashMap<String, String>();
                    property.put(entry.getKey(), readJson(taggedResource.resource));
                    properties.add(new TaggedPropertySet(property, JsonStore.class));
                } else {
                    for (String tag : taggedResource.tags) {
                        HashMap<String, String> property = new HashMap<String, String>();
                        property.put(entry.getKey(), readJson(taggedResource.resource));
                        properties.add(new TaggedPropertySet(tag, property, JsonStore.class));
                    }
                }
            }
        }
        return properties;
View Full Code Here

    }

    public Collection<TaggedPropertySet> parseConfiguration() {
        Map<String, TaggedPropertySet> propertySets = new HashMap<String, TaggedPropertySet>();
        for (Object configurationObject : configurationObjects) {
            TaggedPropertySet taggedPropertySet = createPropertySetForObject(configurationObject);
            if (propertySets.containsKey(taggedPropertySet.tag())) {
                TaggedPropertySet orginialSet = propertySets.get(taggedPropertySet.tag());
                orginialSet.getProperties().putAll(taggedPropertySet.getProperties());
                propertySets.put(taggedPropertySet.tag(), orginialSet);
            } else {
                propertySets.put(taggedPropertySet.tag(), taggedPropertySet);
            }
        }
View Full Code Here

                }
            }

        }

        return new TaggedPropertySet(tag, properties, getClass());
    }
View Full Code Here

        final String tag = "tag";
        final Collection<TaggedPropertySet> taggedPropertySets = new LdapConfigurationStore(new LdapConfigurationStore(),
                attributes, tag).parseConfiguration();
        assertEquals(1, taggedPropertySets.size());
        final TaggedPropertySet taggedPropertySet = taggedPropertySets.iterator().next();
        assertEquals(tag, taggedPropertySet.tag());
        assertEquals(0, taggedPropertySet.getProperties().size());

        verify(attributes).getAll();
        verify(attributesNamingEnumeration, times(2)).hasMore();
        verify(attributesNamingEnumeration).next();
        verify(attribute).getID();
View Full Code Here

        final LdapConfigurationStore ldapConfigurationStore = new LdapConfigurationStore(new LdapConfigurationStore(),
                attributes, tag);
        final Collection<TaggedPropertySet> taggedPropertySets = ldapConfigurationStore.parseConfiguration();
        assertEquals(1, taggedPropertySets.size());

        final TaggedPropertySet taggedPropertySet = taggedPropertySets.iterator().next();
        assertEquals(tag, taggedPropertySet.tag());

        verify(attributes).getAll();
        verify(attributesNamingEnumeration, times(2)).hasMore();
        verify(attributesNamingEnumeration).next();
        verify(attribute, times(2)).getID();
View Full Code Here

TOP

Related Classes of org.constretto.model.TaggedPropertySet

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.