01: /*
02: * Copyright 2006 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
07: * BI Platform. The Initial Developer is Pentaho Corporation.
08: *
09: * 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 getStringParameter(String name, String 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 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 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 getDecimalParameter(String name, Object 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 getParameter(String name);
89:
90: }
|