Class CitationConstant

java.lang.Object
org.apache.sis.internal.simple.SimpleCitation
org.apache.sis.internal.simple.CitationConstant
All Implemented Interfaces:
Serializable, org.opengis.metadata.citation.Citation
Direct Known Subclasses:
CitationConstant.Authority

public class CitationConstant extends SimpleCitation
Base class for the public static final Citation constants defined in some SIS classes. This base class contains only an abbreviation (e.g. "OGC" or "EPSG") which can be used as the primary key where to search for more information in a database. If no database is available, then that simple primary key will be used as the citation title.
Since:
0.6
Version:
1.3
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • namespace

      public final String namespace
      The name by which this citation is known to Citations.fromName(String). Often the same than the abbreviation that CitationConstant uses as the title. If this CitationConstant is a CitationConstant.Authority subtype, then this is also the authority namespace.
    • delegate

      private transient volatile org.opengis.metadata.citation.Citation delegate
      The citation which contain the "real" data, or null if not yet created. This is usually an instance created by MetadataSource. Those instances manage their own caching, so accesses to the database should not occur often.
  • Constructor Details

    • CitationConstant

      public CitationConstant(String name)
      Creates a new proxy for the given primary key. The key should be readable enough for being usable as a fallback if the database is not available.
      Parameters:
      name - a human-understandable primary key for fetching more information.
    • CitationConstant

      public CitationConstant(String name, String namespace)
      Creates a new proxy for the given primary key but a different programmatic name. The key should be readable enough for being usable as a fallback if the database is not available.
      Parameters:
      name - a human-understandable primary key for fetching more information.
      namespace - the name by which this citation is known to Citations.fromName(String).
  • Method Details

    • refresh

      public final void refresh()
      Notify this instance that the database content may have changed, or that the classpath has changed.
    • delegate

      private org.opengis.metadata.citation.Citation delegate()
      Returns the citation instance which contain the actual data. That instance is provided by the sis-metadata module, which is optional. If that module is not on the classpath, then this delegate() method will use the few information provided by the current instance.

      Note that it should be very rare to not have sis-metadata on the classpath, since that module is required by sis-referencing which is itself required by almost all other SIS modules.

    • getTitle

      public org.opengis.util.InternationalString getTitle()
      Returns the title, which is mandatory.
      Specified by:
      getTitle in interface org.opengis.metadata.citation.Citation
      Overrides:
      getTitle in class SimpleCitation
      Returns:
      the title given at construction time.
    • getAlternateTitles

      public Collection<? extends org.opengis.util.InternationalString> getAlternateTitles()
      Redirects the call to the delegate citation (the instance which actually contain the data).
      Specified by:
      getAlternateTitles in interface org.opengis.metadata.citation.Citation
      Overrides:
      getAlternateTitles in class SimpleCitation
      Returns:
      the value returned by the delegate.
    • getDates

      public Collection<? extends org.opengis.metadata.citation.CitationDate> getDates()
      Specified by:
      getDates in interface org.opengis.metadata.citation.Citation
      Overrides:
      getDates in class SimpleCitation
    • getEdition

      public org.opengis.util.InternationalString getEdition()
      Specified by:
      getEdition in interface org.opengis.metadata.citation.Citation
      Overrides:
      getEdition in class SimpleCitation
    • getEditionDate

      public Date getEditionDate()
      Specified by:
      getEditionDate in interface org.opengis.metadata.citation.Citation
      Overrides:
      getEditionDate in class SimpleCitation
    • getIdentifiers

      public Collection<? extends org.opengis.metadata.Identifier> getIdentifiers()
      Specified by:
      getIdentifiers in interface org.opengis.metadata.citation.Citation
      Overrides:
      getIdentifiers in class SimpleCitation
    • getCitedResponsibleParties

      public Collection<? extends org.opengis.metadata.citation.ResponsibleParty> getCitedResponsibleParties()
      Specified by:
      getCitedResponsibleParties in interface org.opengis.metadata.citation.Citation
      Overrides:
      getCitedResponsibleParties in class SimpleCitation
    • getPresentationForms

      public Collection<org.opengis.metadata.citation.PresentationForm> getPresentationForms()
      Specified by:
      getPresentationForms in interface org.opengis.metadata.citation.Citation
      Overrides:
      getPresentationForms in class SimpleCitation
    • getSeries

      public org.opengis.metadata.citation.Series getSeries()
      Specified by:
      getSeries in interface org.opengis.metadata.citation.Citation
      Overrides:
      getSeries in class SimpleCitation
    • getOtherCitationDetails

      public org.opengis.util.InternationalString getOtherCitationDetails()
      Specified by:
      getOtherCitationDetails in interface org.opengis.metadata.citation.Citation
      Overrides:
      getOtherCitationDetails in class SimpleCitation
    • getISBN

      public String getISBN()
      Specified by:
      getISBN in interface org.opengis.metadata.citation.Citation
      Overrides:
      getISBN in class SimpleCitation
    • getISSN

      public String getISSN()
      Specified by:
      getISSN in interface org.opengis.metadata.citation.Citation
      Overrides:
      getISSN in class SimpleCitation
    • readResolve

      protected Object readResolve() throws ObjectStreamException
      Invoked at deserialization time in order to replace the deserialized instance by the existing instance defined in the Citations class.
      Returns:
      the instance to use, as an unique instance if possible.
      Throws:
      ObjectStreamException - never thrown.