KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > share > configbean > customizers > data > ParamType


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 /**
20  * This generated bean class ParamType
21  * matches the schema element 'param-type'.
22  * The root bean class is DynamicProperties
23  *
24  * Generated on Wed Sep 29 16:29:53 PDT 2004
25  * @Generated
26  */

27
28 package org.netbeans.modules.j2ee.sun.share.configbean.customizers.data;
29
30 public class ParamType {
31     public static final String JavaDoc TYPE = "Type"; // NOI18N
32
public static final String JavaDoc EDITABLE = "Editable"; // NOI18N
33
public static final String JavaDoc REQUIRED = "Required"; // NOI18N
34
public static final String JavaDoc PARAM_VALUE = "ParamValue"; // NOI18N
35
public static final String JavaDoc PARAM_LOCALE = "ParamLocale"; // NOI18N
36
public static final String JavaDoc PARAM_CHARSET = "ParamCharset"; // NOI18N
37
public static final String JavaDoc PARAM_MIN = "ParamMin"; // NOI18N
38
public static final String JavaDoc PARAM_MAX = "ParamMax"; // NOI18N
39

40     private java.lang.String JavaDoc _Type = "text";
41     private java.lang.String JavaDoc _Editable = "false";
42     private java.lang.String JavaDoc _Required = "true";
43     private java.util.List JavaDoc _ParamValue = new java.util.ArrayList JavaDoc(); // List<String>
44
private boolean _ParamLocale;
45     private boolean _ParamCharset;
46     private String JavaDoc _ParamMin;
47     private String JavaDoc _ParamMax;
48
49     /**
50      * Normal starting point constructor.
51      */

52     public ParamType() {
53     }
54
55     /**
56      * Required parameters constructor
57      */

58     public ParamType(java.lang.String JavaDoc type, java.lang.String JavaDoc editable, java.lang.String JavaDoc required) {
59         _Type = type;
60         _Editable = editable;
61         _Required = required;
62     }
63
64     /**
65      * Deep copy
66      */

67     public ParamType(org.netbeans.modules.j2ee.sun.share.configbean.customizers.data.ParamType source) {
68         this(source, false);
69     }
70
71     /**
72      * Deep copy
73      * @param justData just copy the XML relevant data
74      */

75     public ParamType(org.netbeans.modules.j2ee.sun.share.configbean.customizers.data.ParamType source, boolean justData) {
76         _Type = source._Type;
77         _Editable = source._Editable;
78         _Required = source._Required;
79         for (java.util.Iterator JavaDoc it = source._ParamValue.iterator();
80             it.hasNext(); ) {
81             String JavaDoc srcElement = (String JavaDoc)it.next();
82             _ParamValue.add(srcElement);
83         }
84         _ParamLocale = source._ParamLocale;
85         _ParamCharset = source._ParamCharset;
86         _ParamMin = source._ParamMin;
87         _ParamMax = source._ParamMax;
88     }
89
90     // This attribute is mandatory
91
public void setType(java.lang.String JavaDoc value) {
92         _Type = value;
93     }
94
95     public java.lang.String JavaDoc getType() {
96         return _Type;
97     }
98
99     // This attribute is mandatory
100
public void setEditable(java.lang.String JavaDoc value) {
101         _Editable = value;
102     }
103
104     public java.lang.String JavaDoc getEditable() {
105         return _Editable;
106     }
107
108     // This attribute is mandatory
109
public void setRequired(java.lang.String JavaDoc value) {
110         _Required = value;
111     }
112
113     public java.lang.String JavaDoc getRequired() {
114         return _Required;
115     }
116
117     // This attribute is an array, possibly empty
118
public void setParamValue(String JavaDoc[] value) {
119         if (value == null)
120             value = new String JavaDoc[0];
121         _ParamValue.clear();
122         ((java.util.ArrayList JavaDoc) _ParamValue).ensureCapacity(value.length);
123         for (int i = 0; i < value.length; ++i) {
124             _ParamValue.add(value[i]);
125         }
126         if (value != null && value.length > 0) {
127             // It's a mutually exclusive property.
128
setParamLocale(false);
129             setParamCharset(false);
130         }
131     }
132
133     public void setParamValue(int index, String JavaDoc value) {
134         _ParamValue.set(index, value);
135     }
136
137     public String JavaDoc[] getParamValue() {
138         String JavaDoc[] arr = new String JavaDoc[_ParamValue.size()];
139         return (String JavaDoc[]) _ParamValue.toArray(arr);
140     }
141
142     public java.util.List JavaDoc fetchParamValueList() {
143         return _ParamValue;
144     }
145
146     public String JavaDoc getParamValue(int index) {
147         return (String JavaDoc)_ParamValue.get(index);
148     }
149
150     // Return the number of paramValue
151
public int sizeParamValue() {
152         return _ParamValue.size();
153     }
154
155     public int addParamValue(String JavaDoc value) {
156         _ParamValue.add(value);
157         int positionOfNewItem = _ParamValue.size()-1;
158         if (positionOfNewItem == 0) {
159             // It's a mutually exclusive property.
160
setParamLocale(false);
161             setParamCharset(false);
162         }
163         return positionOfNewItem;
164     }
165
166     /**
167      * Search from the end looking for @param value, and then remove it.
168      */

169     public int removeParamValue(String JavaDoc value) {
170         int pos = _ParamValue.indexOf(value);
171         if (pos >= 0) {
172             _ParamValue.remove(pos);
173         }
174         return pos;
175     }
176
177     // This attribute is mandatory
178
public void setParamLocale(boolean value) {
179         _ParamLocale = value;
180         if (value != false) {
181             // It's a mutually exclusive property.
182
setParamValue(null);
183             setParamCharset(false);
184         }
185     }
186
187     public boolean isParamLocale() {
188         return _ParamLocale;
189     }
190
191     // This attribute is mandatory
192
public void setParamCharset(boolean value) {
193         _ParamCharset = value;
194         if (value != false) {
195             // It's a mutually exclusive property.
196
setParamValue(null);
197             setParamLocale(false);
198         }
199     }
200
201     public boolean isParamCharset() {
202         return _ParamCharset;
203     }
204
205     // This attribute is optional
206
public void setParamMin(String JavaDoc value) {
207         _ParamMin = value;
208     }
209
210     public String JavaDoc getParamMin() {
211         return _ParamMin;
212     }
213
214     // This attribute is optional
215
public void setParamMax(String JavaDoc value) {
216         _ParamMax = value;
217     }
218
219     public String JavaDoc getParamMax() {
220         return _ParamMax;
221     }
222
223     public void writeNode(java.io.Writer JavaDoc out) throws java.io.IOException JavaDoc {
224         String JavaDoc myName;
225         myName = "param-type";
226         writeNode(out, myName, ""); // NOI18N
227
}
228
229     public void writeNode(java.io.Writer JavaDoc out, String JavaDoc nodeName, String JavaDoc indent) throws java.io.IOException JavaDoc {
230         writeNode(out, nodeName, null, indent, new java.util.HashMap JavaDoc());
231     }
232
233     /**
234      * It's not recommended to call this method directly.
235      */

236     public void writeNode(java.io.Writer JavaDoc out, String JavaDoc nodeName, String JavaDoc namespace, String JavaDoc indent, java.util.Map JavaDoc namespaceMap) throws java.io.IOException JavaDoc {
237         out.write(indent);
238         out.write("<");
239         if (namespace != null) {
240             out.write((String JavaDoc)namespaceMap.get(namespace));
241             out.write(":");
242         }
243         out.write(nodeName);
244         // type is an attribute with namespace null
245
if (_Type != null) {
246             out.write(" type='");
247             org.netbeans.modules.j2ee.sun.share.configbean.customizers.data.DynamicProperties.writeXML(out, _Type, true);
248             out.write("'"); // NOI18N
249
}
250         // editable is an attribute with namespace null
251
if (_Editable != null) {
252             out.write(" editable='");
253             org.netbeans.modules.j2ee.sun.share.configbean.customizers.data.DynamicProperties.writeXML(out, _Editable, true);
254             out.write("'"); // NOI18N
255
}
256         // required is an attribute with namespace null
257
if (_Required != null) {
258             out.write(" required='");
259             org.netbeans.modules.j2ee.sun.share.configbean.customizers.data.DynamicProperties.writeXML(out, _Required, true);
260             out.write("'"); // NOI18N
261
}
262         out.write(">\n");
263         String JavaDoc nextIndent = indent + " ";
264         for (java.util.Iterator JavaDoc it = _ParamValue.iterator(); it.hasNext();
265             ) {
266             String JavaDoc element = (String JavaDoc)it.next();
267             if (element != null) {
268                 out.write(nextIndent);
269                 out.write("<param-value"); // NOI18N
270
out.write(">"); // NOI18N
271
org.netbeans.modules.j2ee.sun.share.configbean.customizers.data.DynamicProperties.writeXML(out, element, false);
272                 out.write("</param-value>\n"); // NOI18N
273
}
274         }
275         if (_ParamLocale) {
276             out.write(nextIndent);
277             out.write("<param-locale"); // NOI18N
278
out.write("/>\n"); // NOI18N
279
}
280         if (_ParamCharset) {
281             out.write(nextIndent);
282             out.write("<param-charset"); // NOI18N
283
out.write("/>\n"); // NOI18N
284
}
285         if (_ParamMin != null) {
286             out.write(nextIndent);
287             out.write("<param-min"); // NOI18N
288
out.write(">"); // NOI18N
289
org.netbeans.modules.j2ee.sun.share.configbean.customizers.data.DynamicProperties.writeXML(out, _ParamMin, false);
290             out.write("</param-min>\n"); // NOI18N
291
}
292         if (_ParamMax != null) {
293             out.write(nextIndent);
294             out.write("<param-max"); // NOI18N
295
out.write(">"); // NOI18N
296
org.netbeans.modules.j2ee.sun.share.configbean.customizers.data.DynamicProperties.writeXML(out, _ParamMax, false);
297             out.write("</param-max>\n"); // NOI18N
298
}
299         out.write(indent);
300         out.write("</");
301         if (namespace != null) {
302             out.write((String JavaDoc)namespaceMap.get(namespace));
303             out.write(":");
304         }
305         out.write(nodeName);
306         out.write(">\n");
307     }
308
309     public void readNode(org.w3c.dom.Node JavaDoc node) {
310         readNode(node, new java.util.HashMap JavaDoc());
311     }
312
313     public void readNode(org.w3c.dom.Node JavaDoc node, java.util.Map JavaDoc namespacePrefixes) {
314         if (node.hasAttributes()) {
315             org.w3c.dom.NamedNodeMap JavaDoc attrs = node.getAttributes();
316             org.w3c.dom.Attr JavaDoc attr;
317             java.lang.String JavaDoc attrValue;
318             boolean firstNamespaceDef = true;
319             for (int attrNum = 0; attrNum < attrs.getLength(); ++attrNum) {
320                 attr = (org.w3c.dom.Attr JavaDoc) attrs.item(attrNum);
321                 String JavaDoc attrName = attr.getName();
322                 if (attrName.startsWith("xmlns:")) {
323                     if (firstNamespaceDef) {
324                         firstNamespaceDef = false;
325                         // Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries.
326
namespacePrefixes = new java.util.HashMap JavaDoc(namespacePrefixes);
327                     }
328                     String JavaDoc attrNSPrefix = attrName.substring(6, attrName.length());
329                     namespacePrefixes.put(attrNSPrefix, attr.getValue());
330                 }
331             }
332             attr = (org.w3c.dom.Attr JavaDoc) attrs.getNamedItem("type");
333             if (attr != null) {
334                 attrValue = attr.getValue();
335                 _Type = attrValue;
336             }
337             attr = (org.w3c.dom.Attr JavaDoc) attrs.getNamedItem("editable");
338             if (attr != null) {
339                 attrValue = attr.getValue();
340                 _Editable = attrValue;
341             }
342             attr = (org.w3c.dom.Attr JavaDoc) attrs.getNamedItem("required");
343             if (attr != null) {
344                 attrValue = attr.getValue();
345                 _Required = attrValue;
346             }
347         }
348         org.w3c.dom.NodeList JavaDoc children = node.getChildNodes();
349         for (int i = 0, size = children.getLength(); i < size; ++i) {
350             org.w3c.dom.Node JavaDoc childNode = children.item(i);
351             String JavaDoc childNodeName = (childNode.getLocalName() == null ? childNode.getNodeName().intern() : childNode.getLocalName().intern());
352             String JavaDoc childNodeValue = "";
353             if (childNode.getFirstChild() != null) {
354                 childNodeValue = childNode.getFirstChild().getNodeValue();
355             }
356             if (childNodeName == "param-value") {
357                 String JavaDoc aParamValue;
358                 aParamValue = childNodeValue;
359                 _ParamValue.add(aParamValue);
360             }
361             else if (childNodeName == "param-locale") {
362                 if (childNode.getFirstChild() == null)
363                     _ParamLocale = true;
364                 else
365                     _ParamLocale = java.lang.Boolean.valueOf(childNodeValue).booleanValue();
366             }
367             else if (childNodeName == "param-charset") {
368                 if (childNode.getFirstChild() == null)
369                     _ParamCharset = true;
370                 else
371                     _ParamCharset = java.lang.Boolean.valueOf(childNodeValue).booleanValue();
372             }
373             else if (childNodeName == "param-min") {
374                 _ParamMin = childNodeValue;
375             }
376             else if (childNodeName == "param-max") {
377                 _ParamMax = childNodeValue;
378             }
379             else {
380                 // Found extra unrecognized childNode
381
}
382         }
383     }
384
385     public void changePropertyByName(String JavaDoc name, Object JavaDoc value) {
386         if (name == null) return;
387         name = name.intern();
388         if (name == "type")
389             setType((java.lang.String JavaDoc)value);
390         else if (name == "editable")
391             setEditable((java.lang.String JavaDoc)value);
392         else if (name == "required")
393             setRequired((java.lang.String JavaDoc)value);
394         else if (name == "paramValue")
395             addParamValue((String JavaDoc)value);
396         else if (name == "paramValue[]")
397             setParamValue((String JavaDoc[]) value);
398         else if (name == "paramLocale")
399             setParamLocale(((java.lang.Boolean JavaDoc)value).booleanValue());
400         else if (name == "paramCharset")
401             setParamCharset(((java.lang.Boolean JavaDoc)value).booleanValue());
402         else if (name == "paramMin")
403             setParamMin((String JavaDoc)value);
404         else if (name == "paramMax")
405             setParamMax((String JavaDoc)value);
406         else
407             throw new IllegalArgumentException JavaDoc(name+" is not a valid property name for ParamType");
408     }
409
410     public Object JavaDoc fetchPropertyByName(String JavaDoc name) {
411         if (name == "type")
412             return getType();
413         if (name == "editable")
414             return getEditable();
415         if (name == "required")
416             return getRequired();
417         if (name == "paramValue[]")
418             return getParamValue();
419         if (name == "paramLocale")
420             return (isParamLocale() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
421         if (name == "paramCharset")
422             return (isParamCharset() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
423         if (name == "paramMin")
424             return getParamMin();
425         if (name == "paramMax")
426             return getParamMax();
427         throw new IllegalArgumentException JavaDoc(name+" is not a valid property name for ParamType");
428     }
429
430     public String JavaDoc nameSelf() {
431         return "ParamType";
432     }
433
434     public String JavaDoc nameChild(Object JavaDoc childObj) {
435         return nameChild(childObj, false, false);
436     }
437
438     /**
439      * @param childObj The child object to search for
440      * @param returnSchemaName Whether or not the schema name should be returned or the property name
441      * @return null if not found
442      */

443     public String JavaDoc nameChild(Object JavaDoc childObj, boolean returnConstName, boolean returnSchemaName) {
444         return nameChild(childObj, returnConstName, returnSchemaName, false);
445     }
446
447     /**
448      * @param childObj The child object to search for
449      * @param returnSchemaName Whether or not the schema name should be returned or the property name
450      * @return null if not found
451      */

452     public String JavaDoc nameChild(Object JavaDoc childObj, boolean returnConstName, boolean returnSchemaName, boolean returnXPathName) {
453         if (childObj instanceof java.lang.String JavaDoc) {
454             java.lang.String JavaDoc child = (java.lang.String JavaDoc) childObj;
455             if (child == _Type) {
456                 if (returnConstName) {
457                     return TYPE;
458                 } else if (returnSchemaName) {
459                     return "type";
460                 } else if (returnXPathName) {
461                     return "@type";
462                 } else {
463                     return "Type";
464                 }
465             }
466             if (child == _Editable) {
467                 if (returnConstName) {
468                     return EDITABLE;
469                 } else if (returnSchemaName) {
470                     return "editable";
471                 } else if (returnXPathName) {
472                     return "@editable";
473                 } else {
474                     return "Editable";
475                 }
476             }
477             if (child == _Required) {
478                 if (returnConstName) {
479                     return REQUIRED;
480                 } else if (returnSchemaName) {
481                     return "required";
482                 } else if (returnXPathName) {
483                     return "@required";
484                 } else {
485                     return "Required";
486                 }
487             }
488             int index = 0;
489             for (java.util.Iterator JavaDoc it = _ParamValue.iterator();
490                 it.hasNext(); ) {
491                 String JavaDoc element = (String JavaDoc)it.next();
492                 if (child == element) {
493                     if (returnConstName) {
494                         return PARAM_VALUE;
495                     } else if (returnSchemaName) {
496                         return "param-value";
497                     } else if (returnXPathName) {
498                         return "param-value[position()="+index+"]";
499                     } else {
500                         return "ParamValue."+Integer.toHexString(index);
501                     }
502                 }
503                 ++index;
504             }
505             if (child == _ParamMin) {
506                 if (returnConstName) {
507                     return PARAM_MIN;
508                 } else if (returnSchemaName) {
509                     return "param-min";
510                 } else if (returnXPathName) {
511                     return "param-min";
512                 } else {
513                     return "ParamMin";
514                 }
515             }
516             if (child == _ParamMax) {
517                 if (returnConstName) {
518                     return PARAM_MAX;
519                 } else if (returnSchemaName) {
520                     return "param-max";
521                 } else if (returnXPathName) {
522                     return "param-max";
523                 } else {
524                     return "ParamMax";
525                 }
526             }
527         }
528         if (childObj instanceof java.lang.Boolean JavaDoc) {
529             java.lang.Boolean JavaDoc child = (java.lang.Boolean JavaDoc) childObj;
530             if (((java.lang.Boolean JavaDoc)child).booleanValue() == _ParamLocale) {
531                 if (returnConstName) {
532                     return PARAM_LOCALE;
533                 } else if (returnSchemaName) {
534                     return "param-locale";
535                 } else if (returnXPathName) {
536                     return "param-locale";
537                 } else {
538                     return "ParamLocale";
539                 }
540             }
541             if (((java.lang.Boolean JavaDoc)child).booleanValue() == _ParamCharset) {
542                 if (returnConstName) {
543                     return PARAM_CHARSET;
544                 } else if (returnSchemaName) {
545                     return "param-charset";
546                 } else if (returnXPathName) {
547                     return "param-charset";
548                 } else {
549                     return "ParamCharset";
550                 }
551             }
552         }
553         return null;
554     }
555
556     /**
557      * Return an array of all of the properties that are beans and are set.
558      */

559     public java.lang.Object JavaDoc[] childBeans(boolean recursive) {
560         java.util.List JavaDoc children = new java.util.LinkedList JavaDoc();
561         childBeans(recursive, children);
562         java.lang.Object JavaDoc[] result = new java.lang.Object JavaDoc[children.size()];
563         return (java.lang.Object JavaDoc[]) children.toArray(result);
564     }
565
566     /**
567      * Put all child beans into the beans list.
568      */

569     public void childBeans(boolean recursive, java.util.List JavaDoc beans) {
570     }
571
572     public boolean equals(Object JavaDoc o) {
573         return o instanceof org.netbeans.modules.j2ee.sun.share.configbean.customizers.data.ParamType && equals((org.netbeans.modules.j2ee.sun.share.configbean.customizers.data.ParamType) o);
574     }
575
576     public boolean equals(org.netbeans.modules.j2ee.sun.share.configbean.customizers.data.ParamType inst) {
577         if (inst == this) {
578             return true;
579         }
580         if (inst == null) {
581             return false;
582         }
583         if (!(_Type == null ? inst._Type == null : _Type.equals(inst._Type))) {
584             return false;
585         }
586         if (!(_Editable == null ? inst._Editable == null : _Editable.equals(inst._Editable))) {
587             return false;
588         }
589         if (!(_Required == null ? inst._Required == null : _Required.equals(inst._Required))) {
590             return false;
591         }
592         if (sizeParamValue() != inst.sizeParamValue())
593             return false;
594         // Compare every element.
595
for (java.util.Iterator JavaDoc it = _ParamValue.iterator(), it2 = inst._ParamValue.iterator();
596             it.hasNext() && it2.hasNext(); ) {
597             String JavaDoc element = (String JavaDoc)it.next();
598             String JavaDoc element2 = (String JavaDoc)it2.next();
599             if (!(element == null ? element2 == null : element.equals(element2))) {
600                 return false;
601             }
602         }
603         if (!(_ParamLocale == inst._ParamLocale)) {
604             return false;
605         }
606         if (!(_ParamCharset == inst._ParamCharset)) {
607             return false;
608         }
609         if (!(_ParamMin == null ? inst._ParamMin == null : _ParamMin.equals(inst._ParamMin))) {
610             return false;
611         }
612         if (!(_ParamMax == null ? inst._ParamMax == null : _ParamMax.equals(inst._ParamMax))) {
613             return false;
614         }
615         return true;
616     }
617
618     public int hashCode() {
619         int result = 17;
620         result = 37*result + (_Type == null ? 0 : _Type.hashCode());
621         result = 37*result + (_Editable == null ? 0 : _Editable.hashCode());
622         result = 37*result + (_Required == null ? 0 : _Required.hashCode());
623         result = 37*result + (_ParamValue == null ? 0 : _ParamValue.hashCode());
624         result = 37*result + (_ParamLocale ? 0 : 1);
625         result = 37*result + (_ParamCharset ? 0 : 1);
626         result = 37*result + (_ParamMin == null ? 0 : _ParamMin.hashCode());
627         result = 37*result + (_ParamMax == null ? 0 : _ParamMax.hashCode());
628         return result;
629     }
630
631 }
632
633
634 /*
635         The following schema file has been used for generation:
636
637 <?xml version="1.0" encoding="UTF-8"?>
638
639 <!--
640     Document : dynamic-properties.dtd
641     Created on : January 28, 2004, 8:48 PM
642     Author : Peter Williams
643     Description:
644         Purpose of the document follows.
645         
646     DTD for definition of properties, their editors and validators to allow for
647     name/value pair property editing to be handled nicely in the plugin.
648 -->
649
650 <!-- The file is a list of property lists -->
651 <!ELEMENT dynamic-properties (property-list*, validator*)>
652
653 <!-- Each property list can be fixed or editable and has a name -->
654 <!ELEMENT property-list (property-name, property-param+, help-id?)>
655 <!ATTLIST property-list editable CDATA "false"
656                         description CDATA "true"
657                         bundle-path CDATA #IMPLIED>
658
659 <!ELEMENT property-name (#PCDATA)>
660
661 <!--
662     Each element in a property list has a name. It may also have a type, a
663     validator, and possibly a min and/or max if the type is 'number'. Lastly,
664     it could have a helpId
665 -->
666 <!ELEMENT property-param (param-name, param-type, param-label?, param-validator?, default-value?,
667                           help-id?, param-description?)>
668
669 <!ELEMENT param-name (#PCDATA)>
670
671 <!--
672     There are four allowed types: boolean, text, number, and list. The editable
673     attribute is ignored for all types except the list type.
674     
675     For boolean properties, default value should be string using the boolean
676       'ENTITY' definitions in the sun-xxx dtd's, preferably true/false.
677     For text properties, you should provide a validator (or none to allow
678       arbitrary text) and a default value if desired.
679     For number properties, the number is assumed to be a signed long integer.
680       Use the min & max params to specify a range if required.
681     For list properties, use as many param-value entries as necessary to represent
682       the list. If the list is editable, set the editable attribute on the type.
683       One exception here is if the list is the list of charsets or locales, use
684       param-locale or param-charset to specify this. These lists are provided by
685       the Locale and Charset classes in the JVM.
686
687     (I'm not actually defining ENTITY's here because Schema2Beans does not support them.)
688 -->
689 <!ELEMENT param-type ((param-value* | param-locale | param-charset), param-min?, param-max?)>
690 <!ATTLIST param-type type CDATA "text"
691                      editable CDATA "false"
692                      required CDATA "true">
693
694 <!ELEMENT param-value (#PCDATA)>
695 <!ELEMENT param-locale EMPTY>
696 <!ELEMENT param-charset EMPTY>
697 <!ELEMENT param-min (#PCDATA)>
698 <!ELEMENT param-max (#PCDATA)>
699
700 <!--
701     The text label (actually, will become bundle string id) to be used for the
702     value field instead of the word 'Value'
703 -->
704 <!ELEMENT param-label (#PCDATA)>
705
706 <!--
707     Validators are used to ensure the text in a text field matches a specific
708     pattern. The following validators are supported: (Can I support java
709     regular expression patterns here? It would make it lots easier!!!)
710     
711         directory: A directory path specification
712         javaid: A legal java identifier (allows java keywords though)
713         url: A URL string
714         domain: A domain. This is probably similar to javaid + represents a server domain
715         package: A legal java package name, e.g. javaid's separated by periods.
716         memorysize: A number followed by kb or mb (case insensitive)
717         classid: A windows classid (GUID)
718 -->
719 <!ELEMENT param-validator (#PCDATA)>
720
721 <!--
722     String that will become the default value for the property. If the property
723     value must fit a specific pattern, the default-value must qualify.
724 -->
725 <!ELEMENT default-value (#PCDATA)>
726
727 <!--
728     The help id for this field (or panel if specified at the property level,
729     which is likely what we'll do.
730 -->
731 <!ELEMENT help-id (#PCDATA)>
732
733
734 <!--
735     ID of string in bundle (see property-list attributes) to use for default
736     description.
737 -->
738 <!ELEMENT param-description (#PCDATA)>
739
740 <!-- !PW this would be used by property-param once it's done
741
742     Version of the appserver this property-param belongs to. Not present means
743     the property is applicable to all versions.
744     
745     Allowable Strings: major[.minor][pe|se|ee]
746         Major version is require.
747         Minor is optional (not present matches all)
748         Type is optional (not present matches all)
749         
750     For range attribute, valid values are:
751         ending, only, starting
752 <!ELEMENT appserver-version (#PCDATA)>
753 <!ATTLIST appserver-version range CDATA #IMPLIED>
754 -->
755
756 <!--
757     Validator definition. These are referred to by name from the <param-validator>
758     entry in <property-param>, above.
759 -->
760 <!ELEMENT validator (validator-name, validator-pattern)>
761
762 <!ELEMENT validator-name (#PCDATA)>
763
764 <!ELEMENT validator-pattern (#PCDATA)>
765
766
767
768 */

769
770
Popular Tags