@ParametersAreNonnullByDefault public final class Csv extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
Csv.CsvHandler<T> |
static interface |
Csv.CsvMapHandler<T> |
static interface |
Csv.CsvRowHandler<T> |
Modifier and Type | Field and Description |
---|---|
static CharSeparatedValues |
CSV |
Modifier and Type | Method and Description |
---|---|
static Iterable<Iterable<String>> |
asIterable(Reader preader)
read a CSV stream, as a Iterable over rows.
|
static <T> T |
read(File file,
Charset charset,
Csv.CsvHandler<T> handler) |
static <T> T |
read(File file,
Charset charset,
Csv.CsvMapHandler<T> handler) |
static List<Map<String,String>> |
read(Reader preader) |
static <T> T |
read(Reader preader,
Csv.CsvHandler<T> handler) |
static <T> T |
read(Reader preader,
Csv.CsvMapHandler<T> handler) |
static int |
readCsvElement(Reader reader,
StringBuilder addElemTo)
returns next character.
|
static CsvReader |
reader(Reader preader) |
static CsvReader |
readerNoBOM(PushbackReader reader) |
static <T> T |
readNoBom(PushbackReader reader,
Csv.CsvHandler<T> handler)
reads CSV format until EOF of reader.
|
static List<String> |
readRow(Reader reader) |
static <T> T |
readRow(Reader reader,
Csv.CsvRowHandler<T> handler) |
static List<String> |
readRow(String row) |
static CharSequence |
toCsvElement(CharSequence elem) |
static void |
writeCsvElement(CharSequence elem,
Appendable writer) |
static void |
writeCsvRow(Appendable writer,
Iterable<?> elems) |
static void |
writeCsvRow(Appendable writer,
long... elems) |
static void |
writeCsvRow(Appendable writer,
Object... elems) |
static void |
writeCsvRow2(Appendable writer,
Object obj,
Object... elems) |
static void |
writeCsvRowNoEOL(Iterable<?> elems,
Appendable writer) |
static void |
writeCsvRowNoEOL(long[] elems,
Appendable writer) |
static void |
writeQuotedCsvElement(CharSequence elem,
Appendable writer) |
public static final CharSeparatedValues CSV
public static void writeCsvRow(Appendable writer, Object... elems) throws IOException
IOException
public static void writeCsvRow2(Appendable writer, Object obj, Object... elems) throws IOException
IOException
public static void writeCsvRow(Appendable writer, long... elems) throws IOException
IOException
public static void writeCsvRowNoEOL(long[] elems, Appendable writer) throws IOException
IOException
public static void writeCsvRow(Appendable writer, Iterable<?> elems) throws IOException
IOException
public static void writeCsvRowNoEOL(Iterable<?> elems, Appendable writer) throws IOException
IOException
public static <T> T read(File file, Charset charset, Csv.CsvMapHandler<T> handler) throws IOException, CsvParseException
IOException
CsvParseException
public static <T> T read(File file, Charset charset, Csv.CsvHandler<T> handler) throws IOException, CsvParseException
IOException
CsvParseException
public static List<Map<String,String>> read(Reader preader) throws IOException, CsvParseException
IOException
CsvParseException
public static <T> T read(Reader preader, Csv.CsvMapHandler<T> handler) throws IOException, CsvParseException
IOException
CsvParseException
public static List<String> readRow(String row) throws CsvParseException
CsvParseException
public static List<String> readRow(Reader reader) throws IOException, CsvParseException
IOException
CsvParseException
public static <T> T readRow(Reader reader, Csv.CsvRowHandler<T> handler) throws IOException, CsvParseException
IOException
CsvParseException
public static <T> T read(Reader preader, Csv.CsvHandler<T> handler) throws IOException, CsvParseException
IOException
CsvParseException
public static <T> T readNoBom(PushbackReader reader, Csv.CsvHandler<T> handler) throws IOException, CsvParseException
T
- preader
- handler
- IOException
CsvParseException
public static Iterable<Iterable<String>> asIterable(Reader preader)
preader
- public static CsvReader reader(Reader preader) throws IOException
IOException
public static CsvReader readerNoBOM(PushbackReader reader)
public static void writeCsvElement(CharSequence elem, Appendable writer) throws IOException
IOException
public static void writeQuotedCsvElement(CharSequence elem, Appendable writer) throws IOException
IOException
public static CharSequence toCsvElement(CharSequence elem)
@CheckReturnValue public static int readCsvElement(Reader reader, StringBuilder addElemTo) throws IOException
reader
- addElemTo
- IOException
Copyright © 2018 SPF4J. All rights reserved.