public class DataType
extends java.lang.Object
Represents a data type defined by XML Schema Part 2: Datatypes or OData. String, binary, boolean, numeric and calendar types use XML Schema nomenclature. Geography, geometry, complex and entity types use OData nomenclature.
Modifier and Type | Field and Description |
---|---|
static int |
ANNOTATION_PATH
Constant type code for an OData CSDL
AnnotationPath . |
static int |
BINARY
Constant type code for the
binary data type. |
static int |
BOOLEAN
Constant type code for the
boolean data type. |
static int |
BYTE
Constant type code for the
byte data type. |
static int |
BYTE_STREAM
Constant type code for the
ByteStream data type. |
static int |
CHAR
Constant type code for the
char data type. |
static int |
CHAR_STREAM
Constant type code for the
CharStream data type. |
static int |
CODE_UNKNOWN
For internal use only.
|
static int |
COMPLEX_VALUE
Constant type code for the
ComplexValue data type. |
static int |
COMPLEX_VALUE_LIST
Constant type code for the
ComplexValueList data type. |
static int |
DATA_VALUE_LIST
Constant type code for the
DataValueList data type. |
static int |
DAY_TIME_DURATION
Constant type code for the
DayTimeDuration data type. |
static int |
DECIMAL
Constant type code for the
decimal data type. |
static int |
DELTA_STREAM
Constant type code for the
DeltaStream data type. |
static int |
DOUBLE
Constant type code for the
double data type. |
static int |
DYNAMIC_PATH
Constant type code for a dynamic (structural or navigation) path.
|
static int |
EDM_PRIMITIVE
Constant type code for the "Edm.PrimitiveType" abstract data type.
|
static int |
ENTITY_VALUE
Constant type code for the
EntityValue data type. |
static int |
ENTITY_VALUE_LIST
Constant type code for the
EntityValueList data type. |
static int |
ENUM_VALUE
Constant type code for an enum type.
|
static int |
FLOAT
Constant type code for the
float data type. |
static int |
GEOGRAPHY_COLLECTION
Constant type code for the
GeographyCollection data type. |
static int |
GEOGRAPHY_LINE_STRING
Constant type code for the
GeographyLineString data type. |
static int |
GEOGRAPHY_MULTI_LINE_STRING
Constant type code for the
GeographyMultiLineString data type. |
static int |
GEOGRAPHY_MULTI_POINT
Constant type code for the
GeographyMultiPoint data type. |
static int |
GEOGRAPHY_MULTI_POLYGON
Constant type code for the
GeographyMultiPolygon data type. |
static int |
GEOGRAPHY_POINT
Constant type code for the
GeographyPoint data type. |
static int |
GEOGRAPHY_POLYGON
Constant type code for the
GeographyPolygon data type. |
static int |
GEOGRAPHY_VALUE
Constant type code for the
GeographyValue data type. |
static int |
GEOMETRY_COLLECTION
Constant type code for the
GeometryCollection data type. |
static int |
GEOMETRY_LINE_STRING
Constant type code for the
GeometryLineString data type. |
static int |
GEOMETRY_MULTI_LINE_STRING
Constant type code for the
GeometryMultiLineString data type. |
static int |
GEOMETRY_MULTI_POINT
Constant type code for the
GeometryMultiPoint data type. |
static int |
GEOMETRY_MULTI_POLYGON
Constant type code for the
GeometryMultiPolygon data type. |
static int |
GEOMETRY_POINT
Constant type code for the
GeometryPoint data type. |
static int |
GEOMETRY_POLYGON
Constant type code for the
GeometryPolygon data type. |
static int |
GEOMETRY_VALUE
Constant type code for the
GeometryValue data type. |
static int |
GLOBAL_DATE_TIME
Constant type code for the
GlobalDateTime data type. |
static int |
GUID_VALUE
Constant type code for the
GuidValue data type. |
static int |
INT
Constant type code for the
int data type. |
static int |
INTEGER
Constant type code for the
integer data type. |
static int |
LIST
Constant type code for the
ListBase data type. |
static int |
LOCAL_DATE
Constant type code for the
LocalDate data type. |
static int |
LOCAL_DATE_TIME
Constant type code for the
LocalDateTime data type. |
static int |
LOCAL_TIME
Constant type code for the
LocalTime data type. |
static int |
LONG
Constant type code for the
long data type. |
static int |
NAVIGATION_PATH
Constant type code for an OData CSDL
NavigationPropertyPath . |
static int |
OBJECT
Constant type code for the
object data type. |
static int |
PATH
Constant type code for
DataPath . |
static int |
PATH_EXPRESSION
Constant type code for an OData CSDL
Path expression. |
static int |
PROPERTY_PATH
Constant type code for an OData CSDL
AnyPropertyPath . |
static int |
QUERY_ALIAS
Constant type code for
QueryAlias . |
static int |
QUERY_FILTER
Constant type code for
QueryFilter . |
static int |
QUERY_FUNCTION_CALL
Constant type code for
QueryFunctionCall . |
static int |
QUERY_OPERATOR_CALL
Constant type code for
QueryOperatorCall . |
static int |
SHORT
Constant type code for the
short data type. |
static int |
STREAM_LINK
Constant type code for the
StreamLink data type. |
static int |
STRING
Constant type code for the
string data type. |
static int |
STRUCTURAL_PATH
Constant type code for an OData CSDL
PropertyPath . |
static int |
TARGET_PATH
Constant type code for an OData CSDL
TargetPath . |
static DataType |
unknown |
static int |
UNSIGNED_BYTE
Constant type code for the
unsignedByte data type. |
static int |
UNSIGNED_INT
Constant type code for the
unsignedInt data type. |
static int |
UNSIGNED_LONG
Constant type code for the
unsignedLong data type. |
static int |
UNSIGNED_SHORT
Constant type code for the
unsignedShort data type. |
static int |
YEAR_MONTH_DURATION
Constant type code for the
YearMonthDuration data type. |
Constructor and Description |
---|
DataType() |
Modifier and Type | Method and Description |
---|---|
static DataType |
forCode(int code)
Return the data type for a basic type code.
|
static DataType |
forName(java.lang.String name)
Return the data type for a basic type name.
|
DataType |
getBaseType()
Return if this type is a derived simple, complex, entity or enum type, then the base type.
|
int |
getCode()
Return a numeric code to represent this data type.
|
DataType |
getItemType()
Return if this type is a list type, then the item type.
|
java.lang.String |
getName()
Return the name of this data type.
|
boolean |
isBasic()
Return
true if this type is a basic type (not a complex, entity, list or stream type). |
boolean |
isBasicList()
Return
true if this type is a basic list type. |
boolean |
isCalendar()
Return
true if this type is a calendar type. |
boolean |
isComplex()
Return
true if this is a complex type. |
boolean |
isComplexList()
Return
true if this is a complex list type. |
boolean |
isDerived()
Return
true if this type is a derived simple, complex, entity or enum type. |
boolean |
isEntity()
Return
true if this is an entity type. |
boolean |
isEntityList()
Return
true if this is an entity list type. |
boolean |
isEnum()
Return
true if this type is an enum type. |
boolean |
isEnumList()
Return
true if this is an enum list type. |
boolean |
isGeography()
Return
true if this type is a geography type. |
boolean |
isGeometry()
Return
true if this type is a geometry type. |
boolean |
isGeospatial()
Return
true if this type is a geospatial (geography/geometry) type. |
boolean |
isGuid()
Return
true if this type is a GUID type. |
boolean |
isList()
Return
true if this is a list type. |
boolean |
isNumber()
Return
true if this type is a number type. |
boolean |
isPath()
Return
true if this type is a path type. |
boolean |
isStream()
Return
true if this is a stream type. |
boolean |
isUnsigned()
Return
true if this type is an unsigned type. |
static DataType |
listOf(DataType item)
Return the data type for a list of the specified item type.
|
java.lang.String |
toString()
Return the name of this data type.
|
public static final int CODE_UNKNOWN
For internal use only.
public static final int STRING
Constant type code for the string
data type.
public static final int BINARY
Constant type code for the binary
data type.
public static final int BOOLEAN
Constant type code for the boolean
data type.
public static final int CHAR
Constant type code for the char
data type.
public static final int BYTE
Constant type code for the byte
data type.
public static final int SHORT
Constant type code for the short
data type.
public static final int INT
Constant type code for the int
data type.
public static final int LONG
Constant type code for the long
data type.
public static final int INTEGER
Constant type code for the integer
data type.
public static final int DECIMAL
Constant type code for the decimal
data type.
public static final int FLOAT
Constant type code for the float
data type.
public static final int DOUBLE
Constant type code for the double
data type.
public static final int UNSIGNED_BYTE
Constant type code for the unsignedByte
data type.
public static final int UNSIGNED_SHORT
Constant type code for the unsignedShort
data type.
public static final int UNSIGNED_INT
Constant type code for the unsignedInt
data type.
public static final int UNSIGNED_LONG
Constant type code for the unsignedLong
data type.
public static final int ENUM_VALUE
Constant type code for an enum type.
public static final int GUID_VALUE
Constant type code for the GuidValue
data type.
public static final int BYTE_STREAM
Constant type code for the ByteStream
data type.
public static final int CHAR_STREAM
Constant type code for the CharStream
data type.
public static final int STREAM_LINK
Constant type code for the StreamLink
data type.
public static final int LOCAL_DATE
Constant type code for the LocalDate
data type.
public static final int LOCAL_TIME
Constant type code for the LocalTime
data type.
public static final int LOCAL_DATE_TIME
Constant type code for the LocalDateTime
data type.
public static final int GLOBAL_DATE_TIME
Constant type code for the GlobalDateTime
data type.
public static final int DAY_TIME_DURATION
Constant type code for the DayTimeDuration
data type.
public static final int YEAR_MONTH_DURATION
Constant type code for the YearMonthDuration
data type.
public static final int GEOGRAPHY_VALUE
Constant type code for the GeographyValue
data type.
public static final int GEOGRAPHY_POINT
Constant type code for the GeographyPoint
data type.
public static final int GEOGRAPHY_MULTI_POINT
Constant type code for the GeographyMultiPoint
data type.
public static final int GEOGRAPHY_LINE_STRING
Constant type code for the GeographyLineString
data type.
public static final int GEOGRAPHY_MULTI_LINE_STRING
Constant type code for the GeographyMultiLineString
data type.
public static final int GEOGRAPHY_POLYGON
Constant type code for the GeographyPolygon
data type.
public static final int GEOGRAPHY_MULTI_POLYGON
Constant type code for the GeographyMultiPolygon
data type.
public static final int GEOGRAPHY_COLLECTION
Constant type code for the GeographyCollection
data type.
public static final int GEOMETRY_VALUE
Constant type code for the GeometryValue
data type.
public static final int GEOMETRY_POINT
Constant type code for the GeometryPoint
data type.
public static final int GEOMETRY_MULTI_POINT
Constant type code for the GeometryMultiPoint
data type.
public static final int GEOMETRY_LINE_STRING
Constant type code for the GeometryLineString
data type.
public static final int GEOMETRY_MULTI_LINE_STRING
Constant type code for the GeometryMultiLineString
data type.
public static final int GEOMETRY_POLYGON
Constant type code for the GeometryPolygon
data type.
public static final int GEOMETRY_MULTI_POLYGON
Constant type code for the GeometryMultiPolygon
data type.
public static final int GEOMETRY_COLLECTION
Constant type code for the GeometryCollection
data type.
public static final int EDM_PRIMITIVE
Constant type code for the "Edm.PrimitiveType" abstract data type.
public static final int OBJECT
Constant type code for the object
data type.
public static final int COMPLEX_VALUE
Constant type code for the ComplexValue
data type.
public static final int ENTITY_VALUE
Constant type code for the EntityValue
data type.
public static final int LIST
Constant type code for the ListBase
data type.
public static final int DATA_VALUE_LIST
Constant type code for the DataValueList
data type.
public static final int COMPLEX_VALUE_LIST
Constant type code for the ComplexValueList
data type.
public static final int ENTITY_VALUE_LIST
Constant type code for the EntityValueList
data type.
public static final int DELTA_STREAM
Constant type code for the DeltaStream
data type.
public static final int PATH
Constant type code for DataPath
.
public static final int PATH_EXPRESSION
Constant type code for an OData CSDL Path
expression.
public static final int ANNOTATION_PATH
Constant type code for an OData CSDL AnnotationPath
.
public static final int STRUCTURAL_PATH
Constant type code for an OData CSDL PropertyPath
.
public static final int NAVIGATION_PATH
Constant type code for an OData CSDL NavigationPropertyPath
.
public static final int PROPERTY_PATH
Constant type code for an OData CSDL AnyPropertyPath
.
public static final int TARGET_PATH
Constant type code for an OData CSDL TargetPath
.
public static final int DYNAMIC_PATH
Constant type code for a dynamic (structural or navigation) path.
public static final int QUERY_ALIAS
Constant type code for QueryAlias
.
public static final int QUERY_FILTER
Constant type code for QueryFilter
.
public static final int QUERY_FUNCTION_CALL
Constant type code for QueryFunctionCall
.
public static final int QUERY_OPERATOR_CALL
Constant type code for QueryOperatorCall
.
public static final DataType unknown
public static DataType forCode(int code)
Return the data type for a basic type code.
UndefinedException
if there is no basic type with the specified code.
constants.
code
- Data type code.public static DataType forName(java.lang.String name)
Return the data type for a basic type name.
UndefinedException
if there is no basic type with the specified name.
name
- Data type name.public DataType getBaseType()
Return if this type is a derived simple, complex, entity or enum type, then the base type. Otherwise throw an exception.
public int getCode()
Return a numeric code to represent this data type.
constants.
public DataType getItemType()
Return if this type is a list type, then the item type. Otherwise throw an exception.
public java.lang.String getName()
Return the name of this data type.
public boolean isBasic()
Return true
if this type is a basic type (not a complex, entity, list or stream type).
true
if this type is a basic type (not a complex, entity, list or stream type).public boolean isBasicList()
Return true
if this type is a basic list type.
true
if this type is a basic list type.public boolean isCalendar()
Return true
if this type is a calendar type.
Calendar types are also basic types.
public boolean isComplex()
Return true
if this is a complex type.
public boolean isComplexList()
Return true
if this is a complex list type.
true
if this is a complex list type.public boolean isDerived()
Return true
if this type is a derived simple, complex, entity or enum type.
true
if this type is a derived simple, complex, entity or enum type.public boolean isEntity()
Return true
if this is an entity type.
public boolean isEntityList()
Return true
if this is an entity list type.
true
if this is an entity list type.public boolean isEnum()
Return true
if this type is an enum type.
true
if this type is an enum type.public boolean isEnumList()
Return true
if this is an enum list type.
true
if this is an enum list type.public boolean isGeography()
Return true
if this type is a geography type.
Geography types are also basic types.
public boolean isGeometry()
Return true
if this type is a geometry type.
Geometry types are also basic types.
public boolean isGeospatial()
Return true
if this type is a geospatial (geography/geometry) type.
Geospatial types are also basic types.
DataType.isBasic
, DataType.isGeography
, DataType.isGeometry
.
public boolean isGuid()
Return true
if this type is a GUID type.
true
if this type is a GUID type.public boolean isList()
Return true
if this is a list type.
public boolean isNumber()
Return true
if this type is a number type.
true
if this type is a number type.public boolean isPath()
Return true
if this type is a path type.
true
if this type is a path type.public boolean isStream()
Return true
if this is a stream type.
public boolean isUnsigned()
Return true
if this type is an unsigned type.
true
if this type is an unsigned type.public static DataType listOf(DataType item)
Return the data type for a list of the specified item type.
item
- The item type.public java.lang.String toString()
Return the name of this data type.
toString
in class java.lang.Object