public AttributeNameIterator(HierarchicalStreamReader reader) { this.reader = reader; count = reader.getAttributeCount(); }
public int getAttributeCount() { return wrapped.getAttributeCount(); }
public XStreamDOM unmarshalElement(HierarchicalStreamReader r, UnmarshallingContext context) { String name = escape(r.getNodeName()); int c = r.getAttributeCount(); String[] attributes = new String[c*2]; for (int i=0; i<c; i++) { attributes[i*2] = escape(r.getAttributeName(i)); attributes[i*2+1] = r.getAttribute(i); } List<XStreamDOM> children = null; String value = null; if (r.hasMoreChildren()) { children = new ArrayList<XStreamDOM>(); while (r.hasMoreChildren()) { children.add(unmarshal(r, context)); } } else { value = r.getValue(); } return new XStreamDOM(name,attributes,children,value); } }
public void copy(HierarchicalStreamReader source, HierarchicalStreamWriter destination) { destination.startNode(source.getNodeName()); int attributeCount = source.getAttributeCount(); for (int i = 0; i < attributeCount; i++) { destination.addAttribute(source.getAttributeName(i), source.getAttribute(i)); } String value = source.getValue(); if (value != null && value.length() > 0) { destination.setValue(value); } while (source.hasMoreChildren()) { source.moveDown(); copy(source, destination); source.moveUp(); } destination.endNode(); } }
public AttributeNameIterator(final HierarchicalStreamReader reader) { this.reader = reader; count = reader.getAttributeCount(); }
@Override public int getAttributeCount() { return _hierarchicalStreamReader.getAttributeCount(); }
public AttributeNameIterator(HierarchicalStreamReader reader) { this.reader = reader; count = reader.getAttributeCount(); }
@Override public int getAttributeCount() { return wrapped.getAttributeCount(); }
public AttributeNameIterator(HierarchicalStreamReader reader) { this.reader = reader; count = reader.getAttributeCount(); }
public AttributeNameIterator(HierarchicalStreamReader reader) { this.reader = reader; count = reader.getAttributeCount(); }
public AttributeNameIterator(HierarchicalStreamReader reader) { this.reader = reader; count = reader.getAttributeCount(); }
public int getAttributeCount() { return wrapped.getAttributeCount(); }
public int getAttributeCount() { return wrapped.getAttributeCount(); }
public int getAttributeCount() { return wrapped.getAttributeCount(); }
public AttributeNameIterator(HierarchicalStreamReader reader) { this.reader = reader; count = reader.getAttributeCount(); }
public AttributeNameIterator(HierarchicalStreamReader reader) { this.reader = reader; count = reader.getAttributeCount(); }
public AttributeNameIterator(HierarchicalStreamReader reader) { this.reader = reader; count = reader.getAttributeCount(); }
public int getAttributeCount() { return wrapped.getAttributeCount(); }
public int getAttributeCount() { return wrapped.getAttributeCount(); }
/** * Asserts that the current node associated with the specified reader does <i>not</i> contain * any attributes. * * @param reader the reader to be used for validation (must not be null) * @throws ConversionException if the condition does not fit */ public static void assertNoAttribute(HierarchicalStreamReader reader) throws ConversionException { if (reader.getAttributeCount() > 0) { throw new ConversionException("The parameter '" + reader.getNodeName() + "' uses unknown attributes!"); } }