类 BaseMessageParser
java.lang.Object
com.huangjian.modbus4j.base.BaseMessageParser
- 所有已实现的接口:
MessageParser
Abstract BaseMessageParser class.
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明parseMessage(ByteQueue queue) Attempt to parse a message out of the queue.protected abstract IncomingMessageparseMessageImpl(ByteQueue queue) parseMessageImpl.
-
字段详细资料
-
master
protected final boolean master
-
-
构造器详细资料
-
BaseMessageParser
public BaseMessageParser(boolean master) Constructor for BaseMessageParser.
- 参数:
master- a boolean.
-
-
方法详细资料
-
parseMessage
Attempt to parse a message out of the queue. Data in the queue may be discarded if it is unusable (i.e. a start indicator is not found), but otherwise if a message is not found due to the data being incomplete, the method should return null. As additional data arrives, it will be appended to the queue and this method will be called again. Implementations should not modify the queue unless it is safe to do so. No copy of the data is made before calling this method.- 指定者:
parseMessage在接口中MessageParser- 参数:
queue- the queue from which to access data for the creation of the message- 返回:
- the message if one was able to be created, or null otherwise.
- 抛出:
Exception- if the data in the queue is sufficient to construct a message, but the message data is invalid, this method must throw an exception, or it will keep getting the same data.
-
parseMessageImpl
parseMessageImpl.
- 参数:
queue- aByteQueueobject.- 返回:
- a
IncomingMessageobject. - 抛出:
Exception- if any.
-