1 8 9 package org.uddi4j.request; 10 11 import java.util.Vector ; 12 13 import org.uddi4j.UDDIElement; 14 import org.uddi4j.UDDIException; 15 import org.uddi4j.datatype.business.BusinessEntity; 16 import org.uddi4j.datatype.service.BusinessService; 17 import org.uddi4j.datatype.tmodel.TModel; 18 import org.w3c.dom.Element ; 19 import org.w3c.dom.NodeList ; 20 21 46 public class ValidateValues extends UDDIElement { 47 public static final String UDDI_TAG = "validate_values"; 48 49 protected Element base = null; 50 51 Vector businessServiceVector = new Vector (); 52 Vector businessEntityVector = new Vector (); 53 Vector tModelVector = new Vector (); 54 55 61 public ValidateValues() { 62 } 63 64 74 public ValidateValues(Element base) throws UDDIException { 75 super(base); 77 NodeList nl = null; 78 79 nl = getChildElementsByTagName(base, BusinessEntity.UDDI_TAG); 80 for (int i=0; i < nl.getLength(); i++) { 81 businessEntityVector.addElement(new BusinessEntity((Element)nl.item(i))); 82 } 83 84 nl = getChildElementsByTagName(base, BusinessService.UDDI_TAG); 85 for (int i=0; i < nl.getLength(); i++) { 86 businessServiceVector.addElement(new BusinessService((Element)nl.item(i))); 87 } 88 89 nl = getChildElementsByTagName(base, TModel.UDDI_TAG); 90 for (int i=0; i < nl.getLength(); i++) { 91 tModelVector.addElement(new TModel((Element)nl.item(i))); 92 } 93 } 94 95 public Vector getBusinessServiceVector() { 96 return this.businessServiceVector; 97 } 98 99 public void setBusinessServiceVector(Vector businessService) { 100 this.businessServiceVector = businessService; 101 } 102 103 public Vector getBusinessEntityVector() { 104 return this.businessEntityVector; 105 } 106 107 public void setBusinessEntityVector(Vector businessEntity) { 108 this.businessEntityVector = businessEntity; 109 } 110 111 public Vector getTModelVector() { 112 return this.tModelVector; 113 } 114 115 public void setTModelVector(Vector tModel) { 116 this.tModelVector = tModel; 117 } 118 119 128 public void saveToXML(Element parent) { 129 base = parent.getOwnerDocument().createElement(UDDI_TAG); 130 base.setAttribute("generic", UDDIElement.GENERIC); 132 base.setAttribute("xmlns", UDDIElement.XMLNS); 133 if (businessEntityVector!=null) { 134 for (int i=0; i < businessEntityVector.size(); i++) { 135 ((BusinessEntity)(businessEntityVector.elementAt(i))).saveToXML(base); 136 } 137 } 138 if (businessServiceVector!=null) { 139 for (int i=0; i < businessServiceVector.size(); i++) { 140 ((BusinessService)(businessServiceVector.elementAt(i))).saveToXML(base); 141 } 142 } 143 if (tModelVector!=null) { 144 for (int i=0; i < tModelVector.size(); i++) { 145 ((TModel)(tModelVector.elementAt(i))).saveToXML(base); 146 } 147 } 148 149 parent.appendChild(base); 150 } 151 } 152 | Popular Tags |