01: /*
02: * IzPack - Copyright 2001-2008 Julien Ponge, All Rights Reserved.
03: *
04: * http://izpack.org/
05: * http://izpack.codehaus.org/
06: *
07: * Copyright 2003 Elmar Grom
08: *
09: * Licensed under the Apache License, Version 2.0 (the "License");
10: * you may not use this file except in compliance with the License.
11: * You may obtain a copy of the License at
12: *
13: * http://www.apache.org/licenses/LICENSE-2.0
14: *
15: * Unless required by applicable law or agreed to in writing, software
16: * distributed under the License is distributed on an "AS IS" BASIS,
17: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18: * See the License for the specific language governing permissions and
19: * limitations under the License.
20: */
21:
22: package com.izforge.izpack.panels;
23:
24: import java.util.Map;
25:
26: /*---------------------------------------------------------------------------*/
27: /**
28: * Implement this interface in any class that wants to use processing or validation services.
29: *
30: * @see com.izforge.izpack.panels.Processor
31: * @see com.izforge.izpack.panels.Validator
32: *
33: * @version 0.0.1 / 2/22/03
34: * @author Elmar Grom
35: */
36: /*---------------------------------------------------------------------------*/
37: public interface ProcessingClient {
38:
39: /*--------------------------------------------------------------------------*/
40: /**
41: * Returns the number of sub-fields.
42: *
43: * @return the number of sub-fields
44: */
45: /*--------------------------------------------------------------------------*/
46: public int getNumFields();
47:
48: /*--------------------------------------------------------------------------*/
49: /**
50: * Returns the contents of the field indicated by <code>index</code>.
51: *
52: * @param index the index of the sub-field from which the contents is requested.
53: *
54: * @return the contents of the indicated sub-field.
55: *
56: * @exception IndexOutOfBoundsException if the index is out of bounds.
57: */
58: /*--------------------------------------------------------------------------*/
59: public String getFieldContents(int index);
60:
61: // These newly added fields are similar to the functionality provided
62: // by the multiple validator support using the validator container.
63:
64: /*---------------------------------------------------------------------------*/
65: /**
66: * Returns the field contents.
67: *
68: * @return the field contents
69: */
70: /*--------------------------------------------------------------------------*/
71: public String getText();
72:
73: /*--------------------------------------------------------------------------*/
74: /**
75: * @return true if this instance has any parameters to pass to the Validator instance.
76: */
77: /*--------------------------------------------------------------------------*/
78: public boolean hasParams();
79:
80: /*--------------------------------------------------------------------------*/
81: /**
82: * Returns the validator parameters, if any. The caller should check for the existence of
83: * validator parameters via the <code>hasParams()</code> method prior to invoking this method.
84: *
85: * @return a java.util.Map containing the validator parameters.
86: */
87: /*--------------------------------------------------------------------------*/
88: public Map<String, String> getValidatorParams();
89:
90: }
91: /*---------------------------------------------------------------------------*/
|