public class Diagnostic
extends java.lang.Object
INFORMATION
,
WARNING
and ERROR
. Diagnostics can also be created for specific
property values.Modifier and Type | Field and Description |
---|---|
static int |
ERROR
Indicates an error message.
|
static int |
INFORMATION
Indicates an information message.
|
static int |
WARNING
Indicates a warning message.
|
Modifier | Constructor and Description |
---|---|
protected |
Diagnostic(int severity,
java.lang.String message)
Creates a Diagnostic instance.
|
protected |
Diagnostic(int severity,
java.lang.String property,
java.lang.String message)
Creates a Diagnostic instance.
|
Modifier and Type | Method and Description |
---|---|
static Diagnostic |
error(java.lang.String localizedMessage)
Creates and returns a new error diagnostic.
|
java.lang.String |
getDetail()
Returns the message.
|
java.lang.String |
getProperty()
Returns the name of the property if this is a property diagnostic or
null
otherwise. |
int |
getSeverity()
Returns the severity.
|
static Diagnostic |
information(java.lang.String localizedMessage)
Creates and returns a new information diagnostic.
|
boolean |
isPropertyDiagnostic()
Returns
true if this diagnostic refers to a specific property. |
static Diagnostic |
propertyError(java.lang.String property,
java.lang.String localizedMessage)
Creates and returns a new property error diagnostic.
|
static Diagnostic |
propertyInformation(java.lang.String property,
java.lang.String localizedMessage)
Creates and returns a new property information diagnostic.
|
static Diagnostic |
propertyWarning(java.lang.String property,
java.lang.String localizedMessage)
Creates and returns a new property warning diagnostic.
|
static Diagnostic |
warning(java.lang.String localizedMessage)
Creates and returns a new warning diagnostic.
|
public static final int INFORMATION
public static final int WARNING
public static final int ERROR
protected Diagnostic(int severity, java.lang.String message)
severity
- the message severity which must be one of the constants INFORMATION
,
WARNING
or ERROR
.message
- the localized messageprotected Diagnostic(int severity, java.lang.String property, java.lang.String message)
severity
- the message severity which must be one of the constants INFORMATION
,
WARNING
or ERROR
.property
- the property namemessage
- the localized messagepublic static Diagnostic information(java.lang.String localizedMessage)
localizedMessage
- the information messagewarning(String)
,
error(String)
public static Diagnostic warning(java.lang.String localizedMessage)
localizedMessage
- the warning messageinformation(String)
,
error(String)
public static Diagnostic error(java.lang.String localizedMessage)
localizedMessage
- the error messageinformation(String)
,
warning(String)
public static Diagnostic propertyInformation(java.lang.String property, java.lang.String localizedMessage)
property
- the property namelocalizedMessage
- the information messagepropertyWarning(String, String)
,
propertyError(String, String)
public static Diagnostic propertyWarning(java.lang.String property, java.lang.String localizedMessage)
property
- the property namelocalizedMessage
- the warning messagepropertyInformation(String, String)
,
propertyError(String, String)
public static Diagnostic propertyError(java.lang.String property, java.lang.String localizedMessage)
property
- the property namelocalizedMessage
- the error messagepropertyInformation(String, String)
,
propertyWarning(String, String)
public int getSeverity()
INFORMATION
,
WARNING
or ERROR
.INFORMATION
,
WARNING
,
ERROR
public java.lang.String getDetail()
public boolean isPropertyDiagnostic()
true
if this diagnostic refers to a specific property.true
if this diagnostic refers to a specific propertygetProperty()
public java.lang.String getProperty()
null
otherwise.null
isPropertyDiagnostic()
Copyright © 2014 Integral Solutions Ltd. All Rights Reserved.