Class AbstractIdentifiedType

java.lang.Object
org.apache.sis.feature.AbstractIdentifiedType
All Implemented Interfaces:
Serializable, Deprecable
Direct Known Subclasses:
AbstractOperation, DefaultFeatureType, FieldType

public class AbstractIdentifiedType extends Object implements Deprecable, Serializable
Identification and description information inherited by property types and feature types.
Warning: This class is expected to implement a GeoAPI IdentifiedType interface in a future version. When such interface will be available, most references to AbstractIdentifiedType in the API will be replaced by references to the IdentifiedType interface.
Since:
0.5
Version:
0.8
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final org.opengis.util.InternationalString
    Concise definition of the element.
    static final String
    Key for the "definition" property to be given to the constructor.
    (package private) final boolean
    true if this type is deprecated.
    static final String
    Key for the "deprecated" property to be given to the constructor.
    private final org.opengis.util.InternationalString
    Optional information beyond that required for concise definition of the element.
    static final String
    Key for the "description" property to be given to the constructor.
    private final org.opengis.util.InternationalString
    Natural language designator for the element.
    static final String
    Key for the "designation" property to be given to the constructor.
    private final org.opengis.util.GenericName
    The name of this type.
    static final String
    Key for the "name" property to be given to the constructor.
    private static final long
    For cross-version compatibility.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractIdentifiedType(Map<String,?> identification)
    Constructs a type from the given properties.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) org.opengis.util.GenericName
    createName(org.opengis.util.NameFactory factory, String value)
    Creates a name from the given string.
    boolean
    Compares this type with the given object for equality.
    org.opengis.util.InternationalString
    Returns a concise definition of the element.
    org.opengis.util.InternationalString
    Returns optional information beyond that required for concise definition of the element.
    org.opengis.util.InternationalString
    Returns a natural language designator for the element.
    final org.opengis.util.GenericName
    Returns the name of this type.
    org.opengis.util.InternationalString
    Returns comments on or information about this type.
    int
    Returns a hash code value for this type.
    illegalPropertyType(Map<String,?> identification, String key, Object value)
    Returns the exception to be thrown when a property is of illegal type.
    boolean
    Returns true if this type is deprecated.
    (package private) static String
    toString(org.opengis.util.GenericName name, AbstractIdentifiedType container, String argument, int index)
    Returns the string representation of the given name, making sure that the name is non-null and the string non-empty.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • serialVersionUID

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

      public static final String NAME_KEY
      Key for the "name" property to be given to the constructor. This is used for setting the value to be returned by getName().
      See Also:
    • DEFINITION_KEY

      public static final String DEFINITION_KEY
      Key for the "definition" property to be given to the constructor. This is used for setting the value to be returned by getDefinition().
      See Also:
    • DESIGNATION_KEY

      public static final String DESIGNATION_KEY
      Key for the "designation" property to be given to the constructor. This is used for setting the value to be returned by getDesignation().
      See Also:
    • DESCRIPTION_KEY

      public static final String DESCRIPTION_KEY
      Key for the "description" property to be given to the constructor. This is used for setting the value to be returned by getDescription().
      See Also:
    • DEPRECATED_KEY

      public static final String DEPRECATED_KEY
      Key for the "deprecated" property to be given to the constructor. This is used for setting the value to be returned by isDeprecated().

      If this property is set to true, then the value associated to DESCRIPTION_KEY should give the replacement (e.g. "superceded by …").

      Since:
      0.8
      See Also:
    • name

      private final org.opengis.util.GenericName name
      The name of this type.
      See Also:
    • definition

      private final org.opengis.util.InternationalString definition
      Concise definition of the element.
      See Also:
    • designation

      private final org.opengis.util.InternationalString designation
      Natural language designator for the element. This can be used as an alternative to the name in user interfaces.
      See Also:
    • description

      private final org.opengis.util.InternationalString description
      Optional information beyond that required for concise definition of the element. The description may assist in understanding the element scope and application.
      See Also:
    • deprecated

      final boolean deprecated
      true if this type is deprecated.
      See Also:
  • Constructor Details

    • AbstractIdentifiedType

      protected AbstractIdentifiedType(Map<String,?> identification) throws IllegalArgumentException
      Constructs a type from the given properties. Keys are strings from the table below. The map given in argument shall contain an entry at least for the "name". Other entries listed in the table below are optional.
      Recognized map entries
      Map key Value type Returned by
      "name" GenericName or String getName()
      "definition" InternationalString or String getDefinition()
      "designation" InternationalString or String getDesignation()
      "description" InternationalString or String getDescription()
      "deprecated" Boolean isDeprecated()
      "locale" Locale (none)

      Localization

      All localizable attributes like "definition" may have a language and country code suffix. For example, the "definition_fr" property stands for remarks in French and the "definition_fr_CA" property stands for remarks in French Canadian. They are convenience properties for building the InternationalString value.

      The "locale" property applies only in case of exception for formatting the error message, and is used only on a best effort basis. The locale is discarded after successful construction since localizations are applied by the InternationalString.toString(Locale) method.

      Parameters:
      identification - the name and other information to be given to this identified type.
      Throws:
      IllegalArgumentException - if a property has an invalid value.
  • Method Details

    • illegalPropertyType

      private static IllegalArgumentException illegalPropertyType(Map<String,?> identification, String key, Object value)
      Returns the exception to be thrown when a property is of illegal type.
    • createName

      org.opengis.util.GenericName createName(org.opengis.util.NameFactory factory, String value)
      Creates a name from the given string. This method is invoked at construction time, so it should not use any field in this AbtractIdentifiedObject instance.
    • getName

      public final org.opengis.util.GenericName getName()
      Returns the name of this type. The namespace can be either explicit (scoped name) or implicit (local name).

      For feature types, the name is mandatory and shall be unique in the unit processing the data (e.g. a DataStore reading a file).

      Note for subclasses: this method is final because it is invoked (indirectly) by subclass constructors, and invoking a user-overrideable method at construction time is not recommended. Furthermore, this attribute is often used as the primary key for IdentifiedType instances and need some guarantees about its stability.
      Returns:
      the type name.
    • getDefinition

      public org.opengis.util.InternationalString getDefinition()
      Returns a concise definition of the element.
      Returns:
      concise definition of the element.
    • getDesignation

      public org.opengis.util.InternationalString getDesignation()
      Returns a natural language designator for the element. This can be used as an alternative to the name in user interfaces.
      Returns:
      natural language designator for the element, or null if none.
    • getDescription

      public org.opengis.util.InternationalString getDescription()
      Returns optional information beyond that required for concise definition of the element. The description may assist in understanding the element scope and application.

      If this type is deprecated, then the description should give indication about the replacement (e.g. "superceded by …").

      Returns:
      information beyond that required for concise definition of the element, or null if none.
    • getRemarks

      public org.opengis.util.InternationalString getRemarks()
      Returns comments on or information about this type. The default implementation performs the following choice:
      • If this type is deprecated, returns the description. The description of deprecated types should give indication about the replacement (e.g. "superceded by …").
      • Otherwise returns null since remarks are not part of the ISO 19109 feature model.
      Specified by:
      getRemarks in interface Deprecable
      Returns:
      the remarks, or null if none.
      Since:
      0.8
    • isDeprecated

      public boolean isDeprecated()
      Returns true if this type is deprecated. If this method returns true, then the remarks should give indication about the replacement (e.g. "superceded by …").
      Specified by:
      isDeprecated in interface Deprecable
      Returns:
      whether this type is deprecated.
      Since:
      0.8
    • hashCode

      public int hashCode()
      Returns a hash code value for this type.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code for this type.
    • equals

      public boolean equals(Object obj)
      Compares this type with the given object for equality.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to compare with this type.
      Returns:
      true if the given object is equal to this type.
    • toString

      static String toString(org.opengis.util.GenericName name, AbstractIdentifiedType container, String argument, int index)
      Returns the string representation of the given name, making sure that the name is non-null and the string non-empty. This method is used for checking argument validity.
      Parameters:
      name - the name for which to get the string representation.
      container - the feature or attribute which contains the named characteristics.
      argument - the name of the argument ("properties" or "characterizedBy").
      index - index of the characteristics having the given name.
      Throws:
      IllegalArgumentException - if the given name is null or have an empty string representation.