Class ReaderDecoder

java.lang.Object
org.glassfish.tyrus.core.coder.CoderAdapter
org.glassfish.tyrus.core.coder.ReaderDecoder
All Implemented Interfaces:
Decoder, Decoder.Text<Reader>

public class ReaderDecoder extends CoderAdapter implements Decoder.Text<Reader>
Built in Decoder for Reader.
Author:
Pavel Bucek
  • Constructor Details

    • ReaderDecoder

      public ReaderDecoder()
  • Method Details

    • willDecode

      public boolean willDecode(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 interface Decoder.Text<Reader>
      Parameters:
      s - the string being tested for decodability.
      Returns:
      whether this decoder can decoded the supplied string.
    • decode

      public Reader decode(String s) throws DecodeException
      Description copied from interface: Decoder.Text
      Decode the given String into an object of type T.
      Specified by:
      decode in interface Decoder.Text<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