KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > flow > apples > AppleHelper


1 /*
2  * Copyright 1999-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 package org.apache.cocoon.components.flow.apples;
17
18 import java.util.HashMap JavaDoc;
19 import java.util.Iterator JavaDoc;
20 import java.util.List JavaDoc;
21 import java.util.Map JavaDoc;
22
23 import org.apache.cocoon.components.flow.Interpreter.Argument;
24
25 /**
26  * AppleHelper holds some static utility classes used in the Apples flow
27  * implementation.
28  */

29 public class AppleHelper {
30
31     /**
32      * Translates a List of Interpreter.Argument objects into a classic
33      * {@link java.util.Map}
34      */

35     public static Map JavaDoc makeMapFromArguments(List JavaDoc params) {
36         Map JavaDoc retMap = new HashMap JavaDoc();
37         for (Iterator JavaDoc iter = params.iterator(); iter.hasNext();) {
38             Argument element = (Argument) iter.next();
39             retMap.put(element.name, element.value);
40         }
41         return retMap;
42     }
43 }
44
Popular Tags