Config no longer implements Identifiable because this was in violation of the contrac...
[xmlrouter] / config / src / main / java / org / wamblee / xmlrouter / config / Configuration.java
diff --git a/config/src/main/java/org/wamblee/xmlrouter/config/Configuration.java b/config/src/main/java/org/wamblee/xmlrouter/config/Configuration.java
new file mode 100644 (file)
index 0000000..f758fdc
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2005-2011 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.wamblee.xmlrouter.config;
+
+import java.util.Collection;
+
+/**
+ * This class represents a particular configuration of the XML router as
+ * provided by one configuration provider. There can be multiple configuration
+ * providers, each providing it's own part of the configuration.
+ * 
+ * @author Erik Brakkee
+ */
+public final class Configuration {
+
+    private Collection<DocumentType> documentTypes;
+    private Collection<Transformation> transformations;
+    private Collection<Filter> filters;
+
+    /**
+     * Constructs the configuration object. Null objects will be ignored.
+     * DocumentTypes must have unique content-based ids (see
+     * {@link Identifiable}), with the same for transformations and filters.
+     * Objects with the same id as another object processed earlier will be
+     * ignored.
+     * 
+     * @param aDocumentTypes
+     *            Document types.
+     * @param aTransformations
+     *            Transformations.
+     * @param aFilters
+     *            Filters.
+     */
+    public Configuration(Collection<DocumentType> aDocumentTypes,
+        Collection<Transformation> aTransformations, Collection<Filter> aFilters) {
+        documentTypes = aDocumentTypes;
+        transformations = aTransformations;
+    }
+
+    public Collection<DocumentType> getDocumentTypes() {
+        return documentTypes;
+    }
+
+    public Collection<Transformation> getTransformations() {
+        return transformations;
+    }
+
+    public Collection<Filter> getFilters() {
+        return filters;
+    }
+}