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 26 28 public class MarkupLanguagesType extends org.netbeans.modules.schema2beans.BaseBean implements DDXmiConstants { 29 30 static Vector comparators = new Vector(); 31 private static final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(4, 2, 0); 32 33 34 static public final String [] AVALIABLE_NAMES={"WML","HTML","VXML"}; 35 static public final String [] AVALIABLE_MIME_TYPES={"vnd.wap.wml","text/html","text/x-vxml"}; 36 37 static public final String URI = "Uri"; 38 39 public MarkupLanguagesType() { 40 this(Common.USE_DEFAULT_VALUES); 41 } 42 43 public MarkupLanguagesType(int options) { 44 super(comparators, runtimeVersion); 45 initPropertyTables(1); 47 48 this.createProperty(PAGES_ID, 49 PAGES, 50 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 51 PageType.class); 52 53 this.createAttribute(PAGES, XMI_ID_ID, PAGES_XMI_ID, 54 AttrProp.CDATA | AttrProp.IMPLIED, 55 null, null); 56 this.createAttribute(PAGES, NAME_ID, PAGES_NAME, 57 AttrProp.CDATA | AttrProp.IMPLIED, 58 null, null); 59 this.createAttribute(PAGES,URI_ID,PAGES_URI, 60 AttrProp.CDATA | AttrProp.IMPLIED, 61 null, null); 62 63 64 this.initialize(options); 65 } 66 67 public void initialize(int options) { 69 } 71 72 public void setDefaults() { 73 setXmiId(""); 74 setName(AVALIABLE_NAMES[0]); 75 setMimeType(AVALIABLE_MIME_TYPES[0]); 76 setDefaultPage(""); 77 setErrorPage(""); 78 79 } 80 81 82 public void setPages(int index,PageType value) { 84 this.setValue(PAGES, index,value); 85 } 86 87 public void setPages(PageType []value) { 88 this.setValue(PAGES, value); 89 } 90 91 public PageType [] getPages() { 92 return (PageType []) this.getValues(PAGES); 93 } 94 public PageType getPages(int index) { 95 return (PageType )this.getValue(PAGES,index); 96 } 97 public int sizePages() { 98 return this.size(PAGES); 99 } 100 public int addPages(PageType value) { 101 int positionOfNewItem = this.addValue(PAGES, value); 102 return positionOfNewItem; 103 } 104 105 public int removePages(PageType value) { 106 return this.removeValue(PAGES, value); 107 } 108 109 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 110 comparators.add(c); 111 } 112 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 113 comparators.remove(c); 114 } 115 public void setXmiId(String value) { 116 this.setAttributeValue(MARKUP_LANGUAGES_XMI_ID,value); 117 } 118 public String getXmiId() { 119 return this.getAttributeValue(MARKUP_LANGUAGES_XMI_ID); 120 } 121 public void setName(String value) { 122 this.setAttributeValue(MARKUP_LANGUAGES_NAME,value); 123 } 124 public String getName() { 125 return this.getAttributeValue(MARKUP_LANGUAGES_NAME); 126 } 127 public void setMimeType(String value) { 128 this.setAttributeValue(MARKUP_LANGUAGES_MIME_TYPE,value); 129 } 130 131 public String getMimeType() { 132 return this.getAttributeValue(MARKUP_LANGUAGES_MIME_TYPE); 133 } 134 135 public void setErrorPage(String value) { 136 this.setAttributeValue(MARKUP_LANGUAGES_ERROR_PAGE,value); 137 } 138 public String getErrorPage() { 139 return this.getAttributeValue(MARKUP_LANGUAGES_ERROR_PAGE); 140 } 141 142 public void setDefaultPage(String value) { 143 this.setAttributeValue(MARKUP_LANGUAGES_DEFAULT_PAGE,value); 144 } 145 public String getDefaultPage() { 146 return this.getAttributeValue(MARKUP_LANGUAGES_DEFAULT_PAGE); 147 } 148 149 150 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 151 152 if (getPages()!= null) { 153 for (int _index = 0; _index < sizePages(); ++_index) { 154 PageType element = getPages(_index); 155 element.validate(); 156 } 157 } 158 if(getXmiId()==null){ 159 throw new org.netbeans.modules.schema2beans.ValidateException("getXmiIde() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, "MarkupLanguages", this); } 161 if(getName()==null){ 162 throw new org.netbeans.modules.schema2beans.ValidateException("getName() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, "MarkupLanguages", this); } 164 if(getMimeType()==null){ 165 throw new org.netbeans.modules.schema2beans.ValidateException("getMimeType() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, "MarkupLanguages", this); } 167 if(getErrorPage()==null){ 168 throw new org.netbeans.modules.schema2beans.ValidateException("getErrorPage() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, "MarkupLanguages", this); } 170 if(getDefaultPage()==null){ 171 throw new org.netbeans.modules.schema2beans.ValidateException("getDefaultPage() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, "MarkupLanguages", this); } 173 } 174 175 176 177 public void dump(StringBuffer str, String indent){ 179 String s; 180 Object o; 181 org.netbeans.modules.schema2beans.BaseBean n; 182 str.append(indent); 183 str.append(PAGES+"["+this.sizePages()+"]"); for(int i=0; i<this.sizePages(); i++) { 185 str.append(indent+"\t"); 186 str.append("#"+i+":"); 187 str.append(indent+"\tnull"); this.dumpAttributes(PAGES, i, str, indent); 189 } 190 191 } 192 public String dumpBeanNode(){ 193 StringBuffer str = new StringBuffer (); 194 str.append(getClass().getName()); this.dump(str, "\n "); return str.toString(); 197 } 198 } 199 200 202 | Popular Tags |