org.geotoolkit.metadata
Enum KeyNamePolicy

Object
  extended by Enum<KeyNamePolicy>
      extended by KeyNamePolicy
All Implemented Interfaces:
Serializable, Comparable<KeyNamePolicy>

public enum KeyNamePolicy
extends Enum<KeyNamePolicy>

The name of the keys included in a Map of metadata. Those maps are created by the AbstractMetadata.asMap() method. The keys in those map are Strings which can be inferred from the UML identifier, the name of the Javabeans property, or the method name.

In GeoAPI implementation of ISO 19115, UML_IDENTIFIER and JAVA_PROPERTY are usually identical except for collections: JAVA_PROPERTY names are plural when the property is a collection while UML_IDENTIFIER usually stay singular no matter the property cardinality.

Since:
3.03
Version:
3.04
Author:
Martin Desruisseaux (Geomatys)
See Also:
MetadataStandard.asMap(Object, NullValuePolicy, KeyNamePolicy)
Module:
metadata/geotk-metadata (download)    View source code for this class

Enum Constant Summary
JAVABEANS_PROPERTY
          The keys in the map are the Javabeans property names.
METHOD_NAME
          The keys in the map are the plain method names.
SENTENCE
          The keys in the map are sentences inferred from the UML identifiers.
UML_IDENTIFIER
          The keys in the map are the UML identifier of the metadata properties.
 
Method Summary
static KeyNamePolicy valueOf(String name)
          Returns the enum constant of this type with the specified name.
static KeyNamePolicy[] 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 class Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

UML_IDENTIFIER

public static final KeyNamePolicy UML_IDENTIFIER
The keys in the map are the UML identifier of the metadata properties. If a property has no UML annotation, then the Javabeans property name is used as a fallback.


JAVABEANS_PROPERTY

public static final KeyNamePolicy JAVABEANS_PROPERTY
The keys in the map are the Javabeans property names. This is the method name with the get or is prefix removed, and the first letter made lower-case.

This is the default type of names returned by AbstractMetadata.asMap().


METHOD_NAME

public static final KeyNamePolicy METHOD_NAME
The keys in the map are the plain method names.


SENTENCE

public static final KeyNamePolicy SENTENCE
The keys in the map are sentences inferred from the UML identifiers. This policy starts with the same names than UML_IDENTIFIER, searches for word boundaries (defined as a lower case letter followed by a upper case letter) and inserts a space between the words found. The first letter in the sentence is made upper-case. The first letters of following words are made lower-case.

Since:
3.04
Method Detail

values

public static KeyNamePolicy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (KeyNamePolicy c : KeyNamePolicy.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static KeyNamePolicy 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 name
NullPointerException - if the argument is null


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.