KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > dd > impl > transform > ModAttribute


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 2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 /**
20  * This generated bean class ModAttribute matches the schema element 'mod-attribute'.
21  * The root bean class is Transform
22  *
23  * Generated on Sat Aug 13 01:27:36 GMT-08:00 2005
24  * @Generated
25  */

26
27 package org.netbeans.modules.j2ee.sun.dd.impl.transform;
28
29 import org.w3c.dom.*;
30 import org.netbeans.modules.schema2beans.*;
31 import java.beans.*;
32 import java.util.*;
33
34 // BEGIN_NOI18N
35

36 public class ModAttribute extends org.netbeans.modules.schema2beans.BaseBean
37 {
38
39     static Vector comparators = new Vector();
40     private static final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(4, 2, 0);
41
42     static public final String JavaDoc NAME = "Name"; // NOI18N
43

44     public ModAttribute() {
45         this(Common.USE_DEFAULT_VALUES);
46     }
47
48     public ModAttribute(int options)
49     {
50         super(comparators, runtimeVersion);
51         // Properties (see root bean comments for the bean graph)
52
initPropertyTables(1);
53         this.createProperty("name", // NOI18N
54
NAME,
55             Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
56             String JavaDoc.class);
57         this.initialize(options);
58     }
59
60     // Setting the default values of the properties
61
void initialize(int options) {
62
63     }
64
65     // This attribute is mandatory
66
public void setName(String JavaDoc value) {
67         this.setValue(NAME, value);
68     }
69
70     //
71
public String JavaDoc getName() {
72         return (String JavaDoc)this.getValue(NAME);
73     }
74
75     //
76
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
77         comparators.add(c);
78     }
79
80     //
81
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
82         comparators.remove(c);
83     }
84     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
85         boolean restrictionFailure = false;
86         boolean restrictionPassed = false;
87         // Validating property name
88
if (getName() == null) {
89             throw new org.netbeans.modules.schema2beans.ValidateException("getName() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, "name", this); // NOI18N
90
}
91     }
92
93     // Dump the content of this bean returning it as a String
94
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
95         String JavaDoc s;
96         Object JavaDoc o;
97         org.netbeans.modules.schema2beans.BaseBean n;
98         str.append(indent);
99         str.append("Name"); // NOI18N
100
str.append(indent+"\t"); // NOI18N
101
str.append("<"); // NOI18N
102
o = this.getName();
103         str.append((o==null?"null":o.toString().trim())); // NOI18N
104
str.append(">\n"); // NOI18N
105
this.dumpAttributes(NAME, 0, str, indent);
106
107     }
108     public String JavaDoc dumpBeanNode(){
109         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
110         str.append("ModAttribute\n"); // NOI18N
111
this.dump(str, "\n "); // NOI18N
112
return str.toString();
113     }}
114
115 // END_NOI18N
116

117
118 /*
119         The following schema file has been used for generation:
120
121
122 <!--- Put your DTDDoc comment here. -->
123 <!ELEMENT transform (xmltype)*>
124
125 <!--- xmltype : target version of the server xml -->
126 <!ELEMENT xmltype (name, mod-element*)>
127
128 <!--- Put your DTDDoc comment here. -->
129 <!ELEMENT name (#PCDATA)>
130
131 <!--- mod-element : element that contains sub-elements and attributes that need to be removed
132       ie. sub-elements and attributes that were added in a later version of server xml -->
133 <!ELEMENT mod-element (name, mod-attribute*, sub-element*)>
134
135 <!--- sub-element : sub-elements that need to be removed -->
136 <!ELEMENT sub-element (name)>
137
138 <!--- new-attribute : attribute that need to be removed -->
139 <!ELEMENT mod-attribute (name)>
140
141
142 */

143
Popular Tags