1 23 24 29 30 package com.sun.enterprise.tools.common.dd.connector; 31 32 import org.w3c.dom.*; 33 import org.netbeans.modules.schema2beans.*; 34 import java.beans.*; 35 import java.util.*; 36 37 39 public class RoleMap extends com.sun.enterprise.tools.common.dd.SunBaseBean 40 { 41 42 static Vector comparators = new Vector(); 43 44 static public final String MAPID = "MapId"; static public final String DESCRIPTION = "Description"; static public final String MAP_ELEMENT = "MapElement"; 48 public RoleMap() { 49 this(Common.USE_DEFAULT_VALUES); 50 } 51 52 public RoleMap(int options) 53 { 54 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 55 this.createProperty("description", DESCRIPTION, 58 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 59 String .class); 60 this.createProperty("map-element", MAP_ELEMENT, 62 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 63 MapElement.class); 64 this.initialize(options); 65 } 66 67 void initialize(int options) 69 { 70 71 } 72 73 public void setMapId(java.lang.String value) { 75 setAttributeValue(MAPID, value); 76 } 77 78 public java.lang.String getMapId() { 80 return getAttributeValue(MAPID); 81 } 82 83 public void setDescription(String value) { 85 this.setValue(DESCRIPTION, value); 86 } 87 88 public String getDescription() { 90 return (String )this.getValue(DESCRIPTION); 91 } 92 93 public void setMapElement(int index, MapElement value) { 95 this.setValue(MAP_ELEMENT, index, value); 96 } 97 98 public MapElement getMapElement(int index) { 100 return (MapElement)this.getValue(MAP_ELEMENT, index); 101 } 102 103 public void setMapElement(MapElement[] value) { 105 this.setValue(MAP_ELEMENT, value); 106 } 107 108 public MapElement[] getMapElement() { 110 return (MapElement[])this.getValues(MAP_ELEMENT); 111 } 112 113 public int sizeMapElement() { 115 return this.size(MAP_ELEMENT); 116 } 117 118 public int addMapElement(com.sun.enterprise.tools.common.dd.connector.MapElement value) { 120 return this.addValue(MAP_ELEMENT, value); 121 } 122 123 public int removeMapElement(com.sun.enterprise.tools.common.dd.connector.MapElement value) { 128 return this.removeValue(MAP_ELEMENT, value); 129 } 130 131 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 133 comparators.add(c); 134 } 135 136 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 138 comparators.remove(c); 139 } 140 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 141 boolean restrictionFailure = false; 142 if (getMapId() == null) { 144 throw new org.netbeans.modules.schema2beans.ValidateException("getMapId() == null", "mapId", this); } 146 if (getDescription() != null) { 148 } 149 for (int _index = 0; _index < sizeMapElement(); ++_index) { 151 com.sun.enterprise.tools.common.dd.connector.MapElement element = getMapElement(_index); 152 if (element != null) { 153 element.validate(); 154 } 155 } 156 } 157 158 public void dump(StringBuffer str, String indent){ 160 String s; 161 Object o; 162 org.netbeans.modules.schema2beans.BaseBean n; 163 str.append(indent); 164 str.append("Description"); str.append(indent+"\t"); str.append("<"); s = this.getDescription(); 168 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(DESCRIPTION, 0, str, indent); 171 172 str.append(indent); 173 str.append("MapElement["+this.sizeMapElement()+"]"); for(int i=0; i<this.sizeMapElement(); i++) 175 { 176 str.append(indent+"\t"); 177 str.append("#"+i+":"); 178 n = (org.netbeans.modules.schema2beans.BaseBean) this.getMapElement(i); 179 if (n != null) 180 n.dump(str, indent + "\t"); else 182 str.append(indent+"\tnull"); this.dumpAttributes(MAP_ELEMENT, i, str, indent); 184 } 185 186 } 187 public String dumpBeanNode(){ 188 StringBuffer str = new StringBuffer (); 189 str.append("RoleMap\n"); this.dump(str, "\n "); return str.toString(); 192 }} 193 194 196 197 268 | Popular Tags |