public void addAttribute(String nsUri, String localName, Object arg) { checkWritable(); // look for the existing ones Attribute a; for (a = firstAtt; a != null; a = a.next) { if (a.hasName(nsUri, localName)) { break; } } // if not found, declare a new one if (a == null) { a = new Attribute(nsUri, localName); if (lastAtt == null) { assert firstAtt == null; firstAtt = lastAtt = a; } else { assert firstAtt != null; lastAtt.next = a; lastAtt = a; } if (nsUri.length() > 0) addNamespaceDecl(nsUri, null, true); } document.writeValue(arg, this, a.value); }
public void visitAttribute(final Attribute attr) { attr.next = attrs; attrs = attr; }