public class Util
extends java.lang.Object
JsonExport
and XmlExport
. It groups
common utility methods and static data for JSON and XML serialization. All member of this class
are only package-accessible.Modifier and Type | Field and Description |
---|---|
(package private) static java.util.Map<java.lang.Class<? extends BaseDataType>,java.lang.String> |
defaultValuesMap
The default values for each supported ABL/FWD types.
|
(package private) static java.lang.String |
STR_ROW_CREATED
The String representation of
Buffer.ROW_CREATED records. |
(package private) static java.lang.String |
STR_ROW_DELETED
The String representation of
Buffer.ROW_DELETED records. |
(package private) static java.lang.String |
STR_ROW_MODIFIED
The String representation of
Buffer.ROW_MODIFIED records. |
(package private) static java.util.Map<java.lang.Class<? extends BaseDataType>,java.lang.String> |
xsdMap
Mapping between supported ABL/FWD types and XSD type used for writing schema.
|
(package private) static java.util.Map<java.lang.Class<? extends BaseDataType>,java.lang.String> |
xsdProdataMap
Extended information for XSD types that coalesce multiple ABL/FWD types.
|
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkExtent(int extent,
java.lang.String extentMax)
Test whether two representation of a field have same 'extent' property.
|
static boolean |
checkMandatory(boolean mandatory,
java.lang.String nullable)
Test whether two representation of a field have same 'mandatory' property.
|
(package private) static boolean |
checkSupportedType(TempTableSchema.Column column)
Checks whether a column of a TEMP-TABLE might not be supported by XML/JSON serialization.
|
(package private) static java.lang.String |
checkSupportedTypes(TempTableSchema schema)
Checks whether a TEMP-TABLE has columns whose types do not support XML serialization.
|
static boolean |
checkType(java.lang.Class<? extends BaseDataType> dataType,
java.lang.String type,
java.lang.String fieldType)
Test whether two representation of a field type are the same.
|
(package private) static java.lang.String |
encodeBase64(java.lang.Long val)
Encodes a
Long value using a BASE64 algorithm. |
(package private) static java.lang.String |
getLegacyType(java.lang.Class<? extends BaseDataType> bdtClass)
Resolve the legacy name based on the FWD BDT implementation class.
|
(package private) static java.lang.String |
getRowStateAsString(int rowState)
Get a String representation of an integer ROW-STATE flag.
|
static final java.lang.String STR_ROW_CREATED
Buffer.ROW_CREATED
records.static final java.lang.String STR_ROW_DELETED
Buffer.ROW_DELETED
records.static final java.lang.String STR_ROW_MODIFIED
Buffer.ROW_MODIFIED
records.static final java.util.Map<java.lang.Class<? extends BaseDataType>,java.lang.String> xsdMap
static final java.util.Map<java.lang.Class<? extends BaseDataType>,java.lang.String> defaultValuesMap
static final java.util.Map<java.lang.Class<? extends BaseDataType>,java.lang.String> xsdProdataMap
static java.lang.String encodeBase64(java.lang.Long val)
Long
value using a BASE64 algorithm. Used for serialization in both JSON
and XML.val
- The value to be encoded.static java.lang.String getRowStateAsString(int rowState)
rowState
- The integer value to be converted.rowState
.static java.lang.String checkSupportedTypes(TempTableSchema schema)
schema
- The schema of the TEMP-TABLE to be checked.null
if the whose TEMP-TABLE is compatible to be XML serialized or the
ABLE legacy type of the first column that is not supported.static boolean checkSupportedType(TempTableSchema.Column column)
column
- The column of the TEMP-TABLE to be checked.true
if the whose TEMP-TABLE is compatible to be XML serialized.static java.lang.String getLegacyType(java.lang.Class<? extends BaseDataType> bdtClass)
bdtClass
- The datatype to be converted.public static boolean checkType(java.lang.Class<? extends BaseDataType> dataType, java.lang.String type, java.lang.String fieldType)
dataType
- The FWD class.type
- The XML type information.fieldType
- Additional ABL XML type information.true
only if both representations are the same.public static boolean checkExtent(int extent, java.lang.String extentMax)
extent
- The ABL extent information.extentMax
- The XML extent information.true
only if both representations are the same.public static boolean checkMandatory(boolean mandatory, java.lang.String nullable)
mandatory
- The ABL mandatory information.nullable
- The XML nillable information.true
only if both representations are the same.