org.onebusaway.csv_entities
Class CSVLibrary
java.lang.Object
org.onebusaway.csv_entities.CSVLibrary
public class CSVLibrary
- extends Object
Why do we have our own CSV reader when there are a couple of existing Java
libraries? Mostly because we need to be able to handle some malformed CSV
that most parsers would choke on but that agencies produce and google seems
to validate as well.
- Author:
- bdferris
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CSVLibrary
public CSVLibrary()
escapeValue
public static String escapeValue(String value)
getArrayAsCSV
public static String getArrayAsCSV(double[] args)
getArrayAsCSV
public static <T> String getArrayAsCSV(T[] args)
getIterableAsCSV
public static <T> String getIterableAsCSV(Iterable<T> args)
getAsCSV
public static String getAsCSV(Object... args)
setTrimInitialWhitespace
public void setTrimInitialWhitespace(boolean trimInitialWhitespace)
parse
public final void parse(InputStream is,
CSVListener handler)
throws Exception
- Throws:
Exception
parse
public final void parse(File input,
CSVListener handler)
throws Exception
- Throws:
Exception
parse
public void parse(BufferedReader r,
CSVListener handler)
throws IOException,
Exception
- Throws:
IOException
Exception
parse
public final List<String> parse(String line)
Copyright © 2012 OneBusAway. All Rights Reserved.