1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65 package com.ivata.mask;
66 import java.io.IOException;
67 import java.io.InputStream;
68 import com.ivata.mask.field.Field;
69 import com.ivata.mask.group.Group;
70 /***
71 * An instance of this interface is used to generate all masks and groups in the
72 * project.
73 *
74 * @since ivata masks 0.1 (2004-05-14)
75 * @author Colin MacLeod
76 * <a href='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
77 * @version $Revision: 1.5 $
78 * @see DefaultMaskFactory
79 */
80 public interface MaskFactory {
81 /***
82 * <p>
83 * Get the name of the default mask/screen used for user input.
84 * </p>
85 *
86 * @return name of the default mask/screen used for user input.
87 */
88 String getDefaultInputMask();
89 /***
90 * <p>
91 * Get the name of the default mask/screen used to list a base class.
92 * </p>
93 *
94 * @return name of the default mask/screen used to list a base class.
95 */
96 String getDefaultListMask();
97 /***
98 * <p>
99 * Get a group definition referenced by its id.
100 * </p>
101 *
102 * @param id
103 * unique identifier of the group.
104 * @return Group definition with the id provided, or <code>null</code> if
105 * there is no such group.
106 */
107 Group getGroup(String id);
108 /***
109 * <p>
110 * Get a mask, identified by its class and type.
111 * </p>
112 *
113 * @param valueObjectClass
114 * class of value object for the mask to be returned.
115 * @param type
116 * optional parameter defining multiple masks for the same value
117 * object. May be <code>null</code>.
118 * @return Mask definition with the id provided, or <code>null</code> if
119 * there is no such mask.
120 */
121 Mask getMask(Class valueObjectClass, String type);
122 /***
123 * <p>
124 * Get the default mask for a value object class.
125 * </p>
126 *
127 * @param valueObjectClass
128 * class of value object for the mask to be returned.
129 * @return Mask definition with the id provided, or <code>null</code> if
130 * there is no such mask.
131 */
132 Mask getMask(Class valueObjectClass);
133 /***
134 * <p>
135 * Get a mask, identified by its parent field, and class. This returns the
136 * input mask for the subclassed field.
137 * </p>
138 *
139 * @param parentField
140 * If this mask applies to a field within another mask, (known as
141 * a submask) this is the field to which it applies, otherwise
142 * use the other <code>getMask</code> method.
143 * @param valueObjectClass
144 * class of value object for the mask to be returned.
145 * @return Mask definition with the id provided, or <code>null</code> if
146 * there is no such mask.
147 */
148 Mask getMask(Field parentField, Class valueObjectClass);
149 /***
150 * <p>
151 * Discover whether or not this object has been configured.
152 * </p>
153 *
154 * @return <code>true</code> if the object has been configured, otherwise
155 * <code>false</code>.
156 */
157 boolean isConfigured();
158 /***
159 * <p>
160 * Get the configuration represented by the document provided.
161 * </p>
162 *
163 * @param inputStream
164 * The input stream to read the XML from.
165 * @throws IOException
166 * If there is any problem reading from the stream provided.
167 */
168 void readConfiguration(InputStream inputStream) throws IOException;
169 }