Package org.apache.sis.feature
Class AbstractIdentifiedType
java.lang.Object
org.apache.sis.feature.AbstractIdentifiedType
- All Implemented Interfaces:
Serializable
,Deprecable
- Direct Known Subclasses:
AbstractOperation
,DefaultFeatureType
,FieldType
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
FieldsModifier and TypeFieldDescriptionprivate 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
ConstructorsModifierConstructorDescriptionprotected
AbstractIdentifiedType
(Map<String, ?> identification) Constructs a type from the given properties. -
Method Summary
Modifier and TypeMethodDescription(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
getName()
Returns the name of this type.org.opengis.util.InternationalString
Returns comments on or information about this type.int
hashCode()
Returns a hash code value for this type.private static IllegalArgumentException
illegalPropertyType
(Map<String, ?> identification, String key, Object value) Returns the exception to be thrown when a property is of illegal type.boolean
Returnstrue
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.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
NAME_KEY
Key for the"name"
property to be given to the constructor. This is used for setting the value to be returned bygetName()
.- See Also:
-
DEFINITION_KEY
Key for the"definition"
property to be given to the constructor. This is used for setting the value to be returned bygetDefinition()
.- See Also:
-
DESIGNATION_KEY
Key for the"designation"
property to be given to the constructor. This is used for setting the value to be returned bygetDesignation()
.- See Also:
-
DESCRIPTION_KEY
Key for the"description"
property to be given to the constructor. This is used for setting the value to be returned bygetDescription()
.- See Also:
-
DEPRECATED_KEY
Key for the"deprecated"
property to be given to the constructor. This is used for setting the value to be returned byisDeprecated()
.If this property is set to
true
, then the value associated toDESCRIPTION_KEY
should give the replacement (e.g. "superceded by …").- Since:
- 0.8
- See Also:
-
name
private final org.opengis.util.GenericName nameThe name of this type.- See Also:
-
definition
private final org.opengis.util.InternationalString definitionConcise definition of the element.- See Also:
-
designation
private final org.opengis.util.InternationalString designationNatural 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 descriptionOptional 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 deprecatedtrue
if this type is deprecated.- See Also:
-
-
Constructor Details
-
AbstractIdentifiedType
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
orString
getName()
"definition" InternationalString
orString
getDefinition()
"designation" InternationalString
orString
getDesignation()
"description" InternationalString
orString
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 theInternationalString
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 theInternationalString.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
Creates a name from the given string. This method is invoked at construction time, so it should not use any field in thisAbtractIdentifiedObject
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 forIdentifiedType
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 interfaceDeprecable
- Returns:
- the remarks, or
null
if none. - Since:
- 0.8
-
isDeprecated
public boolean isDeprecated()Returnstrue
if this type is deprecated. If this method returnstrue
, then the remarks should give indication about the replacement (e.g. "superceded by …").- Specified by:
isDeprecated
in interfaceDeprecable
- Returns:
- whether this type is deprecated.
- Since:
- 0.8
-
hashCode
public int hashCode()Returns a hash code value for this type. -
equals
Compares this type with the given object for equality. -
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.
-