public class ReportType extends Object
By convention, a report must be declared as a static field publicly accessible from the sender class.
| Modifier and Type | Field and Description |
|---|---|
protected String |
reportName |
| Constructor and Description |
|---|
ReportType(String errorFormat)
Construct a new report type.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getMessage(Object[] parameters)
Convert the given report to a string, using the provided parameters.
|
static String |
getReportName(Object sender,
ReportType type)
Retrieve the full canonical name of a given report type.
|
static ReportType[] |
getReports(Class<?> sender)
Retrieve all publicly associated reports.
|
static Class<?> |
getSenderClass(Object sender)
Retrieve the class of the given sender.
|
String |
toString() |
protected String reportName
public ReportType(String errorFormat)
errorFormat - - string used to format the underlying report.public String getMessage(Object[] parameters)
parameters - - parameters to insert, or NULL to insert nothing.public static Class<?> getSenderClass(Object sender)
If the sender is already a Class, we return it.
sender - - the sender to look up.public static String getReportName(Object sender, ReportType type)
Note that the sender may be a class (for static callers), in which case it will be used directly instead of its getClass() method.
It is thus not advisable for class classes to report reports.
sender - - the sender, or its class.type - - the report type.public static ReportType[] getReports(Class<?> sender)
sender - - sender class.Copyright © 2012–2017 Comphenix and dmulloy2. Licensed under the GNU GPL v2.