public String optionalAttributes(Collection<Attribute> attrs) { if ((attrs == null) || (attrs.isEmpty())) { return ""; } StringBuffer sb = new StringBuffer(); boolean first = true; for (Attribute attr : attrs) { if (first) { sb.append(symbol(",[") + attr.toNotationString()); first = false; } else { sb.append(symbol(",") + " " + attr.toNotationString()); } } if (!first) sb.append(symbol("]")); return sb.toString(); }
public String optionalAttributes(Collection<Attribute> attrs) { if ((attrs == null) || (attrs.isEmpty())) { return ""; } StringBuffer sb = new StringBuffer(); boolean first = true; for (Attribute attr : attrs) { if (first) { sb.append(symbol(",[") + attr.toNotationString()); first = false; } else { sb.append(symbol(",") + " " + attr.toNotationString()); } } if (!first) sb.append(symbol("]")); return sb.toString(); }