T
- Type of Token that the handler handles.public interface TokenHandler<T extends Token>
Modifier and Type | Method and Description |
---|---|
void |
convertToBytes(T token,
java.io.DataOutputStream outputStream)
Convert the token to a byte stream according to the handler's parsing algorithm
and output it to the outputStream.
|
T |
convertToToken(java.io.DataInputStream inputStream,
java.lang.Class<? extends T> tokenType)
Return a token of the specified type by reading from the inputStream
and converting to the token according to the parsing algorithm
defined in the handler.
|
void convertToBytes(T token, java.io.DataOutputStream outputStream) throws java.io.IOException, IllegalActionException
token
- the token to be convertedoutputStream
- the outputStream holding stream of bytesjava.io.IOException
- if there is a problem with the outputStreamIllegalActionException
- if there is the state becomes inconsistentT convertToToken(java.io.DataInputStream inputStream, java.lang.Class<? extends T> tokenType) throws java.io.IOException, IllegalActionException
inputStream
- The inputStream that contains serialized version
of a tokentokenType
- the type of token to be read.java.io.IOException
- if there is a problem with the outputStreamIllegalActionException
- if there is the state becomes inconsistent