/** * Creates an instance, allowing the new line character to be controlled and using a comma separator. * <p> * See the standard quoting rules in the class-level documentation. * * @param underlying the destination to write to * @param newLine the new line string * @return the CSV outputter */ public static CsvOutput standard(Appendable underlying, String newLine) { return new CsvOutput(underlying, newLine, COMMA, false); }
/** * Creates an instance, using the system default line separator and using a comma separator. * <p> * See the standard quoting rules in the class-level documentation. * * @param underlying the destination to write to * @return the CSV outputter */ public static CsvOutput standard(Appendable underlying) { return new CsvOutput(underlying, NEW_LINE, COMMA, false); }
/** * Creates an instance, allowing the new line character to be controlled, specifying the separator. * <p> * See the standard quoting rules in the class-level documentation. * * @param underlying the destination to write to * @param newLine the new line string * @param separator the separator used to separate each field, typically a comma, but a tab is sometimes used * @return the CSV outputter */ public static CsvOutput standard(Appendable underlying, String newLine, String separator) { return new CsvOutput(underlying, newLine, separator, false); }
/** * Creates an instance, allowing the new line character to be controlled and using a comma separator. * <p> * This applies the standard quoting rules from the class-level documentation, plus an additional rule. * If an entry starts with an expression character, '=', '@', '+' or '-', the entry * will be quoted and the quote section will be preceeded by equals. * Thus, the string '=Foo' will be written as '="=Foo"'. * This avoids the string being treated as an expression by tools like Excel. * Simple numbers are not quoted. * Thus, the number '-1234' will still be written as '-1234'. * * @param underlying the destination to write to * @param newLine the new line string * @return the CSV outputter */ public static CsvOutput safe(Appendable underlying, String newLine) { return new CsvOutput(underlying, newLine, COMMA, true); }
/** * Creates an instance, using the system default line separator and using a comma separator. * <p> * This applies the standard quoting rules from the class-level documentation, plus an additional rule. * If an entry starts with an expression character, '=', '@', '+' or '-', the entry * will be quoted and the quote section will be preceeded by equals. * Thus, the string '=Foo' will be written as '="=Foo"'. * This avoids the string being treated as an expression by tools like Excel. * Simple numbers are not quoted. * Thus, the number '-1234' will still be written as '-1234'. * * @param underlying the destination to write to * @return the CSV outputter */ public static CsvOutput safe(Appendable underlying) { return new CsvOutput(underlying, NEW_LINE, COMMA, true); }
/** * Creates an instance, allowing the new line character to be controlled, specifying the separator. * <p> * This applies the standard quoting rules from the class-level documentation, plus an additional rule. * If an entry starts with an expression character, '=', '@', '+' or '-', the entry * will be quoted and the quote section will be preceeded by equals. * Thus, the string '=Foo' will be written as '="=Foo"'. * This avoids the string being treated as an expression by tools like Excel. * Simple numbers are not quoted. * Thus, the number '-1234' will still be written as '-1234'. * * @param underlying the destination to write to * @param newLine the new line string * @param separator the separator used to separate each field, typically a comma, but a tab is sometimes used * @return the CSV outputter */ public static CsvOutput safe(Appendable underlying, String newLine, String separator) { return new CsvOutput(underlying, newLine, separator, true); }