2 * Copyright 2005-2011 the original author or authors.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.wamblee.xmlrouter.impl;
18 import java.util.Collection;
20 import org.wamblee.xmlrouter.common.Id;
21 import org.wamblee.xmlrouter.config.Config;
22 import org.wamblee.xmlrouter.config.DocumentType;
23 import org.wamblee.xmlrouter.config.Filter;
24 import org.wamblee.xmlrouter.config.RouterConfig;
25 import org.wamblee.xmlrouter.config.Transformation;
27 public class CompositeRouterConfig implements ExtendedRouterConfig {
29 private static final Id<RouterConfig> ID = new Id<RouterConfig>(
30 "compositerouterconfig");
31 private CompositeConfig<DocumentType> documentTypes;
32 private CompositeConfig<Transformation> transformations;
33 private CompositeConfig<Filter> filters;
35 public CompositeRouterConfig(Id<RouterConfig> aId,
36 Collection<RouterConfig> aConfigs) {
37 documentTypes = new CompositeConfig<DocumentType>(DocumentType.class);
38 transformations = new CompositeConfig<Transformation>(
39 Transformation.class);
40 filters = new CompositeConfig<Filter>(Filter.class);
41 for (RouterConfig config : aConfigs) {
42 documentTypes.addConfig(config.documentTypeConfig());
43 transformations.addConfig(config.transformationConfig());
44 filters.addConfig(config.filterConfig());
49 public Id<RouterConfig> getId() {
54 public Config<DocumentType> documentTypeConfig() {
59 public Config<Transformation> transformationConfig() {
60 return transformations;
64 public Config<Filter> filterConfig() {