uCosminexus Service Platform, Basic Development Guide
In the binary format definition editor, you can use the following data types to define the formats:
For details on types of character codes to be handled in each data, see "1.3.2 Simple content element dialog" in "Service Platform Reference Guide".
The following points describe the details for each data type:
Numeric value type is divided in character string type numeric value and byte string type numeric value depending on the numeric value attribute. Numeric value attributes depending on the respective numeric value types are as follows:
Description about procedure to transform from binary type to XML type is as follows.
Description about transformation specifications from XML type to binary type is as follows.
Figure 4-3 Relation between all digits, size and embedded character (example of right justification)
Figure 4-4 Relation between all digits, size and embedded character (example of left justification)
You can omit the coding of character string type numeric value. Coding expression position is before the numeric character string. If not even one number is expressed in input data, 0 is considered. Also, you can use 0 or space in embedded character.
All numeric value attributes are treated as decimal, in the data transformation. Maximum number of digits (total of digits in integer part and fraction part) is 34.
When you perform the XML transformation for character string numeric value type, transformation to decimal type of the XML schema is performed. When you perform XML transformation for the bytes string type numeric value, transformation to decimal type of XML schema is performed in the case of zone format numeric value and pack format numeric value and transformation to integer type is performed in the case of singed binary integer and unsigned binary integer.
Respective numeric value attributes are explained as follows:
This numeric value attribute is configured by "Numeric value" and "Symbol". This numeric value attribute is internally processed in BigIntegerr class.
Integer has maximum 34 digits and does not include the fraction part.
Examples of integer are as follows:
This is general format numeric value attribute configured by "Number", "Symbol" and "Decimal point". This numeric value attribute is internally processed in BigDecimal class.
Real number has maximum 34 digits and includes fraction part. However, when input data does not have a number and has only fraction part, error occurs.
Examples of real number are as follows:
Fixed fraction numeric value is a numeric value attribute, which is configured from "Symbols" and "Numbers". For this attribute, if you specify digits in fraction part, decimal point is implicitly set. This numeric value attribute is internally processed in BigDecimal class.
Fixed fraction part numeric value has maximum 34 digits and fraction part is of maximum 33 digits.
Examples of fixed fraction part numeric value when you specify 4 digits for fraction part are as follows:
Zone format numeric value is numeric value attribute of zone format. When you specify digits of fraction part, decimal point is implicitly set. This numeric value attribute is internally processed in BigDecimal class.
Zone format numeric value has maximum 34 digits and symbol is expressed in zone part of last byte in the item.
When character code is JIS8, plus symbol is expressed by 0x3 and minus symbols is expressed by 0x7.
When character code is EBCDIK, plus symbols is expressed by 0xC and 0xF, minus symbols is expressed by 0xD.
You can change type plus or minus of the sign.
Zone part other than final byte is expressed with plus sign of each code and numeric value is expressed by last 4 bits of each byte (0x0~0x9).
Examples of zone format numeric value when character code is JIS8, are as follows:.
This is pack format numeric value attribute. If you specify digits in fraction part, the decimal point is implicitly set. This numeric value attribute is internally processed in BigDecimal class.
Pack format numeric value has maximum 34 digits and when digits count is odd number, the first 4 bits of the topmost byte have to be set to 0.
Symbols are expressed with last 4 bits of the final byte of item data. Plus symbol is expressed with 0xC or 0xF, minus symbol is expressed with 0xD and numeric value is expressed in 4 bits (0x0~0x9). You can change plus or minus of the symbol. For data transformation, 0xC is output as plus symbol.
Examples of pack format numeric value when character code is JIS8 are as follows:
This is numeric value attribute configured with signed binary integer having bytes in the range of 1~8 bytes. This numeric value attribute is internally processed in BigInteger class.
Endian depends on the format information.
Examples of singed binary integer in case of Big Endian are as follows:
This is numeric value attribute configured with unsigned binary integer having bytes in the range of 1~8 bytes.
Endian depends on the format information.
Examples of unsinged binary integer in case of Big Endian are as follows:
This section describes specifications for transforming from binary type to XML type.
Specifications to transform from XML type to binary type are explained as follows:
Byte string is the byte string saved between platforms in bit pattern. When transforming byte string to XML, it is transformed to the hexBinary type or base64Binary type of XML schema.
In hexBinary type, the 8 bit (1 byte) binary data is transformed to the hexadecimal binary characters. For example, when expressing the source data having 300 bytes, in hexBinary type, 300 bytes x 2 characters (600 characters) are required.
In base64Binary type, 6 bit (6/8 byte) binary data is transformed to 1 digit character encoded as Base64. For example, to express the source data of 300 bytes, in base64Binary type, 300 x 8/6 characters (400 characters) are required.
Bit string is a string in which bits expressed in binary are aligned. Bit string type is the data type that allows user to handle the binary data in 1 digit unit. Bit string type is processed in Big Endian.
Figure 4-5 Images of bit string and bit string type
Transformation from binary type to XML type is performed as follows:
Transformation from XML type to binary type is performed as follows:
Date and time is the type configured by combination of parts like Year, Month, Date, Hours, Minutes and Seconds. You can specify numeric value for individual part and part that expresses seconds can include a fraction part.
When transforming the date and time type from XML type to fixed length element of binary type, if the size of input XML after transformation is smaller than the size of fixed length element, you can specify whether to express by aligning the element data to either left or right side (left or right justification).
Limitations for specifying the date and time type are as follows:
Following table describes parts of date and time type.
Table 4-1 Parts of the date and time type
Parts | Meaning | Number of specification digits |
---|---|---|
CCYY | Christian year (0~9999) | 1~4 digits |
YY | Year (last 2 digits of Christian year) | Maximum 2 digits |
MM | Month (1~12) | Maximum 2 digits |
DD | Date (1~31) | Maximum 2 digits |
hh | Hour (0~23) | Maximum 2 digits |
mm | Minutes (0~59) | Maximum 2 digits |
ss | Seconds (0~59, fraction part can be included) | Maximum 2 digits in integer part and maximum 3 digits in fraction part |
You can specify 3 data types (date type, time type and date and time type), depending on the combination of parts.
Following table shows the combination of data type and part.
Table 4-2 Combination of data type and part
Data type | Combination | Meaning |
---|---|---|
Date type | CCYYMMDD | Christian year/month/date |
YYMMDD# | Last 2 digits in Christian year/month/date | |
Time type | Hhmmss | Hour/minutes/second |
Date and time type | CCYYMMDDhhmmss | Christian year/month/date/hour/minutes/second |
YYMMDDhhmmss | Last 2 digits of Christian year/month/date/hour/minutes/second |
When transforming date type, time type and date and time type to XML, the respective types are transformed as follows:
Examples of date and time type are as follows:
All Rights Reserved. Copyright (C) 2015, Hitachi, Ltd.