T
- the report typeR
- the reporterpublic abstract class AbstractReportDefinition<T extends Report<?>,R extends T> extends Object implements ReportDefinition<T>
Modifier and Type | Field and Description |
---|---|
static String |
KEY_REPORT_ERRORS
Key for error messages
|
static String |
KEY_REPORT_INFOS
Key for info messages
|
static String |
KEY_REPORT_MESSAGE_TYPE
Key for messagetype
|
static String |
KEY_REPORT_STARTTIME
Key for starttime
|
static String |
KEY_REPORT_SUCCESS
Key for success
|
static String |
KEY_REPORT_SUMMARY
Key for summary
|
static String |
KEY_REPORT_TASKNAME
Key for taskname
|
static String |
KEY_REPORT_TIME
Key for timestamp
|
static String |
KEY_REPORT_WARNINGS
Key for warning messages
|
ID_PREFIX
Constructor and Description |
---|
AbstractReportDefinition(Class<T> reportClass,
String id)
Create report definition.
|
Modifier and Type | Method and Description |
---|---|
protected Properties |
asProperties(T report)
Get a
Properties representation of the given report that can be
used to create a new report instance using
createReport(Properties) . |
String |
asString(T report)
Represent the given object as a definition string, so that it can be used
to again create an object instance using
ObjectDefinition.parse(String) . |
static void |
configureBasicReporter(Reporter<?> reporter,
Properties props)
Basic configuration that should be called from every child class!
|
protected abstract T |
configureReport(R reporter,
Properties props)
Configure the report.
|
protected abstract R |
createReport(Properties props)
Create a report from a set of properties.
|
String |
getIdentifier()
Get the factory identifier.
|
Class<T> |
getObjectClass()
Get the class of the supported object.
|
T |
parse(String value)
Parse the given definition string and create an object instance.
|
public static final String KEY_REPORT_TASKNAME
public static final String KEY_REPORT_SUCCESS
public static final String KEY_REPORT_SUMMARY
public static final String KEY_REPORT_STARTTIME
public static final String KEY_REPORT_TIME
public static final String KEY_REPORT_MESSAGE_TYPE
public static final String KEY_REPORT_INFOS
public static final String KEY_REPORT_ERRORS
public static final String KEY_REPORT_WARNINGS
public String getIdentifier()
ObjectDefinition
:
getIdentifier
in interface ObjectDefinition<T extends Report<?>>
ObjectDefinition.getIdentifier()
public Class<T> getObjectClass()
ObjectDefinition
getObjectClass
in interface ObjectDefinition<T extends Report<?>>
ObjectDefinition.getObjectClass()
public T parse(String value)
ObjectDefinition
parse
in interface ObjectDefinition<T extends Report<?>>
value
- the definition string to parsenull
ObjectDefinition.parse(java.lang.String)
protected abstract R createReport(Properties props)
props
- the propertiesprotected abstract T configureReport(R reporter, Properties props)
reporter
- report to configureprops
- properties to setpublic static void configureBasicReporter(Reporter<?> reporter, Properties props) throws Exception
reporter
- reporterprops
- propertiesException
- if parsing failspublic String asString(T report)
ObjectDefinition
ObjectDefinition.parse(String)
.asString
in interface ObjectDefinition<T extends Report<?>>
report
- the object to create a string representation forObjectDefinition.asString(java.lang.Object)
protected Properties asProperties(T report)
Properties
representation of the given report that can be
used to create a new report instance using
createReport(Properties)
.report
- the messageBuild 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a