KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > modules > input > InputModule


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
17 package org.apache.cocoon.components.modules.input;
18
19 import org.apache.avalon.framework.component.Component;
20 import org.apache.avalon.framework.configuration.Configuration;
21 import org.apache.avalon.framework.configuration.ConfigurationException;
22
23 import java.util.Iterator JavaDoc;
24 import java.util.Map JavaDoc;
25
26 /**
27  * InputModule specifies an interface for components that provide
28  * access to individual attributes e.g. request parameters, request
29  * attributes, session attributes &c.
30  *
31  * @author <a HREF="mailto:haul@apache.org">Christian Haul</a>
32  * @version CVS $Id: InputModule.java 30932 2004-07-29 17:35:38Z vgritsenko $
33  */

34 public interface InputModule extends Component {
35
36     String JavaDoc ROLE = InputModule.class.getName();
37
38
39     /**
40      * Standard access to an attribute's value. If more than one value
41      * exists, the first is returned. If the value does not exist,
42      * null is returned. To get all values, use
43      * {@link #getAttributeValues(String, Configuration, Map)} or
44      * {@link #getAttributeNames(Configuration, Map)} and
45      * {@link #getAttribute(String, Configuration, Map)} to get them one by one.
46      * @param name a String that specifies what the caller thinks
47      * would identify an attribute. This is mainly a fallback if no
48      * modeConf is present.
49      * @param modeConf column's mode configuration from resource
50      * description. This argument is optional.
51      * @param objectModel
52      */

53     Object JavaDoc getAttribute( String JavaDoc name, Configuration modeConf, Map JavaDoc objectModel ) throws ConfigurationException;
54
55
56     /**
57      * Returns an Iterator of String objects containing the names
58      * of the attributes available. If no attributes are available,
59      * the method returns an empty Iterator.
60      * @param modeConf column's mode configuration from resource
61      * description. This argument is optional.
62      * @param objectModel
63      */

64     Iterator JavaDoc getAttributeNames( Configuration modeConf, Map JavaDoc objectModel ) throws ConfigurationException;
65
66
67     /**
68      * Returns an array of String objects containing all of the values
69      * the given attribute has, or null if the attribute does not
70      * exist. As an alternative,
71      * {@link #getAttributeNames(Configuration, Map)} together with
72      * {@link #getAttribute(String, Configuration, Map)} can be used to get the
73      * values one by one.
74      * @param name a String that specifies what the caller thinks
75      * would identify an attributes. This is mainly a fallback
76      * if no modeConf is present.
77      * @param modeConf column's mode configuration from resource
78      * description. This argument is optional.
79      * @param objectModel
80      */

81     Object JavaDoc[] getAttributeValues( String JavaDoc name, Configuration modeConf, Map JavaDoc objectModel ) throws ConfigurationException;
82
83 }
84
Popular Tags