01: package org.objectweb.celtix.configuration.impl;
02:
03: import java.util.Collection;
04: import java.util.HashMap;
05: import java.util.Map;
06:
07: import org.objectweb.celtix.configuration.ConfigurationItemMetadata;
08: import org.objectweb.celtix.configuration.ConfigurationMetadata;
09:
10: public class ConfigurationMetadataImpl implements ConfigurationMetadata {
11:
12: private final Map<String, ConfigurationItemMetadata> definitions;
13: private String namespaceURI;
14: private String parentNamespaceURI;
15:
16: public ConfigurationMetadataImpl() {
17: definitions = new HashMap<String, ConfigurationItemMetadata>();
18: }
19:
20: protected void addItem(ConfigurationItemMetadata item) {
21: definitions.put(item.getName(), item);
22: }
23:
24: public String getNamespaceURI() {
25: return namespaceURI;
26: }
27:
28: public String getParentNamespaceURI() {
29: return parentNamespaceURI;
30: }
31:
32: public ConfigurationItemMetadata getDefinition(String name) {
33: return definitions.get(name);
34: }
35:
36: public Collection<ConfigurationItemMetadata> getDefinitions() {
37: return definitions.values();
38: }
39:
40: protected void setNamespaceURI(String uri) {
41: namespaceURI = uri;
42: }
43:
44: protected void setParentNamespaceURI(String uri) {
45: parentNamespaceURI = uri;
46: }
47: }
|