|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.sensorevent.model.generic.converter.GenericConverter
com.ibm.sensorevent.model.converter.Converter
com.ibm.sensorevent.model.converter.CBEConverter
public class CBEConverter
The CBEConverter class converts ISensorEvents, XML strings, and CommonBaseEvent (CBE) objects to other formats. Specifically, use the CBEConverter class to convert:
Event XML created by CBEConverter follows the CBE specification, including a limit of 1024 characters for each
attribute value. To create event XML without the 1024 character limit, use
XMLConverter
.
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT
|
protected EventFactory |
eventFactory
The CommonBaseEvent event factory used to create CommonBaseEvent instances. |
static int |
MAX_LENGTH
|
Constructor Summary | |
---|---|
CBEConverter()
Constructs a new CBEConverter. |
Method Summary | |
---|---|
static CBEConverter |
getInstance()
Factory method to create a CBEConverter instance. |
CommonBaseEvent |
toCBE(ISensorEvent event)
Converts an ISensorEvent instance to a CommonBaseEvent instance. |
CommonBaseEvent |
toCBE(java.lang.String xml)
Converts an XML string to a CommonBaseEvent instance. |
ISensorEvent |
toIBMSensorEvent(CommonBaseEvent cbe)
Converts a CommonBaseEvent instance to an ISensorEvent instance. |
java.lang.String |
toXMLString(CommonBaseEvent cbe)
Converts a CommonBaseEvent instance to an XML string. |
Methods inherited from class com.ibm.sensorevent.model.generic.converter.GenericConverter |
---|
toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
public static final int MAX_LENGTH
protected EventFactory eventFactory
Constructor Detail |
---|
public CBEConverter()
Method Detail |
---|
public static CBEConverter getInstance()
public CommonBaseEvent toCBE(ISensorEvent event) throws SensorEventException
SensorEventException
- if the ISensorEvent cannot be convertedpublic CommonBaseEvent toCBE(java.lang.String xml) throws SensorEventException
SensorEventException
- if the XML string cannot be convertedpublic ISensorEvent toIBMSensorEvent(CommonBaseEvent cbe) throws SensorEventException
toIBMSensorEvent
in interface IConverter
SensorEventException
- if the CommonBaseEvent cannot be convertedpublic java.lang.String toXMLString(CommonBaseEvent cbe) throws SensorEventException
toXMLString
in interface IConverter
SensorEventException
- if the CommonBaseEvent cannot be converted
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |