|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--bill.util.csv.CSVLineParser | +--bill.util.csv.CSVLineParserAssociated
Class for parsing line of CSV data, typically from a file. Extends the standard CSVLineParser class to provide an association with a CSVParser. This functionality is in here rather than in CSVLineParser so that class can be used without depending on any other classes from the csv package.
Constructor Summary | |
CSVLineParserAssociated(CSVLineParser line,
CSVParser parser)
Copy constructor that performs a deep copy by reparsing the input CSV line. |
|
CSVLineParserAssociated(CSVParser parser)
'Empty' constructor, calls super class's base contructor and sets the parser. |
|
CSVLineParserAssociated(String line,
boolean trim,
CSVParser parser)
Alternate constructor, calls super class's main constructor and sets the parser. |
|
CSVLineParserAssociated(String line,
CSVParser parser)
Main constructor, calls super class's main constructor and sets the parser. |
Method Summary | |
void |
addLinePart(int partNum,
String part)
Inserts the specified line part at the specified index. |
void |
addLinePart(String part)
Appends the specified line part to the current list of line parts. |
CSVParser |
getParser()
Retrieves the parser associated with this line. |
void |
removeLinePart(int partNum)
Deletes the line part at the specified index. |
void |
setLine(String line)
Allows the caller to specify the 'raw' line to be parsed. |
void |
setLinePart(int partNum,
String part)
Sets the value of the given line part to the specified string. |
void |
setLineParts(Vector parts)
Sets the list of parts parsed from the line. |
void |
setParser(CSVParser parser)
Sets the parser associated with this line. |
Methods inherited from class bill.util.csv.CSVLineParser |
dumpParts, getLine, getLinePart, getLineParts, getNumberOfLineParts, getUnformattedLine, isTrimmed, main, parseLine, parseLine, setTrimmed |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CSVLineParserAssociated(CSVParser parser)
parser
- The CSVParser to associate this instance with.setLine(String)
public CSVLineParserAssociated(String line, CSVParser parser)
line
- The line to split up into its parts.parser
- The CSVParser to associate this instance with.setLine(String)
public CSVLineParserAssociated(String line, boolean trim, CSVParser parser)
line
- The line to split up into its parts.trim
- When set to true
the column value that is
parsed out is trimmed of leading and trailing spaces. This is only
relevant for quoted values, as non quoted values are always trimmed.parser
- The CSVParser to associate this instance with.setLine(String)
public CSVLineParserAssociated(CSVLineParser line, CSVParser parser)
line
- The CSV line to be copied.parser
- The CSVParser to associate this instance with.Method Detail |
public CSVParser getParser()
public void setParser(CSVParser parser)
parser
- The line's associated parser.public void setLine(String line)
setLine
in class CSVLineParser
line
- The line to split up into its parts.public void setLinePart(int partNum, String part)
setLinePart
in class CSVLineParser
partNum
- The index of the part to be set, this is a 0
(zero) based value, so 0 = first part.part
- The string value to set the line part to.public void setLineParts(Vector parts)
setLineParts
in class CSVLineParser
parts
- List of parts to be assigned.public void addLinePart(String part)
addLinePart
in class CSVLineParser
part
- The line part to add.public void addLinePart(int partNum, String part)
addLinePart
in class CSVLineParser
partNum
- The index to insert the new line part at.part
- The line part to add.public void removeLinePart(int partNum)
removeLinePart
in class CSVLineParser
partNum
- The index of the line part to remove.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |