1 19 20 28 29 package org.netbeans.modules.xml.wsdl.ui.property.model; 30 31 public class NewCustomizer { 32 public static final String CLASSNAME = "ClassName"; 34 private java.lang.String _ClassName; 35 36 39 public NewCustomizer() { 40 } 41 42 45 public NewCustomizer(org.netbeans.modules.xml.wsdl.ui.property.model.NewCustomizer source) { 46 this(source, false); 47 } 48 49 53 public NewCustomizer(org.netbeans.modules.xml.wsdl.ui.property.model.NewCustomizer source, boolean justData) { 54 _ClassName = source._ClassName; 55 } 56 57 public void setClassName(java.lang.String value) { 59 _ClassName = value; 60 } 61 62 public java.lang.String getClassName() { 63 return _ClassName; 64 } 65 66 public void writeNode(java.io.Writer out) throws java.io.IOException { 67 String myName; 68 myName = "NewCustomizer"; 69 writeNode(out, myName, ""); } 71 72 public void writeNode(java.io.Writer out, String nodeName, String indent) throws java.io.IOException { 73 writeNode(out, nodeName, null, indent, new java.util.HashMap ()); 74 } 75 76 79 public void writeNode(java.io.Writer out, String nodeName, String namespace, String indent, java.util.Map namespaceMap) throws java.io.IOException { 80 out.write(indent); 81 out.write("<"); 82 if (namespace != null) { 83 out.write((String )namespaceMap.get(namespace)); 84 out.write(":"); 85 } 86 out.write(nodeName); 87 writeNodeAttributes(out, nodeName, namespace, indent, namespaceMap); 88 writeNodeChildren(out, nodeName, namespace, indent, namespaceMap); 89 out.write("/>\n"); 90 } 91 92 protected void writeNodeAttributes(java.io.Writer out, String nodeName, String namespace, String indent, java.util.Map namespaceMap) throws java.io.IOException { 93 if (_ClassName != null) { 95 out.write(" className='"); 96 org.netbeans.modules.xml.wsdl.ui.property.model.ElementProperties.writeXML(out, _ClassName, true); 97 out.write("'"); } 99 } 100 101 protected void writeNodeChildren(java.io.Writer out, String nodeName, String namespace, String indent, java.util.Map namespaceMap) throws java.io.IOException { 102 } 103 104 public void readNode(org.w3c.dom.Node node) { 105 readNode(node, new java.util.HashMap ()); 106 } 107 108 public void readNode(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { 109 if (node.hasAttributes()) { 110 org.w3c.dom.NamedNodeMap attrs = node.getAttributes(); 111 org.w3c.dom.Attr attr; 112 java.lang.String attrValue; 113 boolean firstNamespaceDef = true; 114 for (int attrNum = 0; attrNum < attrs.getLength(); ++attrNum) { 115 attr = (org.w3c.dom.Attr ) attrs.item(attrNum); 116 String attrName = attr.getName(); 117 if (attrName.startsWith("xmlns:")) { 118 if (firstNamespaceDef) { 119 firstNamespaceDef = false; 120 namespacePrefixes = new java.util.HashMap (namespacePrefixes); 122 } 123 String attrNSPrefix = attrName.substring(6, attrName.length()); 124 namespacePrefixes.put(attrNSPrefix, attr.getValue()); 125 } 126 } 127 readNodeAttributes(node, namespacePrefixes, attrs); 128 } 129 readNodeChildren(node, namespacePrefixes); 130 } 131 132 protected void readNodeAttributes(org.w3c.dom.Node node, java.util.Map namespacePrefixes, org.w3c.dom.NamedNodeMap attrs) { 133 org.w3c.dom.Attr attr; 134 java.lang.String attrValue; 135 attr = (org.w3c.dom.Attr ) attrs.getNamedItem("className"); 136 if (attr != null) { 137 attrValue = attr.getValue(); 138 _ClassName = attrValue; 139 } 140 } 141 142 protected void readNodeChildren(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { 143 } 144 145 public void changePropertyByName(String name, Object value) { 146 if (name == null) return; 147 name = name.intern(); 148 if (name == "className") 149 setClassName((java.lang.String )value); 150 else 151 throw new IllegalArgumentException (name+" is not a valid property name for NewCustomizer"); 152 } 153 154 public Object fetchPropertyByName(String name) { 155 if (name == "className") 156 return getClassName(); 157 throw new IllegalArgumentException (name+" is not a valid property name for NewCustomizer"); 158 } 159 160 public String nameSelf() { 161 return "NewCustomizer"; 162 } 163 164 public String nameChild(Object childObj) { 165 return nameChild(childObj, false, false); 166 } 167 168 173 public String nameChild(Object childObj, boolean returnConstName, boolean returnSchemaName) { 174 return nameChild(childObj, returnConstName, returnSchemaName, false); 175 } 176 177 182 public String nameChild(Object childObj, boolean returnConstName, boolean returnSchemaName, boolean returnXPathName) { 183 if (childObj instanceof java.lang.String ) { 184 java.lang.String child = (java.lang.String ) childObj; 185 if (child == _ClassName) { 186 if (returnConstName) { 187 return CLASSNAME; 188 } else if (returnSchemaName) { 189 return "className"; 190 } else if (returnXPathName) { 191 return "@className"; 192 } else { 193 return "ClassName"; 194 } 195 } 196 } 197 return null; 198 } 199 200 203 public java.lang.Object [] childBeans(boolean recursive) { 204 java.util.List children = new java.util.LinkedList (); 205 childBeans(recursive, children); 206 java.lang.Object [] result = new java.lang.Object [children.size()]; 207 return (java.lang.Object []) children.toArray(result); 208 } 209 210 213 public void childBeans(boolean recursive, java.util.List beans) { 214 } 215 216 public boolean equals(Object o) { 217 return o instanceof org.netbeans.modules.xml.wsdl.ui.property.model.NewCustomizer && equals((org.netbeans.modules.xml.wsdl.ui.property.model.NewCustomizer) o); 218 } 219 220 public boolean equals(org.netbeans.modules.xml.wsdl.ui.property.model.NewCustomizer inst) { 221 if (inst == this) { 222 return true; 223 } 224 if (inst == null) { 225 return false; 226 } 227 if (!(_ClassName == null ? inst._ClassName == null : _ClassName.equals(inst._ClassName))) { 228 return false; 229 } 230 return true; 231 } 232 233 public int hashCode() { 234 int result = 17; 235 result = 37*result + (_ClassName == null ? 0 : _ClassName.hashCode()); 236 return result; 237 } 238 239 } 240 241 242 353 | Popular Tags |