protected static ProtocolParameter[] parseProtocolParameters(Element protparams) throws IOException { try { Vector v=new Vector(); protparams.normalize(); NodeList parameters=protparams.getChildNodes(); for(int i=0; i < parameters.getLength(); i++) { if(parameters.item(i).getNodeType() == Node.ELEMENT_NODE) { String pname=parameters.item(i).getAttributes().getNamedItem(ATTR_NAME).getNodeValue(); String pvalue=parameters.item(i).getAttributes().getNamedItem(ATTR_VALUE).getNodeValue(); ProtocolParameter p=new ProtocolParameter(pname, pvalue); v.addElement(p); }//end if }//for ProtocolParameter[] result=new ProtocolParameter[v.size()]; v.copyInto(result); return result; } catch(Exception x) { IOException tmp=new IOException(); tmp.initCause(x); throw tmp; } }
String value = attr.getValue(); tmp.add(new ProtocolParameter(name, value));