Interface MessageParser<T extends MessageBase>
-
- Type Parameters:
T
- The type of the message created by the parser.
- All Known Implementing Classes:
JaxbMessageParser
,MessageParserBase
public interface MessageParser<T extends MessageBase>
Represents a message parser used to parse received byte arrays into messages of specified type
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
Removes any data potentially left in the parser's buffer.String
getEncoding()
Gets the configured character encoding for the parser.void
processData(InputStream stream)
Processes passed data.void
setListener(MessageParserListener<T> listener)
Sets the listener used to observer thisMessageParser
implementation.
-
-
-
Method Detail
-
setListener
void setListener(MessageParserListener<T> listener)
Sets the listener used to observer thisMessageParser
implementation.- Parameters:
listener
- the listener used to observer thisMessageParser
implementation.
-
processData
void processData(InputStream stream) throws SdkException
Processes passed data. If passed data and any previously stored data represent a whole message theMessageParserListener.onMessageReady(T)
method is invoked- Parameters:
stream
- AInputStream
instance containing message data.- Throws:
IllegalArgumentException
- thestream
is a null reference.ProtocolException
- the data could not be processed either because the buffer is full, an un-expected character was encountered or there was an error while un-marshalling the messageSdkException
-
getEncoding
String getEncoding()
Gets the configured character encoding for the parser.- Returns:
- - a string, i.e. UTF-8
-
clear
void clear()
Removes any data potentially left in the parser's buffer.
-
-