Package org.opengis.annotation
Enum Obligation
- Object
-
- Enum<Obligation>
-
- Obligation
-
- All Implemented Interfaces:
Serializable
,Comparable<Obligation>
,ControlledVocabulary
@UML(identifier="MD_ObligationCode", specification=ISO_19115) public enum Obligation extends Enum<Obligation> implements ControlledVocabulary
Whether an element is mandatory, optional or have other obligation.- Since:
- 2.0
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CONDITIONAL
Element is required when a specific condition is met.FORBIDDEN
The element should always benull
.MANDATORY
Element is always required.OPTIONAL
Element is not required.
-
Method Summary
Modifier and Type Method Description Obligation[]
family()
Returns all constants defined by this enumeration type.String
identifier()
Returns the UML identifier for this enumeration constant, ornull
if none.String[]
names()
Returns the programmatic name of this constant together with its identifier, if any.static Obligation
valueOf(String name)
Returns the enum constant of this type with the specified name.static Obligation[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface ControlledVocabulary
name, ordinal
-
-
-
-
Enum Constant Detail
-
MANDATORY
@UML(identifier="mandatory", specification=ISO_19115) public static final Obligation MANDATORY
Element is always required.
-
OPTIONAL
@UML(identifier="optional", specification=ISO_19115) public static final Obligation OPTIONAL
Element is not required.
-
CONDITIONAL
@UML(identifier="conditional", specification=ISO_19115) public static final Obligation CONDITIONAL
Element is required when a specific condition is met.
-
FORBIDDEN
public static final Obligation FORBIDDEN
The element should always benull
. This obligation code is used only when a sub-interface overrides an association and force it to anull
value. An example isTemporalDatum.getAnchorPoint()
.Departure from OGC/ISO specification:
ISO specifications sometime override a parent method with a comment saying that the method is not allowed for a particular class. Since there is no construct in Java for expressing this constraint in the method signature, GeoAPI defines aFORBIDDEN
obligation (not in original ISO specifications) to be used with the@UML
annotation and which adds a flag in the Java documentation.
-
-
Method Detail
-
values
public static Obligation[] values()
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Obligation valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
identifier
public String identifier()
Returns the UML identifier for this enumeration constant, ornull
if none.- Specified by:
identifier
in interfaceControlledVocabulary
- Returns:
- the ISO/OGC identifier for this constant, or
null
if none. - Since:
- 3.1
-
names
public String[] names()
Returns the programmatic name of this constant together with its identifier, if any.- Specified by:
names
in interfaceControlledVocabulary
- Returns:
- all names of this constant. This array is never null and never empty.
- Since:
- 3.1
-
family
public Obligation[] family()
Returns all constants defined by this enumeration type. Invoking this method is equivalent to invokingvalues()
, except that this method can be invoked on an instance of theControlledVocabulary
interface (i.e. the enumeration type does not need to be known at compile-time).- Specified by:
family
in interfaceControlledVocabulary
- Returns:
- all values for this enumeration.
- Since:
- 3.1
-
-