KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openlaszlo > compiler > AttributeSpec


1 /* *****************************************************************************
2  * Parser.java
3 * ****************************************************************************/

4
5 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
6 * Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
7 * Use is subject to license terms. *
8 * J_LZ_COPYRIGHT_END *********************************************************/

9
10 package org.openlaszlo.compiler;
11
12 import org.openlaszlo.xml.internal.Schema.Type;
13 import org.jdom.Element;
14
15 /** Contains information about an attribute of a laszlo viewsystem class.
16  */

17 class AttributeSpec {
18     /** The source Element from which this attribute was parsed */
19     Element source = null;
20     /** The attribute name */
21     String JavaDoc name;
22     /** The default value */
23     String JavaDoc defaultValue;
24     /** The setter function */
25     String JavaDoc setter;
26     /** The type of the attribute value*/
27     Type type;
28     /** Is this attribute required to instantiate an instance of this class? */
29     boolean required = false;
30     /** Is this attribute equivalent to element content of a given type? */
31     int contentType = NO_CONTENT;
32
33     /** Element content types: */
34     static final int NO_CONTENT = 0;
35     static final int TEXT_CONTENT = 1;
36     static final int HTML_CONTENT = 2;
37
38     AttributeSpec (String JavaDoc name, Type type, String JavaDoc defaultValue, String JavaDoc setter, Element source) {
39         this.source = source;
40         this.name = name;
41         this.type = type;
42         this.defaultValue = defaultValue;
43         this.setter = setter;
44     }
45
46     AttributeSpec (String JavaDoc name, Type type, String JavaDoc defaultValue, String JavaDoc setter, boolean required, Element source) {
47         this.source = source;
48         this.name = name;
49         this.type = type;
50         this.defaultValue = defaultValue;
51         this.setter = setter;
52         this.required = required;
53     }
54
55     AttributeSpec (String JavaDoc name, Type type, String JavaDoc defaultValue, String JavaDoc setter) {
56         this.name = name;
57         this.type = type;
58         this.defaultValue = defaultValue;
59         this.setter = setter;
60     }
61
62     AttributeSpec (String JavaDoc name, Type type, String JavaDoc defaultValue, String JavaDoc setter, boolean required) {
63         this.name = name;
64         this.type = type;
65         this.defaultValue = defaultValue;
66         this.setter = setter;
67         this.required = required;
68     }
69 }
70
Popular Tags