1 19 20 33 34 package org.netbeans.modules.xml.wsdl.ui.property.model; 35 36 public class DependsOnCustomizer { 37 public static final String NAME = "Name"; public static final String STATICCUSTOMIZER = "StaticCustomizer"; 40 private java.lang.String _Name = "MessageChooser"; 41 private StaticCustomizer _StaticCustomizer; 42 43 46 public DependsOnCustomizer() { 47 _StaticCustomizer = newStaticCustomizer(); 48 } 49 50 53 public DependsOnCustomizer(java.lang.String name, org.netbeans.modules.xml.wsdl.ui.property.model.StaticCustomizer staticCustomizer) { 54 _Name = name; 55 _StaticCustomizer = staticCustomizer; 56 } 57 58 61 public DependsOnCustomizer(org.netbeans.modules.xml.wsdl.ui.property.model.DependsOnCustomizer source) { 62 this(source, false); 63 } 64 65 69 public DependsOnCustomizer(org.netbeans.modules.xml.wsdl.ui.property.model.DependsOnCustomizer source, boolean justData) { 70 _Name = source._Name; 71 _StaticCustomizer = (source._StaticCustomizer == null) ? null : newStaticCustomizer(source._StaticCustomizer, justData); 72 } 73 74 public void setName(java.lang.String value) { 76 _Name = value; 77 } 78 79 public java.lang.String getName() { 80 return _Name; 81 } 82 83 public void setStaticCustomizer(org.netbeans.modules.xml.wsdl.ui.property.model.StaticCustomizer value) { 85 _StaticCustomizer = value; 86 } 87 88 public org.netbeans.modules.xml.wsdl.ui.property.model.StaticCustomizer getStaticCustomizer() { 89 return _StaticCustomizer; 90 } 91 92 96 public org.netbeans.modules.xml.wsdl.ui.property.model.StaticCustomizer newStaticCustomizer() { 97 return new org.netbeans.modules.xml.wsdl.ui.property.model.StaticCustomizer(); 98 } 99 100 104 public org.netbeans.modules.xml.wsdl.ui.property.model.StaticCustomizer newStaticCustomizer(StaticCustomizer source, boolean justData) { 105 return new org.netbeans.modules.xml.wsdl.ui.property.model.StaticCustomizer(source, justData); 106 } 107 108 public void writeNode(java.io.Writer out) throws java.io.IOException { 109 String myName; 110 myName = "DependsOnCustomizer"; 111 writeNode(out, myName, ""); } 113 114 public void writeNode(java.io.Writer out, String nodeName, String indent) throws java.io.IOException { 115 writeNode(out, nodeName, null, indent, new java.util.HashMap ()); 116 } 117 118 121 public void writeNode(java.io.Writer out, String nodeName, String namespace, String indent, java.util.Map namespaceMap) throws java.io.IOException { 122 out.write(indent); 123 out.write("<"); 124 if (namespace != null) { 125 out.write((String )namespaceMap.get(namespace)); 126 out.write(":"); 127 } 128 out.write(nodeName); 129 writeNodeAttributes(out, nodeName, namespace, indent, namespaceMap); 130 out.write(">\n"); 131 writeNodeChildren(out, nodeName, namespace, indent, namespaceMap); 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 out.write(">\n"); 140 } 141 142 protected void writeNodeAttributes(java.io.Writer out, String nodeName, String namespace, String indent, java.util.Map namespaceMap) throws java.io.IOException { 143 if (_Name != null) { 145 out.write(" name='"); 146 org.netbeans.modules.xml.wsdl.ui.property.model.ElementProperties.writeXML(out, _Name, true); 147 out.write("'"); } 149 } 150 151 protected void writeNodeChildren(java.io.Writer out, String nodeName, String namespace, String indent, java.util.Map namespaceMap) throws java.io.IOException { 152 String nextIndent = indent + " "; 153 if (_StaticCustomizer != null) { 154 _StaticCustomizer.writeNode(out, "StaticCustomizer", null, nextIndent, namespaceMap); 155 } 156 } 157 158 public void readNode(org.w3c.dom.Node node) { 159 readNode(node, new java.util.HashMap ()); 160 } 161 162 public void readNode(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { 163 if (node.hasAttributes()) { 164 org.w3c.dom.NamedNodeMap attrs = node.getAttributes(); 165 org.w3c.dom.Attr attr; 166 java.lang.String attrValue; 167 boolean firstNamespaceDef = true; 168 for (int attrNum = 0; attrNum < attrs.getLength(); ++attrNum) { 169 attr = (org.w3c.dom.Attr ) attrs.item(attrNum); 170 String attrName = attr.getName(); 171 if (attrName.startsWith("xmlns:")) { 172 if (firstNamespaceDef) { 173 firstNamespaceDef = false; 174 namespacePrefixes = new java.util.HashMap (namespacePrefixes); 176 } 177 String attrNSPrefix = attrName.substring(6, attrName.length()); 178 namespacePrefixes.put(attrNSPrefix, attr.getValue()); 179 } 180 } 181 readNodeAttributes(node, namespacePrefixes, attrs); 182 } 183 readNodeChildren(node, namespacePrefixes); 184 } 185 186 protected void readNodeAttributes(org.w3c.dom.Node node, java.util.Map namespacePrefixes, org.w3c.dom.NamedNodeMap attrs) { 187 org.w3c.dom.Attr attr; 188 java.lang.String attrValue; 189 attr = (org.w3c.dom.Attr ) attrs.getNamedItem("name"); 190 if (attr != null) { 191 attrValue = attr.getValue(); 192 _Name = attrValue; 193 } 194 } 195 196 protected void readNodeChildren(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { 197 org.w3c.dom.NodeList children = node.getChildNodes(); 198 for (int i = 0, size = children.getLength(); i < size; ++i) { 199 org.w3c.dom.Node childNode = children.item(i); 200 String childNodeName = (childNode.getLocalName() == null ? childNode.getNodeName().intern() : childNode.getLocalName().intern()); 201 String childNodeValue = ""; 202 if (childNode.getFirstChild() != null) { 203 childNodeValue = childNode.getFirstChild().getNodeValue(); 204 } 205 if (childNodeName == "StaticCustomizer") { 206 _StaticCustomizer = newStaticCustomizer(); 207 _StaticCustomizer.readNode(childNode, namespacePrefixes); 208 } 209 else { 210 } 212 } 213 } 214 215 public void changePropertyByName(String name, Object value) { 216 if (name == null) return; 217 name = name.intern(); 218 if (name == "name") 219 setName((java.lang.String )value); 220 else if (name == "staticCustomizer") 221 setStaticCustomizer((StaticCustomizer)value); 222 else 223 throw new IllegalArgumentException (name+" is not a valid property name for DependsOnCustomizer"); 224 } 225 226 public Object fetchPropertyByName(String name) { 227 if (name == "name") 228 return getName(); 229 if (name == "staticCustomizer") 230 return getStaticCustomizer(); 231 throw new IllegalArgumentException (name+" is not a valid property name for DependsOnCustomizer"); 232 } 233 234 public String nameSelf() { 235 return "DependsOnCustomizer"; 236 } 237 238 public String nameChild(Object childObj) { 239 return nameChild(childObj, false, false); 240 } 241 242 247 public String nameChild(Object childObj, boolean returnConstName, boolean returnSchemaName) { 248 return nameChild(childObj, returnConstName, returnSchemaName, false); 249 } 250 251 256 public String nameChild(Object childObj, boolean returnConstName, boolean returnSchemaName, boolean returnXPathName) { 257 if (childObj instanceof StaticCustomizer) { 258 StaticCustomizer child = (StaticCustomizer) childObj; 259 if (child == _StaticCustomizer) { 260 if (returnConstName) { 261 return STATICCUSTOMIZER; 262 } else if (returnSchemaName) { 263 return "StaticCustomizer"; 264 } else if (returnXPathName) { 265 return "StaticCustomizer"; 266 } else { 267 return "StaticCustomizer"; 268 } 269 } 270 } 271 if (childObj instanceof java.lang.String ) { 272 java.lang.String child = (java.lang.String ) childObj; 273 if (child == _Name) { 274 if (returnConstName) { 275 return NAME; 276 } else if (returnSchemaName) { 277 return "name"; 278 } else if (returnXPathName) { 279 return "@name"; 280 } else { 281 return "Name"; 282 } 283 } 284 } 285 return null; 286 } 287 288 291 public java.lang.Object [] childBeans(boolean recursive) { 292 java.util.List children = new java.util.LinkedList (); 293 childBeans(recursive, children); 294 java.lang.Object [] result = new java.lang.Object [children.size()]; 295 return (java.lang.Object []) children.toArray(result); 296 } 297 298 301 public void childBeans(boolean recursive, java.util.List beans) { 302 if (_StaticCustomizer != null) { 303 if (recursive) { 304 _StaticCustomizer.childBeans(true, beans); 305 } 306 beans.add(_StaticCustomizer); 307 } 308 } 309 310 public boolean equals(Object o) { 311 return o instanceof org.netbeans.modules.xml.wsdl.ui.property.model.DependsOnCustomizer && equals((org.netbeans.modules.xml.wsdl.ui.property.model.DependsOnCustomizer) o); 312 } 313 314 public boolean equals(org.netbeans.modules.xml.wsdl.ui.property.model.DependsOnCustomizer inst) { 315 if (inst == this) { 316 return true; 317 } 318 if (inst == null) { 319 return false; 320 } 321 if (!(_Name == null ? inst._Name == null : _Name.equals(inst._Name))) { 322 return false; 323 } 324 if (!(_StaticCustomizer == null ? inst._StaticCustomizer == null : _StaticCustomizer.equals(inst._StaticCustomizer))) { 325 return false; 326 } 327 return true; 328 } 329 330 public int hashCode() { 331 int result = 17; 332 result = 37*result + (_Name == null ? 0 : _Name.hashCode()); 333 result = 37*result + (_StaticCustomizer == null ? 0 : _StaticCustomizer.hashCode()); 334 return result; 335 } 336 337 } 338 339 340 566 | Popular Tags |