Class JaxbMessageParser<T extends MessageBase>
java.lang.Object
com.sportradar.livedata.sdk.proto.common.MessageParserBase<T>
com.sportradar.livedata.sdk.proto.common.JaxbMessageParser<T>
- All Implemented Interfaces:
MessageParser<T>
A
MessageParser implementation which uses JAXB to un-marshal the messages-
Constructor Summary
ConstructorsConstructorDescriptionJaxbMessageParser(JaxbBuilder builder, MessageTokenizer tokenizer) Initializes a new instance of theJaxbMessageParserclass. -
Method Summary
Modifier and TypeMethodDescriptionGets the configured character encoding for the parser.protected voidonDataReady(InputStream stream) Processes the received data.protected voidunMarshallData(InputStream stream) When overridden in derived class it un-marshals thedata.Methods inherited from class com.sportradar.livedata.sdk.proto.common.MessageParserBase
clear, notifyMessageReady, processData, setListener
-
Constructor Details
-
JaxbMessageParser
Initializes a new instance of theJaxbMessageParserclass.- Parameters:
builder- TheJaxbBuilderimplementation used to construct theUnmarshallerinstances.tokenizer- TheMessageTokenizerimplementation used to tokenize received data, or a null reference.- Throws:
IllegalArgumentException- thebuilderis a null reference orbufferSizeis smaller than or equal to 0.
-
-
Method Details
-
unMarshallData
When overridden in derived class it un-marshals thedata.- Parameters:
stream- AInputStreaminstance containing message data.- Throws:
ProtocolException- the exception was thrown while un-marshaling thedata.SdkException
-
onDataReady
Processes the received data.- Specified by:
onDataReadyin classMessageParserBase<T extends MessageBase>- Parameters:
stream- AInputStreamimplementation containing the received data.- Throws:
SdkException- thrown when an un-expected situation is encountered.
-
getEncoding
Gets the configured character encoding for the parser.- Returns:
- - a string, i.e. UTF-8
-