Class ServicesForUtility

All Implemented Interfaces:
EventListener

public final class ServicesForUtility extends MetadataServices
Implements the metadata services needed by the "sis-utility" module.
Since:
0.6
Version:
1.0
  • 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 class MetadataServices
      Returns:
      if XML unmarshalling is in progress in current thread.
    • getCodeTitle

      public String getCodeTitle(org.opengis.util.CodeList<?> code, Locale locale)
      Returns the title of the given enumeration or code list value.
      Overrides:
      getCodeTitle in class MetadataServices
      Parameters:
      code - the code for which to get the title.
      locale - desired locale for the title.
      Returns:
      the title.
      See Also:
    • getUnicodeIdentifier

      public String getUnicodeIdentifier(org.opengis.metadata.citation.Citation citation)
      Infers an identifier from the given citation, or returns null 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 class MetadataServices
      Parameters:
      citation - the citation for which to get the identifier, or null.
      Returns:
      a non-empty identifier without leading or trailing whitespaces, or null.
    • getInformation

      public String getInformation(String key, Locale locale)
      Returns information about the Apache SIS configuration. See super-class for a list of keys.
      Overrides:
      getInformation in class MetadataServices
      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

      public Format createCoordinateFormat(Locale locale, TimeZone timezone)
      Creates a format for DirectPosition instances.
      Overrides:
      createCoordinateFormat in class MetadataServices
      Parameters:
      locale - the locale for the new Format, or null for Locale.ROOT.
      timezone - the timezone, or null for UTC.
      Returns:
      a CoordinateFormat.
      Since:
      0.8
    • getDataSource

      public DataSource getDataSource() throws SQLException
      Returns the data source for the SIS-wide "SpatialMetadata" database.
      Overrides:
      getDataSource in class MetadataServices
      Returns:
      the data source for the $SIS_DATA/Databases/SpatialMetadata or equivalent database, or null if none.
      Throws:
      SQLException - if an error occurred while fetching the database source.
    • setDataSource

      public void setDataSource(Supplier<DataSource> ds)
      Specifies the data source to use if there is no JNDI environment or if no data source is binded to jdbc/SpatialMetadata.
      Overrides:
      setDataSource in class MetadataServices
      Parameters:
      ds - supplier of data source to set, or null for removing previous supplier. This supplier may return null, in which case it will be ignored.