KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > management > openmbean > OpenMBeanParameterInfoSupport


1 /*
2  * @(#)OpenMBeanParameterInfoSupport.java 3.28 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7  
8
9 package javax.management.openmbean;
10
11
12 // java import
13
//
14
import java.io.Serializable JavaDoc;
15 import java.util.Set JavaDoc;
16 import java.util.HashSet JavaDoc;
17 import java.util.Collections JavaDoc;
18 import java.lang.Comparable JavaDoc; // to be substituted for jdk1.1.x
19

20
21 // jmx import
22
//
23
import javax.management.MBeanParameterInfo JavaDoc;
24
25
26 /**
27  * Describes a parameter used in one or more operations or constructors of an open MBean.
28  *
29  * @version 3.28 03/12/19
30  * @author Sun Microsystems, Inc.
31  *
32  * @since 1.5
33  * @since.unbundled JMX 1.1
34  */

35 public class OpenMBeanParameterInfoSupport
36     extends MBeanParameterInfo JavaDoc
37     implements OpenMBeanParameterInfo JavaDoc, Serializable JavaDoc {
38     
39     
40     /* Serial version */
41     static final long serialVersionUID = -7235016873758443122L;
42
43     /**
44      * @serial The open mbean parameter's <i>open type</i>
45      */

46     private OpenType JavaDoc openType;
47
48     /**
49      * @serial The open mbean parameter's default value
50      */

51     private Object JavaDoc defaultValue = null;
52
53     /**
54      * @serial The open mbean parameter's legal values. This {@link Set} is unmodifiable
55      */

56     private Set JavaDoc legalValues = null; // to be constructed unmodifiable
57

58     /**
59      * @serial The open mbean parameter's min value
60      */

61     private Comparable JavaDoc minValue = null;
62
63     /**
64      * @serial The open mbean parameter's max value
65      */

66     private Comparable JavaDoc maxValue = null;
67
68
69     private transient Integer JavaDoc myHashCode = null; // As this instance is immutable, these two values
70
private transient String JavaDoc myToString = null; // need only be calculated once.
71

72
73     /**
74      * Constructs an <tt>OpenMBeanParameterInfoSupport</tt> instance, which describes the parameter
75      * used in one or more operations or constructors of a class of open MBeans,
76      * with the specified <var>name</var>, <var>openType</var> and <var>description</var>.
77      *
78      * @param name cannot be a null or empty string.
79      *
80      * @param description cannot be a null or empty string.
81      *
82      * @param openType cannot be null.
83      *
84      * @throws IllegalArgumentException if <var>name</var> or <var>description</var> are null or empty string,
85      * or <var>openType</var> is null.
86      */

87     public OpenMBeanParameterInfoSupport(String JavaDoc name,
88                      String JavaDoc description,
89                      OpenType JavaDoc openType) {
90
91     // Construct parent's state
92
//
93
super(name, ( (openType==null) ? null : openType.getClassName() ), description);
94
95     // check parameters that should not be null or empty (unfortunately it is not done in superclass :-( ! )
96
//
97
if ( (name == null) || (name.trim().equals("")) ) {
98         throw new IllegalArgumentException JavaDoc("Argument name cannot be null or empty.");
99     }
100     if ( (description == null) || (description.trim().equals("")) ) {
101         throw new IllegalArgumentException JavaDoc("Argument description cannot be null or empty.");
102     }
103     if (openType == null) {
104         throw new IllegalArgumentException JavaDoc("Argument openType cannot be null.");
105     }
106
107     // Initialize this instance's specific state
108
//
109
this.openType = openType;
110     }
111
112
113     /**
114      * Constructs an <tt>OpenMBeanParameterInfoSupport</tt> instance, which describes the parameter
115      * used in one or more operations or constructors of a class of open MBeans,
116      * with the specified <var>name</var>, <var>openType</var>, <var>description</var> and <var>defaultValue</var>.
117      *
118      * @param name cannot be a null or empty string.
119      *
120      * @param description cannot be a null or empty string.
121      *
122      * @param openType cannot be null.
123      *
124      * @param defaultValue must be a valid value for the <var>openType</var> specified for this parameter;
125      * default value not supported for <tt>ArrayType</tt> and <tt>TabularType</tt>;
126      * can be null, in which case it means that no default value is set.
127      *
128      * @throws IllegalArgumentException if <var>name</var> or <var>description</var> are null or empty string,
129      * or <var>openType</var> is null.
130      *
131      * @throws OpenDataException if <var>defaultValue</var> is not a valid value for the specified <var>openType</var>,
132      * or <var>defaultValue</var> is non null and
133      * <var>openType</var> is an <tt>ArrayType</tt> or a <tt>TabularType</tt>.
134      */

135     public OpenMBeanParameterInfoSupport(String JavaDoc name,
136                      String JavaDoc description,
137                      OpenType JavaDoc openType,
138                      Object JavaDoc defaultValue) throws OpenDataException JavaDoc {
139
140     // First check and construct the part regarding name, openType and description
141
//
142
this(name, description, openType);
143
144     // Check and initialize defaultValue
145
//
146
if (defaultValue != null) {
147         // Default value not supported for ArrayType and TabularType
148
if ( (openType.isArray()) || (openType instanceof TabularType JavaDoc) ) {
149         throw new OpenDataException JavaDoc("Default value not supported for ArrayType and TabularType.");
150         }
151         // Check defaultValue's class
152
if ( ! openType.isValue(defaultValue) ) {
153         throw new OpenDataException JavaDoc("Argument defaultValue's class [\""+ defaultValue.getClass().getName() +
154                         "\"] does not match the one defined in openType[\""+ openType.getClassName() +"\"].");
155         }
156         // Then initializes defaultValue:
157
// no need to clone it: apart from arrays and TabularData, basic data types are immutable
158
this.defaultValue = defaultValue;
159     }
160     }
161
162     /**
163      * Constructs an <tt>OpenMBeanParameterInfoSupport</tt> instance, which describes the parameter
164      * used in one or more operations or constructors of a class of open MBeans,
165      * with the specified <var>name</var>, <var>openType</var>, <var>description</var>,
166      * <var>defaultValue</var> and <var>legalValues</var>.
167      *
168      * The contents of <var>legalValues</var> are internally dumped into an unmodifiable <tt>Set</tt>,
169      * so subsequent modifications of the array referenced by <var>legalValues</var> have no impact on
170      * this <tt>OpenMBeanParameterInfoSupport</tt> instance.
171      *
172      * @param name cannot be a null or empty string.
173      *
174      * @param description cannot be a null or empty string.
175      *
176      * @param openType cannot be null.
177      *
178      * @param defaultValue must be a valid value for the <var>openType</var> specified for this parameter;
179      * default value not supported for <tt>ArrayType</tt> and <tt>TabularType</tt>;
180      * can be null, in which case it means that no default value is set.
181      *
182      * @param legalValues each contained value must be valid for the <var>openType</var> specified for this parameter;
183      * legal values not supported for <tt>ArrayType</tt> and <tt>TabularType</tt>;
184      * can be null or empty.
185      *
186      * @throws IllegalArgumentException if <var>name</var> or <var>description</var> are null or empty string,
187      * or <var>openType</var> is null.
188      *
189      * @throws OpenDataException if <var>defaultValue</var> is not a valid value for the specified <var>openType</var>,
190      * or one value in <var>legalValues</var> is not valid for the specified <var>openType</var>,
191      * or <var>defaultValue</var> is non null and
192      * <var>openType</var> is an <tt>ArrayType</tt> or a <tt>TabularType</tt>,
193      * or <var>legalValues</var> is non null and non empty and
194      * <var>openType</var> is an <tt>ArrayType</tt> or a <tt>TabularType</tt>,
195      * or <var>legalValues</var> is non null and non empty and
196      * <var>defaultValue</var> is not contained in <var>legalValues</var>.
197      */

198     public OpenMBeanParameterInfoSupport(String JavaDoc name,
199                      String JavaDoc description,
200                      OpenType JavaDoc openType,
201                      Object JavaDoc defaultValue,
202                      Object JavaDoc[] legalValues) throws OpenDataException JavaDoc {
203
204     // First check and construct the part regarding name, openType, description and defaultValue
205
//
206
this(name, description, openType, defaultValue);
207
208     // Check and initialize legalValues
209
//
210
if ( (legalValues != null) && (legalValues.length > 0) ) {
211         // legalValues not supported for TabularType and arrays
212
if ( (openType instanceof TabularType JavaDoc) || (openType.isArray()) ) {
213         throw new OpenDataException JavaDoc("Legal values not supported for TabularType and arrays");
214         }
215         // Check legalValues are valid with openType
216
for (int i = 0; i < legalValues.length; i++ ) {
217         if ( ! openType.isValue(legalValues[i]) ) {
218             throw new OpenDataException JavaDoc("Element legalValues["+ i +"]="+ legalValues[i] +
219                         " is not a valid value for the specified openType ["+ openType.toString() +"].");
220         }
221         }
222         // dump the legalValues array content into a Set: ensures uniqueness of elements
223
// (and we could not keep the array reference as array content could be modified by the caller)
224
Set JavaDoc tmpSet = new HashSet JavaDoc(legalValues.length+1, 1);
225         for (int i = 0; i < legalValues.length; i++ ) {
226         tmpSet.add(legalValues[i]);
227         }
228         // initializes legalValues as an unmodifiable Set
229
this.legalValues = Collections.unmodifiableSet(tmpSet);
230     }
231
232     // Check that defaultValue is a legal value
233
//
234
if ( (this.hasDefaultValue()) && (this.hasLegalValues()) ) {
235         if ( ! this.legalValues.contains(defaultValue) ) {
236         throw new OpenDataException JavaDoc("defaultValue is not contained in legalValues");
237         }
238     }
239
240     }
241
242
243     /**
244      * Constructs an <tt>OpenMBeanParameterInfoSupport</tt> instance, which describes the parameter
245      * used in one or more operations or constructors of a class of open MBeans,
246      * with the specified <var>name</var>, <var>openType</var>, <var>description</var>,
247      * <var>defaultValue</var>, <var>minValue</var> and <var>maxValue</var>.
248      *
249      * It is possible to specify minimal and maximal values only for an open type
250      * whose values are <tt>Comparable</tt>.
251      *
252      * @param name cannot be a null or empty string.
253      *
254      * @param description cannot be a null or empty string.
255      *
256      * @param openType cannot be null.
257      *
258      * @param defaultValue must be a valid value for the <var>openType</var> specified for this parameter;
259      * default value not supported for <tt>ArrayType</tt> and <tt>TabularType</tt>;
260      * can be null, in which case it means that no default value is set.
261      *
262      * @param minValue must be valid for the <var>openType</var> specified for this parameter;
263      * can be null, in which case it means that no minimal value is set.
264      *
265      * @param maxValue must be valid for the <var>openType</var> specified for this parameter;
266      * can be null, in which case it means that no maximal value is set.
267      *
268      * @throws IllegalArgumentException if <var>name</var> or <var>description</var> are null or empty string,
269      * or <var>openType</var> is null.
270      *
271      * @throws OpenDataException if <var>defaultValue</var>, <var>minValue</var> or <var>maxValue</var>
272      * is not a valid value for the specified <var>openType</var>,
273      * or <var>defaultValue</var> is non null and
274      * <var>openType</var> is an <tt>ArrayType</tt> or a <tt>TabularType</tt>,
275      * or both <var>minValue</var> and <var>maxValue</var> are non-null and
276      * <tt>minValue.compareTo(maxValue) > 0</tt> is <tt>true</tt>,
277      * or both <var>defaultValue</var> and <var>minValue</var> are non-null and
278      * <tt>minValue.compareTo(defaultValue) > 0</tt> is <tt>true</tt>,
279      * or both <var>defaultValue</var> and <var>maxValue</var> are non-null and
280      * <tt>defaultValue.compareTo(maxValue) > 0</tt> is <tt>true</tt>.
281      */

282     public OpenMBeanParameterInfoSupport(String JavaDoc name,
283                      String JavaDoc description,
284                      OpenType JavaDoc openType,
285                      Object JavaDoc defaultValue,
286                      Comparable JavaDoc minValue,
287                      Comparable JavaDoc maxValue) throws OpenDataException JavaDoc {
288
289     // First check and construct the part regarding name, openType, description and defaultValue
290
//
291
this(name, description, openType, defaultValue);
292
293     // Check and initialize minValue
294
//(note: no need to worry about Composite, Tabular and arrays as they are not Comparable)
295
//
296
if (minValue != null) {
297         if ( ! openType.isValue(minValue) ) {
298         throw new OpenDataException JavaDoc("Argument minValue's class [\""+ minValue.getClass().getName() +
299                         "\"] does not match openType's definition [\""+ openType.getClassName() +"\"].");
300         }
301         // then initializes minValue
302
this.minValue = minValue;
303     }
304
305     // Check and initialize maxValue
306
//(note: no need to worry about Composite, Tabular and arrays as they are not Comparable)
307
//
308
if (maxValue != null) {
309         if ( ! openType.isValue(maxValue) ) {
310         throw new OpenDataException JavaDoc("Argument maxValue's class [\""+ maxValue.getClass().getName() +
311                         "\"] does not match openType's definition [\""+ openType.getClassName() +"\"].");
312         }
313         // then initializes maxValue
314
this.maxValue = maxValue;
315     }
316
317     // Check that, if both specified, minValue <= maxValue
318
//
319
if (hasMinValue() && hasMaxValue()) {
320         if (minValue.compareTo(maxValue) > 0) {
321         throw new OpenDataException JavaDoc("minValue cannot be greater than maxValue.");
322         }
323     }
324
325     // Check that minValue <= defaultValue <= maxValue
326
//
327
if ( (this.hasDefaultValue()) && (this.hasMinValue()) ) {
328         if (minValue.compareTo((Comparable JavaDoc)defaultValue) > 0) {
329         throw new OpenDataException JavaDoc("minValue cannot be greater than defaultValue.");
330         }
331     }
332     if ( (this.hasDefaultValue()) && (this.hasMaxValue()) ) {
333         if (((Comparable JavaDoc)defaultValue).compareTo(maxValue) > 0) {
334         throw new OpenDataException JavaDoc("defaultValue cannot be greater than maxValue.");
335         }
336     }
337     }
338
339     /**
340      * Returns the open type for the values of the parameter described by this <tt>OpenMBeanParameterInfoSupport</tt> instance.
341      */

342     public OpenType JavaDoc getOpenType() {
343     return openType;
344     }
345
346     /**
347      * Returns the default value for the parameter described by this <tt>OpenMBeanParameterInfoSupport</tt> instance,
348      * if specified, or <tt>null</tt> otherwise.
349      */

350     public Object JavaDoc getDefaultValue() {
351
352     // Special case for ArrayType and TabularType
353
// [JF] TODO: clone it so that it cannot be altered,
354
// [JF] TODO: if we decide to support defaultValue as an array itself.
355
// [JF] As of today (oct 2000) it is not supported so defaultValue is null for arrays. Nothing to do.
356

357     return defaultValue;
358     }
359
360     /**
361      * Returns an unmodifiable Set of legal values for the parameter described by this <tt>OpenMBeanParameterInfoSupport</tt> instance,
362      * if specified, or <tt>null</tt> otherwise.
363      */

364     public Set JavaDoc getLegalValues() {
365
366     // Special case for ArrayType and TabularType
367
// [JF] TODO: clone values so that they cannot be altered,
368
// [JF] TODO: if we decide to support LegalValues as an array itself.
369
// [JF] As of today (oct 2000) it is not supported so legalValues is null for arrays. Nothing to do.
370

371     // Returns our legalValues Set (set was constructed unmodifiable)
372
return (legalValues);
373     }
374
375     /**
376      * Returns the minimal value for the parameter described by this <tt>OpenMBeanParameterInfoSupport</tt> instance,
377      * if specified, or <tt>null</tt> otherwise.
378      */

379     public Comparable JavaDoc getMinValue() {
380
381     // Note: only comparable values have a minValue, so that's not the case of arrays and tabulars (always null).
382

383     return minValue;
384     }
385
386     /**
387      * Returns the maximal value for the parameter described by this <tt>OpenMBeanParameterInfoSupport</tt> instance,
388      * if specified, or <tt>null</tt> otherwise.
389      */

390     public Comparable JavaDoc getMaxValue() {
391
392     // Note: only comparable values have a maxValue, so that's not the case of arrays and tabulars (always null).
393

394     return maxValue;
395     }
396
397     /**
398      * Returns <tt>true</tt> if this <tt>OpenMBeanParameterInfoSupport</tt> instance specifies a non-null default value
399      * for the described parameter, <tt>false</tt> otherwise.
400      */

401     public boolean hasDefaultValue() {
402
403     return (defaultValue != null);
404     }
405
406     /**
407      * Returns <tt>true</tt> if this <tt>OpenMBeanParameterInfoSupport</tt> instance specifies a non-null set of legal values
408      * for the described parameter, <tt>false</tt> otherwise.
409      */

410     public boolean hasLegalValues() {
411
412     return (legalValues != null);
413     }
414
415     /**
416      * Returns <tt>true</tt> if this <tt>OpenMBeanParameterInfoSupport</tt> instance specifies a non-null minimal value
417      * for the described parameter, <tt>false</tt> otherwise.
418      */

419     public boolean hasMinValue() {
420
421     return (minValue != null);
422     }
423
424     /**
425      * Returns <tt>true</tt> if this <tt>OpenMBeanParameterInfoSupport</tt> instance specifies a non-null maximal value
426      * for the described parameter, <tt>false</tt> otherwise.
427      */

428     public boolean hasMaxValue() {
429
430     return (maxValue != null);
431     }
432
433
434     /**
435      * Tests whether <var>obj</var> is a valid value for the parameter
436      * described by this <code>OpenMBeanParameterInfo</code> instance.
437      *
438      * @param obj the object to be tested.
439      *
440      * @return <code>true</code> if <var>obj</var> is a valid value
441      * for the parameter described by this
442      * <code>OpenMBeanParameterInfo</code> instance,
443      * <code>false</code> otherwise.
444      */

445     public boolean isValue(Object JavaDoc obj) {
446
447     boolean result;
448
449     if ( hasDefaultValue() && obj == null ) {
450         result = true;
451     }
452     else if ( ! openType.isValue(obj) ) {
453         result = false;
454     }
455     else if ( hasLegalValues() && ! legalValues.contains(obj) ) {
456         result = false;
457     }
458     else if ( hasMinValue() && (minValue.compareTo(obj)>0) ) {
459         result = false;
460     }
461     else if ( hasMaxValue() && (maxValue.compareTo(obj)<0) ) {
462         result = false;
463     }
464     else {
465         result = true;
466     }
467
468     return result;
469     }
470
471
472     /* *** Commodity methods from java.lang.Object *** */
473
474
475     /**
476      * Compares the specified <var>obj</var> parameter with this <code>OpenMBeanParameterInfoSupport</code> instance for equality.
477      * <p>
478      * Returns <tt>true</tt> if and only if all of the following statements are true:
479      * <ul>
480      * <li><var>obj</var> is non null,</li>
481      * <li><var>obj</var> also implements the <code>OpenMBeanParameterInfo</code> interface,</li>
482      * <li>their names are equal</li>
483      * <li>their open types are equal</li>
484      * <li>their default, min, max and legal values are equal.</li>
485      * </ul>
486      * This ensures that this <tt>equals</tt> method works properly for <var>obj</var> parameters which are
487      * different implementations of the <code>OpenMBeanParameterInfo</code> interface.
488      * <br>&nbsp;
489      * @param obj the object to be compared for equality with this <code>OpenMBeanParameterInfoSupport</code> instance;
490      *
491      * @return <code>true</code> if the specified object is equal to this <code>OpenMBeanParameterInfoSupport</code> instance.
492      */

493     public boolean equals(Object JavaDoc obj) {
494
495     // if obj is null, return false
496
//
497
if (obj == null) {
498         return false;
499     }
500
501     // if obj is not a OpenMBeanParameterInfo, return false
502
//
503
OpenMBeanParameterInfo JavaDoc other;
504     try {
505         other = (OpenMBeanParameterInfo JavaDoc) obj;
506     } catch (ClassCastException JavaDoc e) {
507         return false;
508     }
509
510     // Now, really test for equality between this OpenMBeanParameterInfo implementation and the other:
511
//
512

513     // their Name should be equal
514
if ( ! this.getName().equals(other.getName()) ) {
515         return false;
516     }
517
518     // their OpenType should be equal
519
if ( ! this.getOpenType().equals(other.getOpenType()) ) {
520         return false;
521     }
522
523     // their DefaultValue should be equal
524
if (this.hasDefaultValue()) {
525         if ( ! this.defaultValue.equals(other.getDefaultValue()) ) {
526         return false;
527         }
528     } else {
529         if (other.hasDefaultValue()) {
530         return false;
531         }
532     }
533        
534     // their MinValue should be equal
535
if (this.hasMinValue()) {
536         if ( ! this.minValue.equals(other.getMinValue()) ) {
537         return false;
538         }
539     } else {
540         if (other.hasMinValue()) {
541         return false;
542         }
543     }
544        
545     // their MaxValue should be equal
546
if (this.hasMaxValue()) {
547         if ( ! this.maxValue.equals(other.getMaxValue()) ) {
548         return false;
549         }
550     } else {
551         if (other.hasMaxValue()) {
552         return false;
553         }
554     }
555        
556     // their LegalValues should be equal
557
if (this.hasLegalValues()) {
558         if ( ! this.legalValues.equals(other.getLegalValues()) ) {
559         return false;
560         }
561     } else {
562         if (other.hasLegalValues()) {
563         return false;
564         }
565     }
566        
567     // All tests for equality were successfull
568
//
569
return true;
570     }
571
572     /**
573      * Returns the hash code value for this <code>OpenMBeanParameterInfoSupport</code> instance.
574      * <p>
575      * The hash code of an <code>OpenMBeanParameterInfoSupport</code> instance is the sum of the hash codes
576      * of all elements of information used in <code>equals</code> comparisons
577      * (ie: its name, its <i>open type</i>, and its default, min, max and legal values).
578      * <p>
579      * This ensures that <code> t1.equals(t2) </code> implies that <code> t1.hashCode()==t2.hashCode() </code>
580      * for any two <code>OpenMBeanParameterInfoSupport</code> instances <code>t1</code> and <code>t2</code>,
581      * as required by the general contract of the method
582      * {@link Object#hashCode() Object.hashCode()}.
583      * <p>
584      * However, note that another instance of a class implementing the <code>OpenMBeanParameterInfo</code> interface
585      * may be equal to this <code>OpenMBeanParameterInfoSupport</code> instance as defined by {@link #equals(java.lang.Object)},
586      * but may have a different hash code if it is calculated differently.
587      * <p>
588      * As <code>OpenMBeanParameterInfoSupport</code> instances are immutable, the hash code for this instance is calculated once,
589      * on the first call to <code>hashCode</code>, and then the same value is returned for subsequent calls.
590      *
591      * @return the hash code value for this <code>OpenMBeanParameterInfoSupport</code> instance
592      */

593     public int hashCode() {
594
595     // Calculate the hash code value if it has not yet been done (ie 1st call to hashCode())
596
//
597
if (myHashCode == null) {
598         int value = 0;
599         value += this.getName().hashCode();
600         value += this.openType.hashCode();
601         if (this.hasDefaultValue()) {
602         value += this.defaultValue.hashCode();
603         }
604         if (this.hasMinValue()) {
605         value += this.minValue.hashCode();
606         }
607         if (this.hasMaxValue()) {
608         value += this.maxValue.hashCode();
609         }
610         if (this.hasLegalValues()) {
611         value += this.legalValues.hashCode();
612         }
613         myHashCode = new Integer JavaDoc(value);
614     }
615     
616     // return always the same hash code for this instance (immutable)
617
//
618
return myHashCode.intValue();
619     }
620
621     /**
622      * Returns a string representation of this <code>OpenMBeanParameterInfoSupport</code> instance.
623      * <p>
624      * The string representation consists of the name of this class (ie <code>javax.management.openmbean.OpenMBeanParameterInfoSupport</code>),
625      * the string representation of the name and open type of the described parameter,
626      * and the string representation of its default, min, max and legal values.
627      * <p>
628      * As <code>OpenMBeanParameterInfoSupport</code> instances are immutable, the string representation for this instance is calculated once,
629      * on the first call to <code>toString</code>, and then the same value is returned for subsequent calls.
630      *
631      * @return a string representation of this <code>OpenMBeanParameterInfoSupport</code> instance
632      */

633     public String JavaDoc toString() {
634
635     // Calculate the hash code value if it has not yet been done (ie 1st call to hashCode())
636
//
637
if (myToString == null) {
638         myToString = new StringBuffer JavaDoc()
639         .append(this.getClass().getName())
640         .append("(name=")
641         .append(this.getName())
642         .append(",openType=")
643         .append(this.openType.toString())
644         .append(",default=")
645         .append(String.valueOf(this.defaultValue))
646         .append(",min=")
647         .append(String.valueOf(this.minValue))
648         .append(",max=")
649         .append(String.valueOf(this.maxValue))
650         .append(",legals=")
651         .append(String.valueOf(this.legalValues))
652         .append(")")
653         .toString();
654     }
655     
656     // return always the same string representation for this instance (immutable)
657
//
658
return myToString;
659     }
660
661 }
662
Popular Tags