Class MetisCSVParser
java.lang.Object
io.github.tonywasher.joceanus.metis.parser.MetisCSVParser
CSV Parser.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMetisCSVParser(OceanusDataFormatter pFormatter, String[] pHeaders) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckHeaders(List<String> pFields) Check Headers.Parse a date value.parseDecimal(String pInput) Parse a decimal value.voidParse file.parseMoney(String pInput) Parse a money.Parse a rate.protected abstract voidprocessFields(List<String> pFields) Process the fields.protected abstract voidReset the fields.protected voidsetDateFormat(String pFormat) Set the Date format.protected voidsetDecimalSize(int pSize) Set the Decimal size.
-
Constructor Details
-
MetisCSVParser
Constructor.- Parameters:
pFormatter- the formatterpHeaders- the expected headers
-
-
Method Details
-
parseDate
Parse a date value.- Parameters:
pInput- the input string- Returns:
- the parsed date
- Throws:
OceanusException- on error
-
parseDecimal
Parse a decimal value.- Parameters:
pInput- the input string- Returns:
- the parsed decimal
- Throws:
OceanusException- on error
-
parseMoney
Parse a money.- Parameters:
pInput- the input string- Returns:
- the parsed money
- Throws:
OceanusException- on error
-
parseRate
Parse a rate.- Parameters:
pInput- the input string- Returns:
- the parsed rate
- Throws:
OceanusException- on error
-
setDateFormat
Set the Date format.- Parameters:
pFormat- the format
-
setDecimalSize
protected void setDecimalSize(int pSize) Set the Decimal size.- Parameters:
pSize- the size
-
parseFile
Parse file.- Parameters:
pInput- the input file- Throws:
OceanusException- on error
-
resetFields
protected abstract void resetFields()Reset the fields. -
processFields
Process the fields.- Parameters:
pFields- the fields- Throws:
OceanusException- on error
-
checkHeaders
Check Headers.- Parameters:
pFields- the fields- Throws:
OceanusException- on error
-