Interface ZCLSimpleTypeDescription
- All Superinterfaces:
ZCLDataTypeDescription
- All Known Implementing Classes:
ZigBeeAttributeID
,ZigBeeBACnet
,ZigBeeBitmap16
,ZigBeeBitmap24
,ZigBeeBitmap32
,ZigBeeBitmap40
,ZigBeeBitmap48
,ZigBeeBitmap56
,ZigBeeBitmap64
,ZigBeeBitmap8
,ZigBeeBoolean
,ZigBeeCharacterString
,ZigBeeClusterID
,ZigBeeDate
,ZigBeeEnumeration16
,ZigBeeEnumeration8
,ZigBeeFloatingDouble
,ZigBeeFloatingSemi
,ZigBeeFloatingSingle
,ZigBeeGeneralData16
,ZigBeeGeneralData24
,ZigBeeGeneralData32
,ZigBeeGeneralData40
,ZigBeeGeneralData48
,ZigBeeGeneralData56
,ZigBeeGeneralData64
,ZigBeeGeneralData8
,ZigBeeIEEE_ADDRESS
,ZigBeeLongCharacterString
,ZigBeeLongOctetString
,ZigBeeOctetString
,ZigBeeSecurityKey128
,ZigBeeSignedInteger16
,ZigBeeSignedInteger24
,ZigBeeSignedInteger32
,ZigBeeSignedInteger40
,ZigBeeSignedInteger48
,ZigBeeSignedInteger56
,ZigBeeSignedInteger64
,ZigBeeSignedInteger8
,ZigBeeTimeOfDay
,ZigBeeUnsignedInteger16
,ZigBeeUnsignedInteger24
,ZigBeeUnsignedInteger32
,ZigBeeUnsignedInteger40
,ZigBeeUnsignedInteger48
,ZigBeeUnsignedInteger56
,ZigBeeUnsignedInteger64
,ZigBeeUnsignedInteger8
,ZigBeeUTCTime
This interface is used for representing any of the simple ZigBee Data Types
defined in the ZCL.
The interface extends the ZCLDataTypeDescription
by providing
serialize and deserialize methods to marshal and unmarshal the data into the
ZigBeeDataInput
and from ZigBeeDataOutput
streams.
Related documentation: [1] ZigBee Cluster Library specification, Document 075123r04ZB, May 29, 2012.
- "Consumers of this API must not implement this interface"
-
Method Summary
Modifier and TypeMethodDescriptionDeserializes a value from the passedZigBeeDataInput
stream.void
serialize
(ZigBeeDataOutput os, Object value) Serializes a ZigBee data type into aZigBeeDataOutput
stream.Methods inherited from interface org.osgi.service.zigbee.descriptions.ZCLDataTypeDescription
getId, getJavaDataType, getName, isAnalog
-
Method Details
-
serialize
Serializes a ZigBee data type into aZigBeeDataOutput
stream. An implementation of this method must throw anIllegalArgumentException
if the passed value does not belong to the expected class or its value exceeds the possible values allowed (in terms of range or length).An implementation of this method must interpret (where it makes sense) a
null
value as the request to serialize the so called Invalid Value.- Parameters:
os
- aZigBeeDataOutput
stream where to the passed value will be appended. This parameter cannot benull
. Ifnull
aNullPointerException
must be thrown.value
- The value that have to be serialized on the output stream. If null is passed this method outputs on the stream the ZigBee invalid value related the specific data type. If the data type do not allow any invalid value and the passed value is null anIllegalArgumentException
is thrown.- Throws:
IOException
- If an I/O error occurs while writing on theZigBeeDataOutput
. TheEOFException
may be thrown if there is no more space on the data output for serializing the passed value.NullPointerException
- IfZigBeeDataOutput
parameter isnull
.IllegalArgumentException
- If the passed value parameter does not belong to the expected class or its value exceeds the possible values allowed (range or length).
-
deserialize
Deserializes a value from the passedZigBeeDataInput
stream.- Parameters:
is
- theZigBeeDataInput
from where the value of data type is read from.- Returns:
- An object that represents the deserialized value of data. Returns
null
if the read value represents the Invalid Value for the specific ZigBee data type. - Throws:
NullPointerException
- IfZigBeeDataInput
parameter isnull
.IOException
- If an I/O error occurs while reading theZigBeeDataInput
. AnEOFException
is thrown if the data input stream end is reached while deserializing the data type.
-