protected void loadAfterStartTag(XmlInputStream in, TypeMapper typeMapper) throws IOException, ConnectionException { StringBuilder text = new StringBuilder(); boolean textFound = false; while (true) { int type = in.peek(); if (type == XmlInputStream.START_TAG) { XmlObject child = extractChildElement(in, typeMapper); child.load(in, typeMapper); children.add(child); } else if (type == XmlInputStream.TEXT) { in.consumePeeked(); text.append(in.getText()); textFound = true; } else if (type == XmlInputStream.END_TAG) { in.consumePeeked(); String ns = in.getNamespace(); String n = in.getName(); if (name.getNamespaceURI().equals(ns) && name.getLocalPart().equals(n)) { break; } } else { throw new ConnectionException("unknown tag:" + type + " at " + in); } } if (textFound) value = typeMapper.deserialize(text.toString(), xmlType); }
protected void loadAfterStartTag(XmlInputStream in, TypeMapper typeMapper) throws IOException, ConnectionException { StringBuilder text = new StringBuilder(); boolean textFound = false; while (true) { int type = in.peek(); if (type == XmlInputStream.START_TAG) { XmlObject child = extractChildElement(in, typeMapper); child.load(in, typeMapper); children.add(child); } else if (type == XmlInputStream.TEXT) { in.consumePeeked(); text.append(in.getText()); textFound = true; } else if (type == XmlInputStream.END_TAG) { in.consumePeeked(); String ns = in.getNamespace(); String n = in.getName(); if (name.getNamespaceURI().equals(ns) && name.getLocalPart().equals(n)) { break; } } else { throw new ConnectionException("unknown tag:" + type + " at " + in); } } if (textFound) value = typeMapper.deserialize(text.toString(), xmlType); }