public final class Warnings extends Object implements Localized, Serializable
GeographicCRS[“WGS 84”, Datum[“World Geodetic System 1984”, Ellipsoid[“WGS84”, 6378137.0, 298.257223563, Intruder[“some text here”]]], PrimeMeridian[“Greenwich”, 0.0, Intruder[“other text here”]], AngularUnit[“degree”, 0.017453292519943295]]a call to
WKTFormat.getWarnings()
would return a Warnings
instance with the following informations:
getRootElement()
returns "WGS 84"
,getUnknownElements()
returns {"Intruder"}
, andgetUnknownElementLocations("Intruder")
returns {"Ellipsoid", "PrimeMeridian"}
.WKTFormat.getWarnings()
,
Serialized FormDefined in the sis-metadata
module
Modifier and Type | Method and Description |
---|---|
Exception |
getException(int index)
Returns the exception which was the cause of the message at the given index, or
null if none. |
Set<Exception> |
getExceptions()
Returns the non-fatal exceptions that occurred during the parsing or formatting.
|
String[] |
getExceptionSource(Exception ex)
Returns the keywords of the WKT element where the given exception occurred, or
null if unknown. |
Locale |
getLocale()
Returns the locale in which warning messages are reported by the default
toString() method. |
String |
getMessage(int index)
Returns a warning message.
|
int |
getNumMessages()
Returns the number of warning messages.
|
String |
getRootElement()
Returns the name of the root element being parsed or formatted.
|
Collection<String> |
getUnknownElementLocations(String element)
Returns the keyword of WKT elements that contains the given unknown element.
|
Set<String> |
getUnknownElements()
Returns the keywords of all unknown elements found during the WKT parsing.
|
String |
toString()
Returns a string representation of the warning messages if the default locale.
|
String |
toString(Locale locale)
Returns a string representation of the warning messages in the given locale.
|
public Locale getLocale()
toString()
method.
This is not necessarily the same locale than the one used for parsing and formatting dates and numbers
in the WKT.getLocale
in interface Localized
public String getRootElement()
IdentifiedObject
interface,
then this method returns the value of IdentifiedObject.getName().getCode()
.
Otherwise this method returns a simple class name.null
if unknown.public final int getNumMessages()
public String getMessage(int index)
index
- 0 for the first warning, 1 for the second warning, etc. until getNumMessages()
- 1.public Exception getException(int index)
null
if none.index
- the value given to getMessage(int)
.null
if none.public Set<Exception> getExceptions()
public String[] getExceptionSource(Exception ex)
null
if unknown.
If this method returns a non-null array, then source[0]
is the keyword of the WKT element where
the exception occurred and source[1]
is the keyword of the parent of source[0]
.
ex
- the exception for which to get the source.null
if unknown.public Set<String> getUnknownElements()
public Collection<String> getUnknownElementLocations(String element)
getUnknownElements()
,
then this method returns null
.
The returned collection elements are in no particular order.
element
- the keyword of the unknown element.public String toString()
getLocale()
.
This is usually the locale given to the WKTFormat
constructor.public String toString(Locale locale)
locale
- the locale to use for formatting warning messages.Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.