Class AbstractLineParser
- java.lang.Object
-
- com.xceptance.xlt.api.report.external.AbstractLineParser
-
- Direct Known Subclasses:
PlainDataTableCsvParser,SimpleCsvParser
public abstract class AbstractLineParser extends java.lang.ObjectSimple 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.DateFormatgetDateFormat()Get the date format.java.util.PropertiesgetProperties()Get the parser properties.java.util.Set<java.lang.String>getValueNames()Get markers for relevant data (e.g. column headlines).abstract ValueSetparse(java.lang.String line)Parse the resource line.protected longparseTime(java.lang.String timeString)Parse 'String' time stamp to 'long'.voidsetProperties(java.util.Properties properties)Set the parser properties.voidsetValueNames(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
ValueSetornullif 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:56or UNIX time stamp like239891696- Returns:
- time stamp of type 'long' or
-1if 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
-
-