org.onebusaway.gtfs.csv
Class CSVLibrary

java.lang.Object
  extended by org.onebusaway.gtfs.csv.CSVLibrary

public class CSVLibrary
extends java.lang.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

Constructor Summary
CSVLibrary()
           
 
Method Summary
static java.lang.String escapeValue(java.lang.String value)
           
static java.lang.String getArrayAsCSV(double[] args)
           
static
<T> java.lang.String
getArrayAsCSV(T[] args)
           
static java.lang.String getAsCSV(java.lang.Object... args)
           
static
<T> java.lang.String
getIterableAsCSV(java.lang.Iterable<T> args)
           
static void parse(java.io.BufferedReader r, CSVListener handler)
           
static void parse(java.io.File input, CSVListener handler)
           
static void parse(java.io.InputStream is, CSVListener handler)
           
static java.util.List<java.lang.String> parse(java.lang.String line)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVLibrary

public CSVLibrary()
Method Detail

escapeValue

public static java.lang.String escapeValue(java.lang.String value)

getArrayAsCSV

public static java.lang.String getArrayAsCSV(double[] args)

getArrayAsCSV

public static <T> java.lang.String getArrayAsCSV(T[] args)

getIterableAsCSV

public static <T> java.lang.String getIterableAsCSV(java.lang.Iterable<T> args)

getAsCSV

public static java.lang.String getAsCSV(java.lang.Object... args)

parse

public static final void parse(java.io.InputStream is,
                               CSVListener handler)
                        throws java.lang.Exception
Throws:
java.lang.Exception

parse

public static final void parse(java.io.File input,
                               CSVListener handler)
                        throws java.lang.Exception
Throws:
java.lang.Exception

parse

public static void parse(java.io.BufferedReader r,
                         CSVListener handler)
                  throws java.io.IOException,
                         java.lang.Exception
Throws:
java.io.IOException
java.lang.Exception

parse

public static final java.util.List<java.lang.String> parse(java.lang.String line)


Copyright © 2011 OneBusAway. All Rights Reserved.