Interface TypeName

All Superinterfaces:
Comparable<GenericName>, GenericName, LocalName

@UML(identifier="TypeName", specification=ISO_19103) public interface TypeName extends LocalName
A local name that references an object type is some schema. Can be used as the name of a record type, the name of a feature type, the name of data quality result type or the name of a field (or member) type among other usages.

Mapping to classes in the Java language

It is sometimes useful to establish a bidirectional mapping between TypeName and Java Class. For types defined by an OGC/ISO standard, the type name should be the UML identifier in the "OGC" namespace. That namespace is consistent with the data type URN standard values, also shown below for information purpose.
Mapping from Java classes to type names
Java class Scoped type name Data type URN standard values
Boolean OGC:Boolean urn:ogc:def:dataType:OGC:1.1:boolean
Integer OGC:Integer urn:ogc:def:dataType:OGC:1.1:nonNegativeInteger
Float OGC:Real
Double OGC:Real
BigDecimal OGC:Decimal
String OGC:CharacterString urn:ogc:def:dataType:OGC:1.1:string
InternationalString OGC:FreeText
Locale OGC:PT_Locale
ZonedDateTime OGC:DateTime
URI OGC:URI urn:ogc:def:dataType:OGC:1.1:anyURI
Metadata OGC:MD_Metadata
Implementation should define explicitly the mapping to Java classes by overriding the toJavaType() method. It avoids the need to assume any particular convention.
Since:
2.1
See Also:
  • Method Details

    • toString

      Returns the local name of the type as a String. The local name is the name without namespace, for example "Integer".

      Fully qualified name

      The fully qualified name may use different separator between path components depending what the name represents. For example if this TypeName is part of an URN, then it will use the ':' separator as in "[schema]:[type]". But if this TypeName is the name of a class, then the fully qualified name will use the '.' separator as in "[package].[class]".
      Specified by:
      toString in interface GenericName
      Specified by:
      toString in interface LocalName
      Overrides:
      toString in class Object
      Returns:
      the local name of the type.
    • toJavaType

      default Optional<Type> toJavaType()
      Returns the Java type represented by this name. For example, the "OGC:Integer" type name may be mapped to the Integer Java class. The mapping may be defined by the convention documented in class javadoc, but not necessarily. Implementations can use their own convention.
      Returns:
      the Java type (usually a Class) for this type name.
      Since:
      3.1
      See Also:
      Departure from OGC/ISO abstract specification:
      Departure for closer integration with the Java environment Added for allowing implementations to define their own mapping to a class in the Java programming language.