Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.common.core.report.impl
Class AbstractReportDefinition<T extends Report<?>,R extends T>

java.lang.Object
  extended by eu.esdihumboldt.hale.common.core.report.impl.AbstractReportDefinition<T,R>
Type Parameters:
T - the report type
R - the reporter
All Implemented Interfaces:
ReportDefinition<T>, ObjectDefinition<T>
Direct Known Subclasses:
InstanceValidationReportDefinition, IOReportImplDefinition, ReportImplDefintion, TransformationReportImplDefinition

public abstract class AbstractReportDefinition<T extends Report<?>,R extends T>
extends Object
implements ReportDefinition<T>

Abstract report definition.

Author:
Andreas Burchert
Partner:
01 / Fraunhofer Institute for Computer Graphics Research

Field Summary
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
 
Fields inherited from interface eu.esdihumboldt.hale.common.core.report.ReportDefinition
ID_PREFIX
 
Constructor Summary
AbstractReportDefinition(Class<T> reportClass, String id)
          Create report definition.
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_REPORT_TASKNAME

public static final String KEY_REPORT_TASKNAME
Key for taskname

See Also:
Constant Field Values

KEY_REPORT_SUCCESS

public static final String KEY_REPORT_SUCCESS
Key for success

See Also:
Constant Field Values

KEY_REPORT_SUMMARY

public static final String KEY_REPORT_SUMMARY
Key for summary

See Also:
Constant Field Values

KEY_REPORT_STARTTIME

public static final String KEY_REPORT_STARTTIME
Key for starttime

See Also:
Constant Field Values

KEY_REPORT_TIME

public static final String KEY_REPORT_TIME
Key for timestamp

See Also:
Constant Field Values

KEY_REPORT_MESSAGE_TYPE

public static final String KEY_REPORT_MESSAGE_TYPE
Key for messagetype

See Also:
Constant Field Values

KEY_REPORT_INFOS

public static final String KEY_REPORT_INFOS
Key for info messages

See Also:
Constant Field Values

KEY_REPORT_ERRORS

public static final String KEY_REPORT_ERRORS
Key for error messages

See Also:
Constant Field Values

KEY_REPORT_WARNINGS

public static final String KEY_REPORT_WARNINGS
Key for warning messages

See Also:
Constant Field Values
Constructor Detail

AbstractReportDefinition

public AbstractReportDefinition(Class<T> reportClass,
                                String id)
Create report definition.

Parameters:
reportClass - the report class
id - the identifier for the definition (without prefix)
Method Detail

getIdentifier

public String getIdentifier()
Description copied from interface: ObjectDefinition
Get the factory identifier. The identifier must be unique for object factories that have compatible supported types. It is used to associate a definition string to the factory. The identifier may not contain a :

Specified by:
getIdentifier in interface ObjectDefinition<T extends Report<?>>
Returns:
the factory identifier
See Also:
ObjectDefinition.getIdentifier()

getObjectClass

public Class<T> getObjectClass()
Description copied from interface: ObjectDefinition
Get the class of the supported object.

Specified by:
getObjectClass in interface ObjectDefinition<T extends Report<?>>
Returns:
the object class supported by this factory
See Also:
ObjectDefinition.getObjectClass()

parse

public T parse(String value)
Description copied from interface: ObjectDefinition
Parse the given definition string and create an object instance.

Specified by:
parse in interface ObjectDefinition<T extends Report<?>>
Parameters:
value - the definition string to parse
Returns:
the CRS definition instance or null
See Also:
ObjectDefinition.parse(java.lang.String)

createReport

protected abstract R createReport(Properties props)
Create a report from a set of properties.

Parameters:
props - the properties
Returns:
the report

configureReport

protected abstract T configureReport(R reporter,
                                     Properties props)
Configure the report.

Parameters:
reporter - report to configure
props - properties to set
Returns:
the report

configureBasicReporter

public static void configureBasicReporter(Reporter<?> reporter,
                                          Properties props)
                                   throws Exception
Basic configuration that should be called from every child class!

Parameters:
reporter - reporter
props - properties
Throws:
Exception - if parsing fails

asString

public String asString(T report)
Description copied from interface: ObjectDefinition
Represent the given object as a definition string, so that it can be used to again create an object instance using ObjectDefinition.parse(String).

Specified by:
asString in interface ObjectDefinition<T extends Report<?>>
Parameters:
report - the object to create a string representation for
Returns:
the string representation of the object
See Also:
ObjectDefinition.asString(java.lang.Object)

asProperties

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).

Parameters:
report - the message
Returns:
the properties representing the report

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d