KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis > tools > ant > wsdl > MappingSet


1 /*
2  * Copyright 2002,2004 The Apache Software Foundation.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */

16
17
18 package org.apache.axis.tools.ant.wsdl;
19
20 import org.apache.tools.ant.ProjectComponent;
21
22 import java.util.HashMap JavaDoc;
23 import java.util.Iterator JavaDoc;
24 import java.util.LinkedList JavaDoc;
25 import java.util.List JavaDoc;
26
27 /**
28  *a mappingset is a set of mappings
29  */

30 public class MappingSet implements Mapper {
31
32     List JavaDoc mappings=new LinkedList JavaDoc();
33
34     /**
35      * add a new mapping
36      * @param mapping
37      */

38     public void addMapping(NamespaceMapping mapping) {
39         mappings.add(mapping);
40     }
41
42     /**
43      * add a mappingset inside this one
44      * @param mappingset
45      */

46     public void addMappingSet(MappingSet mappingset) {
47         mappings.add(mappingset);
48     }
49
50     /**
51      * execute by mapping everything iteratively and recursively
52      * @param owner owner task
53      * @param map map to map into
54      * @param packageIsKey if the package is to be the key for the map
55      */

56     public void execute(ProjectComponent owner, HashMap JavaDoc map, boolean packageIsKey) {
57         Iterator JavaDoc it=mappings.iterator();
58         while (it.hasNext()) {
59             Mapper mapper = (Mapper) it.next();
60             mapper.execute(owner,map, packageIsKey);
61         }
62     }
63 }
64
Popular Tags