KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > pentaho > core > solution > IParameterProvider


1 /*
2  * Copyright 2006 Pentaho Corporation. All rights reserved.
3  * This software was developed by Pentaho Corporation and is provided under the terms
4  * of the Mozilla Public License, Version 1.1, or any later version. You may not use
5  * this file except in compliance with the license. If you need a copy of the license,
6  * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
7  * BI Platform. The Initial Developer is Pentaho Corporation.
8  *
9  * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11  * the license for the specific language governing your rights and limitations.
12  *
13  * @created Jun 17, 2005
14  * @author James Dixon
15  *
16  */

17
18 package org.pentaho.core.solution;
19
20 import java.util.*;
21
22 /**
23  * A ParameterProvider is a source for input, output or resource parameters for
24  * a given action. The parameter definitions exist within the
25  * SequenceDefinition. The values for the parameters are supplied from the
26  * ParameterProvider.
27  */

28 public interface IParameterProvider {
29
30     /**
31      * Retrieve the requested parameter as type java.lang.String
32      *
33      * @param name
34      * name of parameter to retrieve
35      * @param defaultValue
36      * value to return if the named parameter can not be found
37      * @return value of requested parameter, or the defaultValue if not found
38      */

39     public String JavaDoc getStringParameter(String JavaDoc name, String JavaDoc defaultValue);
40
41     /**
42      * Retrieve the requested parameter as primitive Java type long.
43      *
44      * @param name
45      * name of parameter to retrieve
46      * @param defaultValue
47      * value to return if the named parameter can not be found
48      * @return value of requested parameter, or the defaultValue if not found
49      */

50     public long getLongParameter(String JavaDoc name, long defaultValue);
51
52     /**
53      * Retrieve the requested parameter as type java.util.Date.
54      *
55      * @param name
56      * name of parameter to retrieve
57      * @param defaultValue
58      * value to return if the named parameter can not be found
59      * @return value of requested parameter, or the defaultValue if not found
60      */

61     public Date getDateParameter(String JavaDoc name, Date defaultValue);
62
63     /**
64      * Retrieve the requested parameter as decimal, returning a
65      * java.lang.Object.
66      *
67      * @param name
68      * name of parameter to retrieve
69      * @param defaultValue
70      * value to return if the named parameter can not be found
71      * @return value of requested parameter, or the defaultValue if not found
72      */

73     public Object JavaDoc getDecimalParameter(String JavaDoc name, Object JavaDoc defaultValue);
74
75     /**
76      * Return list of all avialable parameter names in this
77      * provider
78      *
79      * @return Set of parameter names
80      */

81     public Iterator getParameterNames();
82
83     /**
84      * Gets the named parameter from the provider as it's native type
85      * @param name The name of the parameter to retrieve
86      * @return The native object
87      */

88     public Object JavaDoc getParameter(String JavaDoc name);
89
90 }
91
Popular Tags