/** Returns the input writer as-is if it is an XMLWriter instance. Returns new XMLWriter(writer) otherwise */ @SuppressWarnings("resource") public static XMLWriter from(Writer writer, int maxIndentLevel,int maxLineSeparatorLevel) { return (writer instanceof XMLWriter) ? (XMLWriter)writer : new XMLWriter(writer, maxIndentLevel, maxLineSeparatorLevel); }
/** Returns the input writer as-is if it is an XMLWriter instance. Returns new XMLWriter(writer) otherwise */ @SuppressWarnings("resource") public static XMLWriter from(Writer writer) { return (writer instanceof XMLWriter) ? (XMLWriter)writer : new XMLWriter(writer); }