Package org.apache.sis.internal.metadata
Class ServicesForUtility
java.lang.Object
org.apache.sis.internal.system.SystemListener
org.apache.sis.internal.system.OptionalDependency
org.apache.sis.internal.util.MetadataServices
org.apache.sis.internal.metadata.ServicesForUtility
- All Implemented Interfaces:
EventListener
Implements the metadata services needed by the
"sis-utility"
module.- Since:
- 0.6
- Version:
- 1.0
-
Field Summary
Fields inherited from class org.apache.sis.internal.util.MetadataServices
EMBEDDED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateCoordinateFormat
(Locale locale, TimeZone timezone) Creates a format forDirectPosition
instances.getCodeTitle
(org.opengis.util.CodeList<?> code, Locale locale) Returns the title of the given enumeration or code list value.Returns the data source for the SIS-wide "SpatialMetadata" database.getInformation
(String key, Locale locale) Returns information about the Apache SIS configuration.getUnicodeIdentifier
(org.opengis.metadata.citation.Citation citation) Infers an identifier from the given citation, or returnsnull
if no identifier has been found.boolean
true
if this thread is in the process of reading a XML document with JAXB.void
Specifies the data source to use if there is no JNDI environment or if no data source is binded tojdbc/SpatialMetadata
.Methods inherited from class org.apache.sis.internal.util.MetadataServices
classpathChanged, getInstance
Methods inherited from class org.apache.sis.internal.system.OptionalDependency
getInstance, moduleNotFound
Methods inherited from class org.apache.sis.internal.system.SystemListener
add, databaseChanged, fireClasspathChanged, remove
-
Constructor Details
-
ServicesForUtility
public ServicesForUtility()Creates a new instance. This constructor is invoked by reflection only.
-
-
Method Details
-
isUnmarshalling
public boolean isUnmarshalling()true
if this thread is in the process of reading a XML document with JAXB.- Overrides:
isUnmarshalling
in classMetadataServices
- Returns:
- if XML unmarshalling is in progress in current thread.
-
getCodeTitle
Returns the title of the given enumeration or code list value.- Overrides:
getCodeTitle
in classMetadataServices
- Parameters:
code
- the code for which to get the title.locale
- desired locale for the title.- Returns:
- the title.
- See Also:
-
getUnicodeIdentifier
Infers an identifier from the given citation, or returnsnull
if no identifier has been found. This method returns a non-null value only if the identifier is a valid Unicode identifier.- Overrides:
getUnicodeIdentifier
in classMetadataServices
- Parameters:
citation
- the citation for which to get the identifier, ornull
.- Returns:
- a non-empty identifier without leading or trailing whitespaces, or
null
.
-
getInformation
Returns information about the Apache SIS configuration. See super-class for a list of keys.- Overrides:
getInformation
in classMetadataServices
- Parameters:
key
- a key identifying the information to return.locale
- language to use if possible.- Returns:
- the information, or
null
if none. - See Also:
-
createCoordinateFormat
Creates a format forDirectPosition
instances.- Overrides:
createCoordinateFormat
in classMetadataServices
- Parameters:
locale
- the locale for the newFormat
, ornull
forLocale.ROOT
.timezone
- the timezone, ornull
for UTC.- Returns:
- a
CoordinateFormat
. - Since:
- 0.8
-
getDataSource
Returns the data source for the SIS-wide "SpatialMetadata" database.- Overrides:
getDataSource
in classMetadataServices
- Returns:
- the data source for the
$SIS_DATA/Databases/SpatialMetadata
or equivalent database, ornull
if none. - Throws:
SQLException
- if an error occurred while fetching the database source.
-
setDataSource
Specifies the data source to use if there is no JNDI environment or if no data source is binded tojdbc/SpatialMetadata
.- Overrides:
setDataSource
in classMetadataServices
- Parameters:
ds
- supplier of data source to set, ornull
for removing previous supplier. This supplier may returnnull
, in which case it will be ignored.
-