KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > websphere6 > dd > beans > SpecialSubjectType


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 package org.netbeans.modules.j2ee.websphere6.dd.beans;
20
21 import org.w3c.dom.*;
22 import org.netbeans.modules.schema2beans.*;
23 import java.beans.*;
24 import java.util.*;
25 /**
26  *
27  * @author dlm198383
28  */

29 public class SpecialSubjectType extends org.netbeans.modules.schema2beans.BaseBean implements DDXmiConstants {
30
31     static Vector comparators = new Vector();
32     private static final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(4, 2, 0);
33
34
35
36     public SpecialSubjectType() {
37         this(Common.USE_DEFAULT_VALUES);
38     }
39     public SpecialSubjectType(int options) {
40         super(comparators, runtimeVersion);
41         // Properties (see root bean comments for the bean graph)
42
initPropertyTables(1);
43         this.initialize(options);
44     }
45     public void initialize(int options) {
46         
47     }
48     public void setDefaults() {
49         setXmiId("Special_");
50         setName(SPECIAL_SUBJECTS_TYPE_EVERYONE_STRING+"_");
51         setType(SPECIAL_SUBJECTS_TYPE_EVERYONE);
52     }
53     
54     
55     public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
56         comparators.add(c);
57     }
58     
59     public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
60         comparators.remove(c);
61     }
62     
63     public void setXmiId(String JavaDoc value) {
64         this.setAttributeValue(SPECIAL_SUBJECTS_XMI_ID,value);
65     }
66     
67     public String JavaDoc getXmiId() {
68         return (String JavaDoc)this.getAttributeValue(SPECIAL_SUBJECTS_XMI_ID);
69     }
70     public void setName(String JavaDoc value) {
71         this.setAttributeValue(SPECIAL_SUBJECTS_NAME,value);
72     }
73     public String JavaDoc getName() {
74         return (String JavaDoc)this.getAttributeValue(SPECIAL_SUBJECTS_NAME);
75     }
76     public void setType(String JavaDoc value) {
77         if(value.equals(SPECIAL_SUBJECTS_TYPE_ALL_AUTHENTICATED_USERS)) {
78             this.setAttributeValue(SPECIAL_SUBJECTS_TYPE,
79                     SPECIAL_SUBJECTS_TYPE_ALL_AUTHENTICATED_USERS_STRING);
80         } else if(value.equals(SPECIAL_SUBJECTS_TYPE_EVERYONE)) {
81             this.setAttributeValue(SPECIAL_SUBJECTS_TYPE,
82                     SPECIAL_SUBJECTS_TYPE_EVERYONE_STRING);
83         } else {
84             this.setAttributeValue(SPECIAL_SUBJECTS_TYPE,value);
85         }
86     }
87     public String JavaDoc getType() {
88         String JavaDoc str=(String JavaDoc)this.getAttributeValue(SPECIAL_SUBJECTS_TYPE);
89         if(str==null) {
90             return null;
91         } else if(str.equals(SPECIAL_SUBJECTS_TYPE_EVERYONE_STRING)) {
92             return SPECIAL_SUBJECTS_TYPE_EVERYONE;
93         } else if(str.equals(SPECIAL_SUBJECTS_TYPE_ALL_AUTHENTICATED_USERS_STRING)) {
94             return SPECIAL_SUBJECTS_TYPE_ALL_AUTHENTICATED_USERS;
95         } else {
96             return str;
97         }
98     }
99     
100     
101     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
102         if(getXmiId()==null) {
103             throw new org.netbeans.modules.schema2beans.ValidateException("getXmiId() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, "SpecialSubjectType", this); // NOI18N
104
}
105         if(getName()==null) {
106             throw new org.netbeans.modules.schema2beans.ValidateException("getName() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, "SpecialSubjectType", this); // NOI18N
107
}
108         if(getType()==null) {
109             throw new org.netbeans.modules.schema2beans.ValidateException("getType() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, "SpecialSubjectType", this); // NOI18N
110
}
111     }
112     
113     
114     
115     // Dump the content of this bean returning it as a String
116
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
117         String JavaDoc s;
118         Object JavaDoc o;
119         org.netbeans.modules.schema2beans.BaseBean n;
120         str.append(indent);
121         str.append(SPECIAL_SUBJECTS);
122     }
123     public String JavaDoc dumpBeanNode(){
124         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
125         str.append(getClass().getName()); // NOI18N
126
this.dump(str, "\n "); // NOI18N
127
return str.toString();
128     }
129 }
130
Popular Tags