1 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 29 public class ExtendedServletsType 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 static public final String EXTENDED_SERVLET_HREF="ExtendedServletHref"; 35 36 39 public ExtendedServletsType() { 40 this(Common.USE_DEFAULT_VALUES); 41 } 42 public ExtendedServletsType(int options) { 43 super(comparators, runtimeVersion); 44 initPropertyTables(3); 46 this.createProperty(EXTENDED_SERVLET_ID, 47 EXTENDED_SERVLET, 48 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 49 java.lang.String .class); 50 51 this.createAttribute(EXTENDED_SERVLET, HREF_ID, EXTENDED_SERVLET_HREF, 52 AttrProp.CDATA | AttrProp.IMPLIED, 53 null, null); 54 55 56 57 this.createProperty(MARKUP_LANGUAGES_ID, 58 MARKUP_LANGUAGES, 59 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 60 MarkupLanguagesType.class); 61 62 this.createAttribute(MARKUP_LANGUAGES,XMI_ID_ID,MARKUP_LANGUAGES_XMI_ID, 63 AttrProp.CDATA | AttrProp.IMPLIED, 64 null, null); 65 66 this.createAttribute(MARKUP_LANGUAGES,NAME_ID,MARKUP_LANGUAGES_NAME, 67 AttrProp.CDATA | AttrProp.IMPLIED, 68 null, null); 69 this.createAttribute(MARKUP_LANGUAGES,MIME_TYPE_ID,MARKUP_LANGUAGES_MIME_TYPE, 70 AttrProp.CDATA | AttrProp.IMPLIED, 71 null, null); 72 this.createAttribute(MARKUP_LANGUAGES,ERROR_PAGE_ID,MARKUP_LANGUAGES_ERROR_PAGE, 73 AttrProp.CDATA | AttrProp.IMPLIED, 74 null, null); 75 this.createAttribute(MARKUP_LANGUAGES,DEFAULT_PAGE_ID,MARKUP_LANGUAGES_DEFAULT_PAGE , 76 AttrProp.CDATA | AttrProp.IMPLIED, 77 null, null); 78 79 80 this.createProperty(LOCAL_TRANSACTION_ID, 81 LOCAL_TRANSACTION, 82 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 83 java.lang.String .class); 84 this.createAttribute(LOCAL_TRANSACTION, XMI_ID_ID, LOCAL_TRANSACTION_XMI_ID, 85 AttrProp.CDATA | AttrProp.IMPLIED, 86 null, null); 87 this.createAttribute(LOCAL_TRANSACTION,UNRESOLVED_ACTION_ID,LOCAL_TRANSACTION_UNRESOLVED_ACTION, 88 AttrProp.CDATA | AttrProp.IMPLIED, 89 null, null); 90 this.createAttribute(LOCAL_TRANSACTION,BOUNDARY_ID,LOCAL_TRANSACTION_BOUNDARY, 91 AttrProp.CDATA | AttrProp.IMPLIED, 92 null, null); 93 this.createAttribute(LOCAL_TRANSACTION,RESOLVER_ID,LOCAL_TRANSACTION_RESOLVER, 94 AttrProp.CDATA | AttrProp.IMPLIED, 95 null, null); 96 97 this.initialize(options); 98 } 99 public void initialize(int options) { 100 101 } 102 public void setDefaults() { 103 setHref(""); 104 } 105 public void setExtendedServlet(String value) { 106 this.setValue(EXTENDED_SERVLET, value); 107 } 108 109 public String getExtendedServlet() { 110 return ( String )this.getValue(EXTENDED_SERVLET); 111 } 112 113 public void setXmiId(String value) { 114 setAttributeValue(EXTENDED_SERVLETS_XMI_ID,value); 115 } 116 117 public String getXmiId(){ 118 return (String )getAttributeValue(EXTENDED_SERVLETS_XMI_ID); 119 } 120 121 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 123 comparators.add(c); 124 } 125 126 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 128 comparators.remove(c); 129 } 130 131 public void setHref(java.lang.String value) { 132 setAttributeValue(EXTENDED_SERVLET, EXTENDED_SERVLET_HREF,DDXmi.addWebHrefToId(value)); 133 } 134 135 public String getHref() { 136 return DDXmi.getIdFromHref((String )getAttributeValue(EXTENDED_SERVLET, EXTENDED_SERVLET_HREF)); 137 } 138 139 public String getLocalTransaction() { 140 return (String )this.getValue(LOCAL_TRANSACTION); 141 } 142 public void setLocalTransaction(String value) { 143 this.setValue(LOCAL_TRANSACTION,value); 144 } 145 146 147 public void setLocalTransactionXmiId(String value){ 148 this.setAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_XMI_ID,value); 149 } 150 public String getLocalTransactionXmiId(){ 151 return (String )this.getAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_XMI_ID); 152 } 153 154 public void setLocalTransactionUnresolvedAction(String value){ 155 this.setAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_UNRESOLVED_ACTION,value); 156 } 157 public String getLocalTransactionUnresolvedAction(){ 158 return (String )this.getAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_UNRESOLVED_ACTION); 159 } 160 161 public void setLocalTransactionResolver(String value){ 162 this.setAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_RESOLVER,value); 163 } 164 public String getLocalTransactionResolver(){ 165 return (String )this.getAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_RESOLVER); 166 } 167 168 public void setLocalTransactionBoundary(String value){ 169 this.setAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_BOUNDARY,value); 170 } 171 public String getLocalTransactionBoundary(){ 172 return (String )this.getAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_BOUNDARY); 173 } 174 175 public MarkupLanguagesType [] getMarkupLanguages() { 176 return (MarkupLanguagesType [])this.getValues(MARKUP_LANGUAGES); 177 } 178 public MarkupLanguagesType getMarkupLanguages(int index) { 179 return (MarkupLanguagesType)this.getValue(MARKUP_LANGUAGES,index); 180 } 181 public void setMarkupLanguages(int index,MarkupLanguagesType value) { 182 this.setValue(MARKUP_LANGUAGES,index,value); 183 } 184 185 186 187 public int sizeMarkupLanguages() { 188 return this.size(MARKUP_LANGUAGES); 189 } 190 public int addMarkupLanguages(MarkupLanguagesType value) { 191 int positionOfNewItem = this.addValue(MARKUP_LANGUAGES, value); 192 return positionOfNewItem; 193 } 194 195 public int removeMarkupLanguages(MarkupLanguagesType value) { 196 return this.removeValue(MARKUP_LANGUAGES, value); 197 } 198 199 200 201 202 203 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 204 205 if(getExtendedServlet()==null) { 206 throw new org.netbeans.modules.schema2beans.ValidateException("getExtendedServlet() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, EXTENDED_SERVLETS, this); } 208 if(getXmiId()==null) { 209 throw new org.netbeans.modules.schema2beans.ValidateException("getExtendedServletsId == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, EXTENDED_SERVLETS, this); } 211 if(getHref()==null) { 212 throw new org.netbeans.modules.schema2beans.ValidateException("getHref() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE,EXTENDED_SERVLETS, this); } 214 if(getLocalTransaction()!=null) { 215 if(getLocalTransactionXmiId()==null) 216 throw new org.netbeans.modules.schema2beans.ValidateException("getLocalTransactionXmiId() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, EXTENDED_SERVLETS, this); if(getLocalTransactionUnresolvedAction()==null) 218 throw new org.netbeans.modules.schema2beans.ValidateException("getLocalTransactionUnresolvedAction() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, EXTENDED_SERVLETS, this); } 220 int size=sizeMarkupLanguages(); 221 for(int i=0;i<size;i++) { 222 getMarkupLanguages(i).validate(); 223 } 224 } 225 public void dump(StringBuffer str, String indent){ 227 String s; 228 Object o; 229 org.netbeans.modules.schema2beans.BaseBean n; 230 str.append(indent); 231 str.append("ExtendedServlet"); str.append(indent+"\t"); str.append("<"); o = this.getExtendedServlet(); 235 str.append((o==null?"null":o.toString().trim())); str.append(">\n"); this.dumpAttributes(EXTENDED_SERVLET, 0, str, indent); 238 239 240 } 241 public String dumpBeanNode(){ 242 StringBuffer str = new StringBuffer (); 243 str.append(getClass().getName()); this.dump(str, "\n "); return str.toString(); 246 } 247 } 248 | Popular Tags |