KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > xml > xmlc > metadata > ElementDef


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  *
19  * Contributor(s):
20  *
21  * $Id: ElementDef.java,v 1.2 2005/01/26 08:29:24 jkjome Exp $
22  */

23
24 package org.enhydra.xml.xmlc.metadata;
25
26 import org.w3c.dom.Document JavaDoc;
27
28 /**
29  * Define a particular element in the document. An <elementDef>
30  * uniquely address a particular element in the document.
31  */

32 public class ElementDef extends MetaDataElement {
33     /**
34      * Element name.
35      */

36     public static final String JavaDoc TAG_NAME = "elementDef";
37
38     /**
39      * Attribute names.
40      */

41     private static final String JavaDoc ELEMENT_ID_ATTR = "elementId";
42     private static final String JavaDoc TAG_NAMES_ATTR = "tagNames";
43     private static final String JavaDoc DOM_TYPE_ATTR = "domType";
44     private static final String JavaDoc JAVA_NAME_ATTR = "javaName";
45     private static final String JavaDoc CREATE_SETTEXT_ATTR = "createSetText";
46     private static final String JavaDoc CREATE_GETELEMENT_ATTR = "createGetElement";
47     private static final String JavaDoc OPTIONAL_ATTR = "optional";
48
49     /**
50      * Constructor.
51      */

52     public ElementDef(Document JavaDoc ownerDoc) {
53         super(ownerDoc, TAG_NAME);
54     }
55
56     /**
57      * Get the elementId attribute value.
58      */

59     public String JavaDoc getElementId() {
60         return getAttributeNull(ELEMENT_ID_ATTR);
61     }
62
63     /**
64      * Set the elementId attribute value.
65      */

66     public void setElementId(String JavaDoc value) {
67         setRemoveAttribute(ELEMENT_ID_ATTR, value);
68     }
69
70     /**
71      * Get the tagNames attribute value.
72      */

73     public String JavaDoc[] getTagNames() {
74         return getStringArrayAttribute(TAG_NAMES_ATTR);
75     }
76
77     /**
78      * Set the tagNames attribute value.
79      */

80     public void setTagNames(String JavaDoc[] values) {
81         setRemoveStringArrayAttribute(TAG_NAMES_ATTR, values);
82     }
83
84     /**
85      * Get the domType attribute value.
86      */

87     public String JavaDoc getDomType() {
88         return getAttributeNull(DOM_TYPE_ATTR);
89     }
90
91     /**
92      * Set the domType attribute value.
93      */

94     public void setDomType(String JavaDoc value) {
95         setRemoveAttribute(DOM_TYPE_ATTR, value);
96     }
97
98     /**
99      * Get the javaName attribute value.
100      */

101     public String JavaDoc getJavaName() {
102         return getAttributeNull(JAVA_NAME_ATTR);
103     }
104
105     /**
106      * Set the javaName attribute value.
107      */

108     public void setJavaName(String JavaDoc value) {
109         setRemoveAttribute(JAVA_NAME_ATTR, value);
110     }
111
112     /**
113      * Get the createSetText attribute value.
114      */

115     public Boolean JavaDoc getCreateSetText() {
116         return getBooleanObjectAttribute(CREATE_SETTEXT_ATTR);
117     }
118
119     /**
120      * Set the createSetText attribute value.
121      */

122     public void setCreateSetText(Boolean JavaDoc value) {
123         setBooleanObjectAttribute(CREATE_SETTEXT_ATTR, value);
124     }
125
126     /**
127      * Get the createGetElement attribute value.
128      */

129     public Boolean JavaDoc getCreateGetElement() {
130         return getBooleanObjectAttribute(CREATE_GETELEMENT_ATTR);
131     }
132
133     /**
134      * Set the createGetElement attribute value.
135      */

136     public void setCreateGetElement(Boolean JavaDoc value) {
137         setBooleanObjectAttribute(CREATE_GETELEMENT_ATTR, value);
138     }
139
140     /**
141      * Get the optional attribute value.
142      */

143     public boolean getOptional() {
144         return getBooleanAttribute(OPTIONAL_ATTR);
145     }
146
147     /**
148      * Set the optional attribute value.
149      */

150     public void setOptional(boolean value) {
151         setBooleanAttribute(OPTIONAL_ATTR, value);
152     }
153
154     /**
155      * Get the ElementDef child elements.
156      */

157     public ElementDef[] getElementDef() {
158         return (ElementDef[])getChildren(ElementDef.class);
159     }
160
161     /**
162      * Add a ElementDef child element.
163      */

164     public void addElementDef(ElementDef elementDef) {
165         appendChild(elementDef);
166     }
167
168     /**
169      * Delete a ElementDef child element.
170      */

171     public void deleteElementDef(ElementDef elementDef) {
172         removeChild(elementDef);
173     }
174 }
175
Popular Tags