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 forDirectPositioninstances.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 returnsnullif no identifier has been found.booleantrueif this thread is in the process of reading a XML document with JAXB.voidSpecifies 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, getInstanceMethods inherited from class org.apache.sis.internal.system.OptionalDependency
getInstance, moduleNotFoundMethods 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()trueif this thread is in the process of reading a XML document with JAXB.- Overrides:
isUnmarshallingin classMetadataServices- Returns:
- if XML unmarshalling is in progress in current thread.
-
getCodeTitle
Returns the title of the given enumeration or code list value.- Overrides:
getCodeTitlein 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 returnsnullif no identifier has been found. This method returns a non-null value only if the identifier is a valid Unicode identifier.- Overrides:
getUnicodeIdentifierin 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:
getInformationin classMetadataServices- Parameters:
key- a key identifying the information to return.locale- language to use if possible.- Returns:
- the information, or
nullif none. - See Also:
-
createCoordinateFormat
Creates a format forDirectPositioninstances.- Overrides:
createCoordinateFormatin classMetadataServices- Parameters:
locale- the locale for the newFormat, ornullforLocale.ROOT.timezone- the timezone, ornullfor UTC.- Returns:
- a
CoordinateFormat. - Since:
- 0.8
-
getDataSource
Returns the data source for the SIS-wide "SpatialMetadata" database.- Overrides:
getDataSourcein classMetadataServices- Returns:
- the data source for the
$SIS_DATA/Databases/SpatialMetadataor equivalent database, ornullif 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:
setDataSourcein classMetadataServices- Parameters:
ds- supplier of data source to set, ornullfor removing previous supplier. This supplier may returnnull, in which case it will be ignored.
-