org.glassfish.tyrus
Class NoOpTextCoder

java.lang.Object
  extended by org.glassfish.tyrus.NoOpTextCoder
All Implemented Interfaces:
Decoder, Decoder.Text<String>, Encoder, Encoder.Text<String>

public class NoOpTextCoder
extends Object
implements Decoder.Text<String>, Encoder.Text<String>

Author:
Stepan Kopriva (stepan.kopriva 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>
 
Nested classes/interfaces inherited from interface javax.websocket.Encoder
Encoder.Binary<T>, Encoder.BinaryStream<T>, Encoder.Text<T>, Encoder.TextStream<T>
 
Field Summary
static NoOpTextCoder INSTANCE
           
 
Constructor Summary
NoOpTextCoder()
           
 
Method Summary
 String decode(String s)
          Decode the given String into an object of type T.
 String encode(String object)
          Encode the given object into a String.
 boolean willDecode(String s)
          Answer whether the given String can be decoded into an object of type T.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final NoOpTextCoder INSTANCE
Constructor Detail

NoOpTextCoder

public NoOpTextCoder()
Method Detail

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<String>
Parameters:
s - the string being tested for decodability
Returns:
whether this decoder can decoded the supplied string.

decode

public String 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<String>
Parameters:
s - string to be decoded.
Returns:
the decoded message as an object of type T
Throws:
DecodeException

encode

public String encode(String object)
              throws EncodeException
Description copied from interface: Encoder.Text
Encode the given object into a String.

Specified by:
encode in interface Encoder.Text<String>
Parameters:
object - the object being encoded.
Returns:
the encoded object as a string.
Throws:
EncodeException


Copyright © 2012. All Rights Reserved.