Package org.glassfish.tyrus.core.coder
Class ReaderDecoder
- java.lang.Object
-
- org.glassfish.tyrus.core.coder.CoderAdapter
-
- org.glassfish.tyrus.core.coder.ReaderDecoder
-
- All Implemented Interfaces:
Decoder
,Decoder.Text<java.io.Reader>
public class ReaderDecoder extends CoderAdapter implements Decoder.Text<java.io.Reader>
Built inDecoder
forReader
.- Author:
- Pavel Bucek (pavel.bucek at oracle.com)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface javax.websocket.Decoder
Decoder.Binary<T>, Decoder.BinaryStream<T>, Decoder.Text<T>, Decoder.TextStream<T>
-
-
Constructor Summary
Constructors Constructor Description ReaderDecoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.Reader
decode(java.lang.String s)
Decode the given String into an object of type T.boolean
willDecode(java.lang.String s)
Answer whether the given String can be decoded into an object of type T.-
Methods inherited from class org.glassfish.tyrus.core.coder.CoderAdapter
destroy, init
-
-
-
-
Method Detail
-
willDecode
public boolean willDecode(java.lang.String s)
Description copied from interface:Decoder.Text
Answer whether the given String can be decoded into an object of type T.- Specified by:
willDecode
in interfaceDecoder.Text<java.io.Reader>
- Parameters:
s
- the string being tested for decodability.- Returns:
- whether this decoder can decoded the supplied string.
-
decode
public java.io.Reader decode(java.lang.String s) throws DecodeException
Description copied from interface:Decoder.Text
Decode the given String into an object of type T.- Specified by:
decode
in interfaceDecoder.Text<java.io.Reader>
- Parameters:
s
- string to be decoded.- Returns:
- the decoded message as an object of type T
- Throws:
DecodeException
- If the provided string cannot be decoded to type T
-
-