rebuildIndentationBuf(); seenTag = false; // for consistency
public void setProperty(String name, Object value) throws IllegalArgumentException, IllegalStateException { if(name == null) { throw new IllegalArgumentException("property name can not be null"); } if(PROPERTY_SERIALIZER_INDENTATION.equals(name)) { indentationString = (String)value; } else if(PROPERTY_SERIALIZER_LINE_SEPARATOR.equals(name)) { lineSeparator = (String)value; } else if(PROPERTY_LOCATION.equals(name)) { location = (String) value; } else { throw new IllegalStateException("unsupported property "+name); } writeLineSepartor = lineSeparator != null && lineSeparator.length() > 0; writeIndentation = indentationString != null && indentationString.length() > 0; // optimize - do not write when nothing to write ... doIndent = indentationString != null && (writeLineSepartor || writeIndentation); //NOTE: when indentationString == null there is no indentation // (even though writeLineSeparator may be true ...) rebuildIndentationBuf(); seenTag = false; // for consistency }