1 19 20 28 29 package org.netbeans.modules.xml.wsdl.ui.property.model; 30 31 public class BuiltInCustomizer { 32 public static final String DEPENDSONCUSTOMIZER = "DependsOnCustomizer"; public static final String SIMPLECUSTOMIZER = "SimpleCustomizer"; 35 private DependsOnCustomizer _DependsOnCustomizer; 36 private SimpleCustomizer _SimpleCustomizer; 37 38 41 public BuiltInCustomizer() { 42 } 43 44 47 public BuiltInCustomizer(org.netbeans.modules.xml.wsdl.ui.property.model.BuiltInCustomizer source) { 48 this(source, false); 49 } 50 51 55 public BuiltInCustomizer(org.netbeans.modules.xml.wsdl.ui.property.model.BuiltInCustomizer source, boolean justData) { 56 _DependsOnCustomizer = (source._DependsOnCustomizer == null) ? null : newDependsOnCustomizer(source._DependsOnCustomizer, justData); 57 _SimpleCustomizer = (source._SimpleCustomizer == null) ? null : newSimpleCustomizer(source._SimpleCustomizer, justData); 58 } 59 60 public void setDependsOnCustomizer(org.netbeans.modules.xml.wsdl.ui.property.model.DependsOnCustomizer value) { 62 _DependsOnCustomizer = value; 63 if (value != null) { 64 setSimpleCustomizer(null); 66 } 67 } 68 69 public org.netbeans.modules.xml.wsdl.ui.property.model.DependsOnCustomizer getDependsOnCustomizer() { 70 return _DependsOnCustomizer; 71 } 72 73 public void setSimpleCustomizer(org.netbeans.modules.xml.wsdl.ui.property.model.SimpleCustomizer value) { 75 _SimpleCustomizer = value; 76 if (value != null) { 77 setDependsOnCustomizer(null); 79 } 80 } 81 82 public org.netbeans.modules.xml.wsdl.ui.property.model.SimpleCustomizer getSimpleCustomizer() { 83 return _SimpleCustomizer; 84 } 85 86 90 public org.netbeans.modules.xml.wsdl.ui.property.model.DependsOnCustomizer newDependsOnCustomizer() { 91 return new org.netbeans.modules.xml.wsdl.ui.property.model.DependsOnCustomizer(); 92 } 93 94 98 public org.netbeans.modules.xml.wsdl.ui.property.model.DependsOnCustomizer newDependsOnCustomizer(DependsOnCustomizer source, boolean justData) { 99 return new org.netbeans.modules.xml.wsdl.ui.property.model.DependsOnCustomizer(source, justData); 100 } 101 102 106 public org.netbeans.modules.xml.wsdl.ui.property.model.SimpleCustomizer newSimpleCustomizer() { 107 return new org.netbeans.modules.xml.wsdl.ui.property.model.SimpleCustomizer(); 108 } 109 110 114 public org.netbeans.modules.xml.wsdl.ui.property.model.SimpleCustomizer newSimpleCustomizer(SimpleCustomizer source, boolean justData) { 115 return new org.netbeans.modules.xml.wsdl.ui.property.model.SimpleCustomizer(source, justData); 116 } 117 118 public void writeNode(java.io.Writer out) throws java.io.IOException { 119 String myName; 120 myName = "BuiltInCustomizer"; 121 writeNode(out, myName, ""); } 123 124 public void writeNode(java.io.Writer out, String nodeName, String indent) throws java.io.IOException { 125 writeNode(out, nodeName, null, indent, new java.util.HashMap ()); 126 } 127 128 131 public void writeNode(java.io.Writer out, String nodeName, String namespace, String indent, java.util.Map namespaceMap) throws java.io.IOException { 132 out.write(indent); 133 out.write("<"); 134 if (namespace != null) { 135 out.write((String )namespaceMap.get(namespace)); 136 out.write(":"); 137 } 138 out.write(nodeName); 139 writeNodeAttributes(out, nodeName, namespace, indent, namespaceMap); 140 out.write(">\n"); 141 writeNodeChildren(out, nodeName, namespace, indent, namespaceMap); 142 out.write(indent); 143 out.write("</"); 144 if (namespace != null) { 145 out.write((String )namespaceMap.get(namespace)); 146 out.write(":"); 147 } 148 out.write(nodeName); 149 out.write(">\n"); 150 } 151 152 protected void writeNodeAttributes(java.io.Writer out, String nodeName, String namespace, String indent, java.util.Map namespaceMap) throws java.io.IOException { 153 } 154 155 protected void writeNodeChildren(java.io.Writer out, String nodeName, String namespace, String indent, java.util.Map namespaceMap) throws java.io.IOException { 156 String nextIndent = indent + " "; 157 if (_DependsOnCustomizer != null) { 158 _DependsOnCustomizer.writeNode(out, "DependsOnCustomizer", null, nextIndent, namespaceMap); 159 } 160 if (_SimpleCustomizer != null) { 161 _SimpleCustomizer.writeNode(out, "SimpleCustomizer", null, nextIndent, namespaceMap); 162 } 163 } 164 165 public void readNode(org.w3c.dom.Node node) { 166 readNode(node, new java.util.HashMap ()); 167 } 168 169 public void readNode(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { 170 if (node.hasAttributes()) { 171 org.w3c.dom.NamedNodeMap attrs = node.getAttributes(); 172 org.w3c.dom.Attr attr; 173 java.lang.String attrValue; 174 boolean firstNamespaceDef = true; 175 for (int attrNum = 0; attrNum < attrs.getLength(); ++attrNum) { 176 attr = (org.w3c.dom.Attr ) attrs.item(attrNum); 177 String attrName = attr.getName(); 178 if (attrName.startsWith("xmlns:")) { 179 if (firstNamespaceDef) { 180 firstNamespaceDef = false; 181 namespacePrefixes = new java.util.HashMap (namespacePrefixes); 183 } 184 String attrNSPrefix = attrName.substring(6, attrName.length()); 185 namespacePrefixes.put(attrNSPrefix, attr.getValue()); 186 } 187 } 188 readNodeAttributes(node, namespacePrefixes, attrs); 189 } 190 readNodeChildren(node, namespacePrefixes); 191 } 192 193 protected void readNodeAttributes(org.w3c.dom.Node node, java.util.Map namespacePrefixes, org.w3c.dom.NamedNodeMap attrs) { 194 org.w3c.dom.Attr attr; 195 java.lang.String attrValue; 196 } 197 198 protected void readNodeChildren(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { 199 org.w3c.dom.NodeList children = node.getChildNodes(); 200 for (int i = 0, size = children.getLength(); i < size; ++i) { 201 org.w3c.dom.Node childNode = children.item(i); 202 String childNodeName = (childNode.getLocalName() == null ? childNode.getNodeName().intern() : childNode.getLocalName().intern()); 203 String childNodeValue = ""; 204 if (childNode.getFirstChild() != null) { 205 childNodeValue = childNode.getFirstChild().getNodeValue(); 206 } 207 if (childNodeName == "DependsOnCustomizer") { 208 _DependsOnCustomizer = newDependsOnCustomizer(); 209 _DependsOnCustomizer.readNode(childNode, namespacePrefixes); 210 } 211 else if (childNodeName == "SimpleCustomizer") { 212 _SimpleCustomizer = newSimpleCustomizer(); 213 _SimpleCustomizer.readNode(childNode, namespacePrefixes); 214 } 215 else { 216 } 218 } 219 } 220 221 public void changePropertyByName(String name, Object value) { 222 if (name == null) return; 223 name = name.intern(); 224 if (name == "dependsOnCustomizer") 225 setDependsOnCustomizer((DependsOnCustomizer)value); 226 else if (name == "simpleCustomizer") 227 setSimpleCustomizer((SimpleCustomizer)value); 228 else 229 throw new IllegalArgumentException (name+" is not a valid property name for BuiltInCustomizer"); 230 } 231 232 public Object fetchPropertyByName(String name) { 233 if (name == "dependsOnCustomizer") 234 return getDependsOnCustomizer(); 235 if (name == "simpleCustomizer") 236 return getSimpleCustomizer(); 237 throw new IllegalArgumentException (name+" is not a valid property name for BuiltInCustomizer"); 238 } 239 240 public String nameSelf() { 241 return "BuiltInCustomizer"; 242 } 243 244 public String nameChild(Object childObj) { 245 return nameChild(childObj, false, false); 246 } 247 248 253 public String nameChild(Object childObj, boolean returnConstName, boolean returnSchemaName) { 254 return nameChild(childObj, returnConstName, returnSchemaName, false); 255 } 256 257 262 public String nameChild(Object childObj, boolean returnConstName, boolean returnSchemaName, boolean returnXPathName) { 263 if (childObj instanceof SimpleCustomizer) { 264 SimpleCustomizer child = (SimpleCustomizer) childObj; 265 if (child == _SimpleCustomizer) { 266 if (returnConstName) { 267 return SIMPLECUSTOMIZER; 268 } else if (returnSchemaName) { 269 return "SimpleCustomizer"; 270 } else if (returnXPathName) { 271 return "SimpleCustomizer"; 272 } else { 273 return "SimpleCustomizer"; 274 } 275 } 276 } 277 if (childObj instanceof DependsOnCustomizer) { 278 DependsOnCustomizer child = (DependsOnCustomizer) childObj; 279 if (child == _DependsOnCustomizer) { 280 if (returnConstName) { 281 return DEPENDSONCUSTOMIZER; 282 } else if (returnSchemaName) { 283 return "DependsOnCustomizer"; 284 } else if (returnXPathName) { 285 return "DependsOnCustomizer"; 286 } else { 287 return "DependsOnCustomizer"; 288 } 289 } 290 } 291 return null; 292 } 293 294 297 public java.lang.Object [] childBeans(boolean recursive) { 298 java.util.List children = new java.util.LinkedList (); 299 childBeans(recursive, children); 300 java.lang.Object [] result = new java.lang.Object [children.size()]; 301 return (java.lang.Object []) children.toArray(result); 302 } 303 304 307 public void childBeans(boolean recursive, java.util.List beans) { 308 if (_DependsOnCustomizer != null) { 309 if (recursive) { 310 _DependsOnCustomizer.childBeans(true, beans); 311 } 312 beans.add(_DependsOnCustomizer); 313 } 314 if (_SimpleCustomizer != null) { 315 if (recursive) { 316 _SimpleCustomizer.childBeans(true, beans); 317 } 318 beans.add(_SimpleCustomizer); 319 } 320 } 321 322 public boolean equals(Object o) { 323 return o instanceof org.netbeans.modules.xml.wsdl.ui.property.model.BuiltInCustomizer && equals((org.netbeans.modules.xml.wsdl.ui.property.model.BuiltInCustomizer) o); 324 } 325 326 public boolean equals(org.netbeans.modules.xml.wsdl.ui.property.model.BuiltInCustomizer inst) { 327 if (inst == this) { 328 return true; 329 } 330 if (inst == null) { 331 return false; 332 } 333 if (!(_DependsOnCustomizer == null ? inst._DependsOnCustomizer == null : _DependsOnCustomizer.equals(inst._DependsOnCustomizer))) { 334 return false; 335 } 336 if (!(_SimpleCustomizer == null ? inst._SimpleCustomizer == null : _SimpleCustomizer.equals(inst._SimpleCustomizer))) { 337 return false; 338 } 339 return true; 340 } 341 342 public int hashCode() { 343 int result = 17; 344 result = 37*result + (_DependsOnCustomizer == null ? 0 : _DependsOnCustomizer.hashCode()); 345 result = 37*result + (_SimpleCustomizer == null ? 0 : _SimpleCustomizer.hashCode()); 346 return result; 347 } 348 349 } 350 351 352 578 | Popular Tags |