Class AbstractLineParser
- java.lang.Object
-
- com.xceptance.xlt.api.report.external.AbstractLineParser
-
- Direct Known Subclasses:
PlainDataTableCsvParser
,SimpleCsvParser
public abstract class AbstractLineParser extends java.lang.Object
Simple line parser that provides common functionality to parse given lines. For reading lines a file reader is responsible that passes the lines to theparse(java.lang.String)
method.
-
-
Constructor Summary
Constructors Constructor Description AbstractLineParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.text.DateFormat
getDateFormat()
Get the date format.java.util.Properties
getProperties()
Get the parser properties.java.util.Set<java.lang.String>
getValueNames()
Get markers for relevant data (e.g. column headlines).abstract ValueSet
parse(java.lang.String line)
Parse the resource line.protected long
parseTime(java.lang.String timeString)
Parse 'String' time stamp to 'long'.void
setProperties(java.util.Properties properties)
Set the parser properties.void
setValueNames(java.util.Set<java.lang.String> valueNames)
Store markers for relevant data (e.g. column headlines or index numbers).
-
-
-
Method Detail
-
parse
public abstract ValueSet parse(java.lang.String line)
Parse the resource line.- Parameters:
line
- line to parse- Returns:
- parsed
ValueSet
ornull
if there is currently nothing to return. This might be in case the line has no value of interest.
-
parseTime
protected long parseTime(java.lang.String timeString)
Parse 'String' time stamp to 'long'.- Parameters:
timeString
- human readable time stamp like08.08.1977 12:34:56
or UNIX time stamp like239891696
- Returns:
- time stamp of type 'long' or
-1
if parsing failed
-
getDateFormat
protected java.text.DateFormat getDateFormat()
Get the date format.- Returns:
- the date format
-
setValueNames
public void setValueNames(java.util.Set<java.lang.String> valueNames)
Store markers for relevant data (e.g. column headlines or index numbers).- Parameters:
valueNames
- value names
-
getValueNames
public java.util.Set<java.lang.String> getValueNames()
Get markers for relevant data (e.g. column headlines).- Returns:
- value names of interest
-
setProperties
public void setProperties(java.util.Properties properties)
Set the parser properties.- Parameters:
properties
- the parser properties
-
getProperties
public java.util.Properties getProperties()
Get the parser properties.- Returns:
- the parser properties
-
-