public class TypeUtils extends Object
Modifier and Type | Field and Description |
---|---|
static List<String> |
dateTimeFormats
Formater for the EDM DateTime type.
|
static NumberFormat |
decimalFormat
Formater for the EDM Decimal type.
|
static NumberFormat |
doubleFormat
Formater for the EDM Double type.
|
static NumberFormat |
singleFormat
Formater for the EDM Single type.
|
static NumberFormat |
timeFormat
Formater for the EDM Time type.
|
Constructor and Description |
---|
TypeUtils() |
Modifier and Type | Method and Description |
---|---|
static Object |
fromEdm(String value,
String adoNetType)
Converts the String representation of the target WCF type to its
corresponding value.
|
static String |
getFullClassName(String name)
Returns a correct full class name from the given name.
|
static Class<?> |
getJavaClass(EntityType type)
Returns the Java class that corresponds to the given type according to
the naming rules.
|
static String |
getLiteralForm(String value,
String adoNetType)
Returns the literal form of the given value.
|
static String |
getPackageName(Schema schema)
Returns the package name related to the given schema.
|
static String |
getPackageName(String name)
Returns a correct package name from the given name.
|
static String |
toEdm(Object value,
Type type)
Converts a value to the String representation of the target WCF type.
|
static String |
toEdmBinary(byte[] value)
Convert the given value to the String representation of a EDM Binary
value.
|
static String |
toEdmBoolean(boolean value)
Convert the given value to the String representation of a EDM Boolean
value.
|
static String |
toEdmByte(byte value)
Convert the given value to the String representation of a EDM Byte value.
|
static String |
toEdmDateTime(Date value)
Convert the given value to the String representation of a EDM DateTime
value.
|
static String |
toEdmDecimal(double value)
Convert the given value to the String representation of a EDM Decimal
value.
|
static String |
toEdmDouble(double value)
Convert the given value to the String representation of a EDM Double
value.
|
static String |
toEdmInt16(short value)
Convert the given value to the String representation of a EDM Int16
value.
|
static String |
toEdmInt32(int value)
Convert the given value to the String representation of a EDM Int32
value.
|
static String |
toEdmInt64(long value)
Convert the given value to the String representation of a EDM Int64
value.
|
static String |
toEdmKey(Object value,
Type type)
Converts a value to the String representation of the target WCF type when
used a key in the URIs.
|
static String |
toEdmSingle(double value)
Convert the given value to the String representation of a EDM Single
value.
|
static String |
toEdmSingle(float value)
Convert the given value to the String representation of a EDM Single
value.
|
static String |
toEdmTime(long value)
Convert the given value to the String representation of a EDM Time value.
|
static Class<?> |
toJavaClass(String edmTypeName)
Returns the corresponding Java class or scalar type.
|
static String |
toJavaTypeName(String edmTypeName)
Returns the name of the corresponding Java class or scalar type.
|
public static final List<String> dateTimeFormats
public static final NumberFormat decimalFormat
public static final NumberFormat doubleFormat
public static final NumberFormat singleFormat
public static final NumberFormat timeFormat
public static Object fromEdm(String value, String adoNetType)
value
- The value to convert.adoNetType
- The target WCF type.public static String getFullClassName(String name)
name
- The name.public static Class<?> getJavaClass(EntityType type)
type
- The entity type.public static String getLiteralForm(String value, String adoNetType)
value
- The value to convert.adoNetType
- The type of the value.public static String getPackageName(Schema schema)
schema
- The schema.public static String getPackageName(String name)
name
- The name.public static String toEdm(Object value, Type type)
value
- The value to convert.type
- The target WCF type.public static String toEdmBinary(byte[] value)
value
- The value to convert.public static String toEdmBoolean(boolean value)
value
- The value to convert.public static String toEdmByte(byte value)
value
- The value to convert.public static String toEdmDateTime(Date value)
value
- The value to convert.public static String toEdmDecimal(double value)
value
- The value to convert.public static String toEdmDouble(double value)
value
- The value to convert.public static String toEdmInt16(short value)
value
- The value to convert.public static String toEdmInt32(int value)
value
- The value to convert.public static String toEdmInt64(long value)
value
- The value to convert.public static String toEdmKey(Object value, Type type)
value
- The value to convert.type
- The target WCF type.public static String toEdmSingle(double value)
value
- The value to convert.public static String toEdmSingle(float value)
value
- The value to convert.public static String toEdmTime(long value)
value
- The value to convert.public static Class<?> toJavaClass(String edmTypeName)
edmTypeName
- The type name.Copyright © 2005–2018. All rights reserved.