|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.taleo.integration.client.customstep.util.csv.CsvUtils
public class CsvUtils
Utility class for CSV.
Constructor Summary | |
---|---|
CsvUtils()
|
Method Summary | |
---|---|
static java.lang.Object |
deserializeBase64(java.lang.String base64)
Deserialize a Base64 string into an object. |
static int |
getColumnIndex(java.lang.String column,
java.lang.String[] header)
Get the index for the given column name or index. |
static int[] |
getColumnIndexes(java.lang.String[] columns,
java.lang.String[] header)
Get the columns indexes, transforming names into indexes if required. |
static java.lang.String[] |
readFirstLine(java.io.Reader reader,
char csvDelimiter,
char csvQuoteCharacter)
Read the first line from the given reader. |
static java.lang.String[] |
readLine(java.io.Reader reader,
char csvDelimiter,
char csvQuoteCharacter,
int lineNumber)
Read the given line number from the given reader. |
static java.lang.String |
serializeBase64(java.lang.Object object)
Serialize an object into a Base64 string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CsvUtils()
Method Detail |
---|
public static java.lang.String[] readFirstLine(java.io.Reader reader, char csvDelimiter, char csvQuoteCharacter) throws java.io.IOException, InvalidCSVFileFormat
reader
- The reader containing the CSV.csvDelimiter
- csvQuoteCharacter
-
InvalidCSVFileFormat
java.io.IOException
public static java.lang.String[] readLine(java.io.Reader reader, char csvDelimiter, char csvQuoteCharacter, int lineNumber) throws java.io.IOException, InvalidCSVFileFormat
reader
- The reader containing the CSV.csvDelimiter
- csvQuoteCharacter
- lineNumber
- The line number (1 based).
InvalidCSVFileFormat
java.io.IOException
public static int getColumnIndex(java.lang.String column, java.lang.String[] header) throws java.lang.ArrayIndexOutOfBoundsException
column
- The column name or index.header
- The CSV header. May be null if column is numeric.
java.lang.ArrayIndexOutOfBoundsException
- If the column name is not found in the header.public static int[] getColumnIndexes(java.lang.String[] columns, java.lang.String[] header)
columns
- The columns name or index.header
- The CSV header. May be null if all columns are numeric.
java.lang.ArrayIndexOutOfBoundsException
- If a column name is not found in the header.public static java.lang.String serializeBase64(java.lang.Object object) throws java.io.IOException
object
- The object.
java.io.IOException
public static java.lang.Object deserializeBase64(java.lang.String base64) throws java.io.IOException, java.lang.ClassNotFoundException
base64
- The Base64 string.
java.io.IOException
java.lang.ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |