org.apache.stanbol.entityhub.servicesapi.defaults
Enum DataTypeEnum

java.lang.Object
  extended by java.lang.Enum<DataTypeEnum>
      extended by org.apache.stanbol.entityhub.servicesapi.defaults.DataTypeEnum
All Implemented Interfaces:
Serializable, Comparable<DataTypeEnum>

public enum DataTypeEnum
extends Enum<DataTypeEnum>

Defines the data types that need to be supported by the model implementation.

Each data type defines:

The Enum.name() is not used, but typically the local name with an capital first letter is used. The URI of the data type is used by the implementation of toString().

In addition the the definition of all the data types this class also provides several utilities for getting the data type by short name, URI as well as preferred or all defined java class mappings.

Author:
Rupert Westenthaler

Enum Constant Summary
AnyUri
          currently URIs are preferable mapped to Reference, because there may be RDF URIs that are not valid URIs nor URLs.
Boolean
           
Byte
           
Date
           
DateTime
           
Decimal
           
Double
           
Duration
           
Float
           
Int
           
Integer
           
Long
           
Reference
           
Short
           
String
           
Text
           
Time
           
 
Method Summary
 Set<Class<?>> getAdditionalJavaTypes()
           
static Set<DataTypeEnum> getAllDataTypes(Class<?> javaClass)
           
static DataTypeEnum getDataType(String uri)
           
static DataTypeEnum getDataTypeByShortName(String shortName)
           
 Class<?> getJavaType()
           
 String getLocalName()
           
 NamespaceEnum getNamespace()
           
static Set<DataTypeEnum> getPrimaryDataTypes(Class<?> javaClass)
           
 QName getQName()
           
 String getShortName()
           
 String getUri()
           
 String toString()
           
static DataTypeEnum valueOf(String name)
          Returns the enum constant of this type with the specified name.
static DataTypeEnum[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

Reference

public static final DataTypeEnum Reference

Text

public static final DataTypeEnum Text

AnyUri

public static final DataTypeEnum AnyUri
currently URIs are preferable mapped to Reference, because there may be RDF URIs that are not valid URIs nor URLs.


Boolean

public static final DataTypeEnum Boolean

Byte

public static final DataTypeEnum Byte

Short

public static final DataTypeEnum Short

Integer

public static final DataTypeEnum Integer

Decimal

public static final DataTypeEnum Decimal

Int

public static final DataTypeEnum Int

Long

public static final DataTypeEnum Long

Float

public static final DataTypeEnum Float

Double

public static final DataTypeEnum Double

String

public static final DataTypeEnum String

Time

public static final DataTypeEnum Time

Date

public static final DataTypeEnum Date

DateTime

public static final DataTypeEnum DateTime

Duration

public static final DataTypeEnum Duration
Method Detail

values

public static DataTypeEnum[] 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 (DataTypeEnum c : DataTypeEnum.values())
    System.out.println(c);

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

valueOf

public static DataTypeEnum 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

getLocalName

public final String getLocalName()

getJavaType

public final Class<?> getJavaType()

getAdditionalJavaTypes

public Set<Class<?>> getAdditionalJavaTypes()

getNamespace

public final NamespaceEnum getNamespace()

getUri

public final String getUri()

getShortName

public final String getShortName()

getQName

public final QName getQName()

toString

public String toString()
Overrides:
toString in class Enum<DataTypeEnum>

getPrimaryDataTypes

public static Set<DataTypeEnum> getPrimaryDataTypes(Class<?> javaClass)

getAllDataTypes

public static Set<DataTypeEnum> getAllDataTypes(Class<?> javaClass)

getDataType

public static DataTypeEnum getDataType(String uri)

getDataTypeByShortName

public static DataTypeEnum getDataTypeByShortName(String shortName)


Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.