KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > coach > idltree > IdlWriter


1 /***************************************************************************/
2 /* COACH: Component Based Open Source Architecture for */
3 /* Distributed Telecom Applications */
4 /* See: http://www.objectweb.org/ */
5 /* */
6 /* Copyright (C) 2003 Lucent Technologies Nederland BV */
7 /* Bell Labs Advanced Technologies - EMEA */
8 /* */
9 /* Initial developer(s): Harold Batteram */
10 /* */
11 /* This library is free software; you can redistribute it and/or */
12 /* modify it under the terms of the GNU Lesser General Public */
13 /* License as published by the Free Software Foundation; either */
14 /* version 2.1 of the License, or (at your option) any later version. */
15 /* */
16 /* This library is distributed in the hope that it will be useful, */
17 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
18 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */
19 /* Lesser General Public License for more details. */
20 /* */
21 /* You should have received a copy of the GNU Lesser General Public */
22 /* License along with this library; if not, write to the Free Software */
23 /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
24 /***************************************************************************/
25 package org.coach.idltree;
26
27 /**
28  * Interface IdlWriter is used to write the content of an IdlNode derived type
29  * as a formated string. For example class XmlWriter implements this interface to write
30  * IdlNode values to XML format.
31  *
32  * @author <a HREF="mailto:batteram@lucent.com">Harold Batteram</a> <b>Lucent Technologies</b>
33  */

34 public interface IdlWriter {
35     /**
36      * Resets the output buffer of the IdlWriter.
37      */

38     public void clear();
39     
40     /**
41      * Writes the value of a fixed IDL type to the IdlWriter.
42      *
43      * @param v The value of the fixed type.
44      */

45     public void write_fixed(String JavaDoc v);
46     
47     /**
48      * Writes the value of a double IDL type to the IdlWriter.
49      *
50      * @param v The value of the double type.
51      */

52     public void write_double(String JavaDoc v);
53
54     /**
55      * Writes the value of a float IDL type to the IdlWriter.
56      *
57      * @param v The value of the float type.
58      */

59     public void write_float(String JavaDoc v);
60
61     /**
62      * Writes the value of a long double IDL type to the IdlWriter.
63      *
64      * @param v The value of the long double type.
65      */

66     public void write_longdouble(String JavaDoc v);
67
68     /**
69      * Writes the value of a unsigned long long IDL type to the IdlWriter.
70      *
71      * @param v The value of the unsigned long long type.
72      */

73     public void write_ulonglong(String JavaDoc v);
74
75     /**
76      * Writes the value of a long long IDL type to the IdlWriter.
77      *
78      * @param v The value of the long long type.
79      */

80     public void write_longlong(String JavaDoc v);
81
82     /**
83      * Writes the value of a unsigned long IDL type to the IdlWriter.
84      *
85      * @param v The value of the unsigned long type.
86      */

87     public void write_ulong(String JavaDoc v);
88
89     /**
90      * Writes the value of a long IDL type to the IdlWriter.
91      *
92      * @param v The value of the long type.
93      */

94     public void write_long(String JavaDoc v);
95
96     /**
97      * Writes the value of a unsigned short IDL type to the IdlWriter.
98      *
99      * @param v The value of the unsigned short type.
100      */

101     public void write_ushort(String JavaDoc v);
102
103     /**
104      * Writes the value of a short IDL type to the IdlWriter.
105      *
106      * @param v The value of the short type.
107      */

108     public void write_short(String JavaDoc v);
109
110     /**
111      * Writes the value of a octet IDL type to the IdlWriter.
112      *
113      * @param v The value of the octet type.
114      */

115     public void write_octet(String JavaDoc v);
116
117     /**
118      * Writes the value of a boolean IDL type to the IdlWriter.
119      *
120      * @param v The value of the boolean type.
121      */

122     public void write_boolean(String JavaDoc v);
123
124     /**
125      * Writes the value of a char IDL type to the IdlWriter.
126      *
127      * @param v The value of the char type.
128      */

129     public void write_char(String JavaDoc v);
130
131     /**
132      * Writes the value of a wchar IDL type to the IdlWriter.
133      *
134      * @param v The value of the wchar type.
135      */

136     public void write_wchar(String JavaDoc v);
137
138     /**
139      * Writes the value of a string IDL type to the IdlWriter.
140      *
141      * @param v The value of the string type.
142      */

143     public void write_string(String JavaDoc v);
144
145     /**
146      * Writes the value of a wstring IDL type to the IdlWriter.
147      *
148      * @param v The value of the wstring type.
149      */

150     public void write_wstring(String JavaDoc v);
151
152     /**
153      * Writes the value of a object IDL type to the IdlWriter.
154      *
155      * @param v The ior value of the object type.
156      */

157     public void write_Object(String JavaDoc v);
158
159     /**
160      * Writes the value of a sequence IDL type to the IdlWriter.
161      *
162      * A sequence is a nested type with zero or more elements.
163      * A write_start_sequence operation must be followed by zero or more other write
164      * operations which correspond with the sequence element types and must be closed by
165      * a write_end_sequence operation.
166      *
167      * @param id The repository id of the sequence or an empty string for anonymous sequences.
168      * @param length The number of sequence elements.
169      */

170     public void write_start_sequence(String JavaDoc id, int length);
171
172     /**
173      * Closes the nested sequence IDL type.
174      */

175     public void write_end_sequence();
176
177     /**
178      * Writes the value of a array IDL type to the IdlWriter.
179      *
180      * An array is a nested type with zero or more elements.
181      * A write_start_array operation must be followed by zero or more other write
182      * operations which correspond with the array element types and must be closed by
183      * a write_end_array operation.
184      *
185      * @param id The repository id of the array or an empty string for anonymous arrays.
186      * @param length The number of array elements.
187      */

188     public void write_start_array(String JavaDoc id, int length);
189
190     /**
191      * Closes the nested array IDL type.
192      */

193     public void write_end_array();
194
195     /**
196      * Writes the value of a struct IDL type to the IdlWriter.
197      *
198      * A struct is a nested type with one or more member elements.
199      * A write_start_struct operation must be followed by one or more other write_start_member
200      * and write_end_member operations for each struct member and must be closed by
201      * a write_end_struct operation.
202      *
203      * @param id The repository id of the struct.
204      */

205     public void write_start_struct(String JavaDoc id);
206
207     /**
208      * Writes the name of a struct or union member IDL type to the IdlWriter.
209      *
210      * The write_start_member operation must be followed by a write operation
211      * corresponding with the member type and must be closed by a write_end_member operation.
212      *
213      * @param name The name of the struct or union member.
214      */

215     public void write_start_member(String JavaDoc name);
216
217     /**
218      * Closes the nested struct or union member IDL type.
219      */

220     public void write_end_member();
221
222     /**
223      * Closes the nested struct or union IDL type.
224      */

225     public void write_end_struct();
226
227     /**
228      * Writes the value of a union IDL type to the IdlWriter.
229      *
230      * A union is a nested type with one member element.
231      * A write_start_union operation must be followed by one write_union_tag operation and one write_start_member
232      * and write_end_member operation for the union member and must be closed by
233      * a write_end_union operation.
234      *
235      * @param id The repository id of the union.
236      */

237     public void write_start_union(String JavaDoc id);
238     
239     /**
240      * Writes the tag value of a union IDL type to the IdlWriter.
241      *
242      * @param v The tag value of the union.
243      */

244     public void write_union_tag(String JavaDoc v);
245     
246     /**
247      * Closes the nested union IDL type.
248      */

249     public void write_end_union();
250
251     /**
252      * Writes the value of a valuetype IDL type to the IdlWriter.
253      *
254      * A valuetype is a nested type with one or more member elements.
255      * A write_start_value operation must be followed by one or more other write_start_member
256      * and write_end_member operations for each struct member and must be closed by
257      * a write_end_value operation.
258      *
259      * @param id The repository id of the struct.
260      */

261     public void write_start_value(String JavaDoc id);
262     
263     /**
264      * Closes the nested valuetype IDL type.
265      */

266     public void write_end_value();
267
268     /**
269      * Writes the value of a enum IDL type to the IdlWriter.
270      *
271      * @param id The repository id of the enum.
272      * @param v The value of the enum.
273      */

274     public void write_enum(String JavaDoc id, String JavaDoc v);
275
276     /**
277      * Writes the ior value of a interface IDL type to the IdlWriter.
278      *
279      * @param id The repository id of the interface.
280      * @param v The ior value of the interface reference.
281      */

282     public void write_interface(String JavaDoc id, String JavaDoc ior);
283
284     /**
285      * Writes the ior value of a CCM component IDL type to the IdlWriter.
286      *
287      * @param id The repository id of the component.
288      * @param v The ior value of the component reference.
289      */

290     public void write_component(String JavaDoc id, String JavaDoc ior);
291
292     /**
293      * Writes the name and type value of an IDL operation to the IdlWriter.
294      *
295      * The write_start_operation operation must be followed by a write operation corresponding
296      * to the operation in and inout parameters and must be closed with a write_end_operation operation.
297      *
298      * @param name The name of the operation.
299      * @param id The repository id of the interface to which the operation belongs.
300      */

301     public void write_start_operation(String JavaDoc name, String JavaDoc id);
302
303     /**
304      * Writes the name of an 'in' operation parameter.
305      *
306      * The write_start_in operation must be followed by a write operation corresponding
307      * to the type of the parameter and must be closed with a write_end_inpar operation.
308      *
309      * @param name The name of the parameter.
310      */

311     public void write_start_inpar(String JavaDoc name);
312
313     /**
314      * Closes the nested write_start_inpar operation.
315      */

316     public void write_end_inpar();
317     
318     /**
319      * Writes the name of an 'out' operation parameter.
320      *
321      * The write_start_out operation must be followed by a write operation corresponding
322      * to the type of the parameter and must be closed with a write_end_outpar operation.
323      *
324      * @param name The name of the parameter.
325      */

326     public void write_start_outpar(String JavaDoc name);
327
328     /**
329      * Closes the nested write_start_outpar operation.
330      */

331     public void write_end_outpar();
332     
333     /**
334      * Writes the name of an 'inout' operation parameter.
335      *
336      * The write_start_inout operation must be followed by a write operation corresponding
337      * to the type of the parameter and must be closed with a write_end_inoutpar operation.
338      *
339      * @param name The name of the parameter.
340      */

341     public void write_start_inoutpar(String JavaDoc name);
342         
343     /**
344      * Closes the nested write_start_inoutpar operation.
345      */

346     public void write_end_inoutpar();
347
348     /**
349      * Writes the return value of an operation.
350      *
351      * The write_start_return operation must be followed by a write operation corresponding
352      * to the return type of the operation and must be closed with a write_end_return operation.
353      */

354     public void write_start_return();
355
356     /**
357      * Closes the nested write_start_return operation.
358      */

359     public void write_end_return();
360
361     /**
362      * Writes the exception value of an operation.
363      *
364      * The write_start_exception operation can be followed by a start_write_member operations corresponding
365      * to the members of the exception and must be closed with a write_end_exception operation.
366      *
367      * @param id The repository id of the exception.
368      */

369     public void write_start_exception(String JavaDoc id);
370
371     /**
372      * Closes the nested write_start_exception operation.
373      */

374     public void write_end_exception();
375     
376     /**
377      * Closes the nested write_start_operation operation.
378      */

379     public void write_end_operation();
380
381     /**
382      * Writes the name and type value of the reply of an IDL operation to the IdlWriter.
383      *
384      * The write_start_reply operation must be followed by a write operation corresponding
385      * to the operation out and inout parameters and return value or exception value and
386      * must be closed with a write_end_operation operation.
387      *
388      * @param name The name of the operation.
389      * @param id The repository id of the interface to which the operation belongs.
390      */

391     public void write_start_reply(String JavaDoc name, String JavaDoc id);
392
393     /**
394      * Closes the nested write_start_reply operation.
395      */

396     public void write_end_reply();
397
398     /**
399      * Returns the content of the IdlWriter buffer as a String value.
400      *
401      * @return The content of the IdlWriter buffer as a String value.
402      */

403     public String JavaDoc toString();
404
405     /**
406      * Writes the value of a any IDL type to the IdlWriter.
407      *
408      * An any is a nested type with zero or one element.
409      * A write_start_any operation must be followed by zero or one other write
410      * operations which correspond with the content type of the any and must be closed by
411      * a write_end_any operation.
412      */

413     public void write_start_any();
414
415     /**
416      * Closes the nested write_start_any operation.
417      */

418     public void write_end_any();
419 }
Popular Tags