@Test public void start() { try { final Collection v = new Vector(); v.add(new String("a string in vector")); v.add(new Integer(100)); v.add(new Boolean("true")); final Hashtable h = new Hashtable(); final Hashtable subHash = new Hashtable(); h.put(new Integer(1), new String("un")); h.put(new String("deux"), new Integer(2)); h.put(new String("a vector"), v); h.put(new String("a null UID"), UID.NULLUID); h.put(new String("a false boolean"), new Boolean("false")); subHash.put(new Integer(10), new String("dix")); subHash.put(new String("dix"), new Integer(10)); subHash.put(new String("a vector"), v); h.put(new String("an hashtable"), subHash); final XMLHashtable hRead = new XMLHashtable(); final XMLHashtable hWrite = new XMLHashtable(h); final File temp = File.createTempFile("xw-junit", "itf"); final FileOutputStream fout = new FileOutputStream(temp); final DataOutputStream out = new DataOutputStream(fout); hWrite.setLoggerLevel(LoggerLevel.DEBUG); hWrite.setDUMPNULLS(true); final XMLWriter writer = new XMLWriter(out); writer.write(hWrite); final XMLReader reader = new XMLReader(hRead); reader.read(new FileInputStream(temp)); hRead.setDUMPNULLS(true); assertTrue(hWrite.toXml().equals(hRead.toXml())); } catch (final Exception e) { logger.exception(e); assert(false); } }
@Override public String toXml() { final StringBuilder ret = new StringBuilder( "<" + getXMLTag() + " " + getColumnLabel(SIZEIDX) + "=\"" + size + "\" >"); for (int i = 0; i < size; i++) { ret.append(tuples[i].toXml()); } ret.append("</" + getXMLTag() + ">"); return ret.toString(); }
XMLHashtable extends XMLValue { @Override public String toXml() { final StringBuilder ret = new StringBuilder( "<" + getXMLTag() + " " + getColumnLabel(SIZEIDX) + "=\"" + size + "\" >"); for (int i = 0; i < size; i++) { ret.append(tuples[i].toXml()); } ret.append("</" + getXMLTag() + ">"); return ret.toString(); } }
XMLHashtable extends XMLValue { @Override public String toXml() { final StringBuilder ret = new StringBuilder( "<" + getXMLTag() + " " + getColumnLabel(SIZEIDX) + "=\"" + size + "\" >"); for (int i = 0; i < size; i++) { ret.append(tuples[i].toXml()); } ret.append("</" + getXMLTag() + ">"); return ret.toString(); } XMLHashtable();  XMLHashtable(final Hashtable h);  XMLHashtable(final String input);  XMLHashtable(final DataInputStream input);  XMLHashtable(final Attributes attrs); }
XMLHashtable extends XMLValue { @Override public String toXml() { final StringBuilder ret = new StringBuilder( "<" + getXMLTag() + " " + getColumnLabel(SIZEIDX) + "=\"" + size + "\" >"); for (int i = 0; i < size; i++) { ret.append(tuples[i].toXml()); } ret.append("</" + getXMLTag() + ">"); return ret.toString(); } XMLHashtable();  XMLHashtable(final Hashtable h);  XMLHashtable(final String input);  XMLHashtable(final DataInputStream input);  XMLHashtable(final Attributes attrs); @Override String toXml(); @Override void toXml(final DataOutputStream o); @Override void fromXml(final Attributes attrs); @Override void xmlElementStart(final String uri, final String tag, final String qname, final Attributes attrs); @Override void xmlElementStop(final String uri, final String tag, final String qname); @Override String toString(); @Override Object getValue(); Hashtable getHashtable(); static void main(final String[] argv); }
XMLHashtable extends XMLValue { @Override public String toXml() { final StringBuilder ret = new StringBuilder( "<" + getXMLTag() + " " + getColumnLabel(SIZEIDX) + "=\"" + size + "\" >"); for (int i = 0; i < size; i++) { ret.append(tuples[i].toXml()); } ret.append("</" + getXMLTag() + ">"); return ret.toString(); } XMLHashtable();  XMLHashtable(final Hashtable h);  XMLHashtable(final String input);  XMLHashtable(final DataInputStream input);  XMLHashtable(final Attributes attrs); @Override String toXml(); @Override void toXml(final DataOutputStream o); @Override void fromXml(final Attributes attrs); @Override void xmlElementStart(final String uri, final String tag, final String qname, final Attributes attrs); @Override void xmlElementStop(final String uri, final String tag, final String qname); @Override String toString(); @Override Object getValue(); Hashtable getHashtable(); static void main(final String[] argv); static final String THISTAG; }