Top Description Inners Fields Constructors Methods
org.glassfish.tyrus.core.coder

public abstract Class PrimitiveDecoders<T>

extends CoderAdapter
implements Decoder.Text<T>
Class Inheritance
All Implemented Interfaces
jakarta.websocket.Decoder.Text, jakarta.websocket.Decoder
Known Direct Subclasses
org.glassfish.tyrus.core.coder.PrimitiveDecoders.BooleanDecoder, org.glassfish.tyrus.core.coder.PrimitiveDecoders.ByteDecoder, org.glassfish.tyrus.core.coder.PrimitiveDecoders.CharacterDecoder, org.glassfish.tyrus.core.coder.PrimitiveDecoders.DoubleDecoder, org.glassfish.tyrus.core.coder.PrimitiveDecoders.FloatDecoder, org.glassfish.tyrus.core.coder.PrimitiveDecoders.IntegerDecoder, org.glassfish.tyrus.core.coder.PrimitiveDecoders.LongDecoder, org.glassfish.tyrus.core.coder.PrimitiveDecoders.ShortDecoder
Imports
java.util.Arrays, .Collections, .HashMap, .List, .Map, java.util.logging.Level, .Logger, jakarta.websocket.DecodeException, .Decoder, org.glassfish.tyrus.core.ReflectionHelper

Collection of decoders for all primitive types.
Authors
Martin Matula, Danny Coward, Stepan Kopriva

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class
public static class
public static class
public static class
public static class
public static class
public static class

Field Summary

Modifier and TypeField and Description
public static final List<Class<? extends Decoder>>
public static final Map<Class<?>, Decoder.Text<?>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static Map<Class<?>, Decoder.Text<?>>
public boolean
willDecode(String
the string being tested for decodability.
s
)

Implements jakarta.websocket.Decoder.Text.willDecode.

Answer whether the given String can be decoded into an object of type T.

Inherited from org.glassfish.tyrus.core.coder.CoderAdapter:
destroyinit

Field Detail

ALLback to summary
public static final List<Class<? extends Decoder>> ALL
ALL_INSTANCESback to summary
public static final Map<Class<?>, Decoder.Text<?>> ALL_INSTANCES

Constructor Detail

PrimitiveDecodersback to summary
public PrimitiveDecoders()

Method Detail

getAllInstancesback to summary
private static Map<Class<?>, Decoder.Text<?>> getAllInstances()
willDecodeback to summary
public boolean willDecode(String s)

Implements jakarta.websocket.Decoder.Text.willDecode.

Doc from jakarta.websocket.Decoder.Text.willDecode.

Answer whether the given String can be decoded into an object of type T.

Parameters
s:String

the string being tested for decodability.

Returns:boolean

whether this decoder can decoded the supplied string.

Annotations
@Override
org.glassfish.tyrus.core.coder back to summary

public Class PrimitiveDecoders.BooleanDecoder

extends PrimitiveDecoders<Boolean>
Class Inheritance

Field Summary

Inherited from org.glassfish.tyrus.core.coder.PrimitiveDecoders:
ALLALL_INSTANCES

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Boolean
decode(String
string to be decoded.
s
)

Implements jakarta.websocket.Decoder.Text.decode.

Decode the given String into an object of type T.

Inherited from org.glassfish.tyrus.core.coder.PrimitiveDecoders:
willDecode

Constructor Detail

BooleanDecoderback to summary
public BooleanDecoder()

Method Detail

decodeback to summary
public Boolean decode(String s) throws DecodeException

Implements jakarta.websocket.Decoder.Text.decode.

Doc from jakarta.websocket.Decoder.Text.decode.

Decode the given String into an object of type T.

Parameters
s:String

string to be decoded.

Returns:Boolean

the decoded message as an object of type T

Annotations
@Override
Exceptions
DecodeException:
If the provided string cannot be decoded to type T
org.glassfish.tyrus.core.coder back to summary

public Class PrimitiveDecoders.ByteDecoder

extends PrimitiveDecoders<Byte>
Class Inheritance

Field Summary

Inherited from org.glassfish.tyrus.core.coder.PrimitiveDecoders:
ALLALL_INSTANCES

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Byte
decode(String
string to be decoded.
s
)

Implements jakarta.websocket.Decoder.Text.decode.

Decode the given String into an object of type T.

Inherited from org.glassfish.tyrus.core.coder.PrimitiveDecoders:
willDecode

Constructor Detail

ByteDecoderback to summary
public ByteDecoder()

Method Detail

decodeback to summary
public Byte decode(String s) throws DecodeException

Implements jakarta.websocket.Decoder.Text.decode.

Doc from jakarta.websocket.Decoder.Text.decode.

Decode the given String into an object of type T.

Parameters
s:String

string to be decoded.

Returns:Byte

the decoded message as an object of type T

Annotations
@Override
Exceptions
DecodeException:
If the provided string cannot be decoded to type T
org.glassfish.tyrus.core.coder back to summary

public Class PrimitiveDecoders.CharacterDecoder

extends PrimitiveDecoders<Character>
Class Inheritance

Field Summary

Inherited from org.glassfish.tyrus.core.coder.PrimitiveDecoders:
ALLALL_INSTANCES

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Character
decode(String
string to be decoded.
s
)

Implements jakarta.websocket.Decoder.Text.decode.

Decode the given String into an object of type T.

Inherited from org.glassfish.tyrus.core.coder.PrimitiveDecoders:
willDecode

Constructor Detail

CharacterDecoderback to summary
public CharacterDecoder()

Method Detail

decodeback to summary
public Character decode(String s) throws DecodeException

Implements jakarta.websocket.Decoder.Text.decode.

Doc from jakarta.websocket.Decoder.Text.decode.

Decode the given String into an object of type T.

Parameters
s:String

string to be decoded.

Returns:Character

the decoded message as an object of type T

Annotations
@Override
Exceptions
DecodeException:
If the provided string cannot be decoded to type T
org.glassfish.tyrus.core.coder back to summary

public Class PrimitiveDecoders.DoubleDecoder

extends PrimitiveDecoders<Double>
Class Inheritance

Field Summary

Inherited from org.glassfish.tyrus.core.coder.PrimitiveDecoders:
ALLALL_INSTANCES

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Double
decode(String
string to be decoded.
s
)

Implements jakarta.websocket.Decoder.Text.decode.

Decode the given String into an object of type T.

Inherited from org.glassfish.tyrus.core.coder.PrimitiveDecoders:
willDecode

Constructor Detail

DoubleDecoderback to summary
public DoubleDecoder()

Method Detail

decodeback to summary
public Double decode(String s) throws DecodeException

Implements jakarta.websocket.Decoder.Text.decode.

Doc from jakarta.websocket.Decoder.Text.decode.

Decode the given String into an object of type T.

Parameters
s:String

string to be decoded.

Returns:Double

the decoded message as an object of type T

Annotations
@Override
Exceptions
DecodeException:
If the provided string cannot be decoded to type T
org.glassfish.tyrus.core.coder back to summary

public Class PrimitiveDecoders.FloatDecoder

extends PrimitiveDecoders<Float>
Class Inheritance

Field Summary

Inherited from org.glassfish.tyrus.core.coder.PrimitiveDecoders:
ALLALL_INSTANCES

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Float
decode(String
string to be decoded.
s
)

Implements jakarta.websocket.Decoder.Text.decode.

Decode the given String into an object of type T.

Inherited from org.glassfish.tyrus.core.coder.PrimitiveDecoders:
willDecode

Constructor Detail

FloatDecoderback to summary
public FloatDecoder()

Method Detail

decodeback to summary
public Float decode(String s) throws DecodeException

Implements jakarta.websocket.Decoder.Text.decode.

Doc from jakarta.websocket.Decoder.Text.decode.

Decode the given String into an object of type T.

Parameters
s:String

string to be decoded.

Returns:Float

the decoded message as an object of type T

Annotations
@Override
Exceptions
DecodeException:
If the provided string cannot be decoded to type T
org.glassfish.tyrus.core.coder back to summary

public Class PrimitiveDecoders.IntegerDecoder

extends PrimitiveDecoders<Integer>
Class Inheritance

Field Summary

Inherited from org.glassfish.tyrus.core.coder.PrimitiveDecoders:
ALLALL_INSTANCES

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Integer
decode(String
string to be decoded.
s
)

Implements jakarta.websocket.Decoder.Text.decode.

Decode the given String into an object of type T.

Inherited from org.glassfish.tyrus.core.coder.PrimitiveDecoders:
willDecode

Constructor Detail

IntegerDecoderback to summary
public IntegerDecoder()

Method Detail

decodeback to summary
public Integer decode(String s) throws DecodeException

Implements jakarta.websocket.Decoder.Text.decode.

Doc from jakarta.websocket.Decoder.Text.decode.

Decode the given String into an object of type T.

Parameters
s:String

string to be decoded.

Returns:Integer

the decoded message as an object of type T

Annotations
@Override
Exceptions
DecodeException:
If the provided string cannot be decoded to type T
org.glassfish.tyrus.core.coder back to summary

public Class PrimitiveDecoders.LongDecoder

extends PrimitiveDecoders<Long>
Class Inheritance

Field Summary

Inherited from org.glassfish.tyrus.core.coder.PrimitiveDecoders:
ALLALL_INSTANCES

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Long
decode(String
string to be decoded.
s
)

Implements jakarta.websocket.Decoder.Text.decode.

Decode the given String into an object of type T.

Inherited from org.glassfish.tyrus.core.coder.PrimitiveDecoders:
willDecode

Constructor Detail

LongDecoderback to summary
public LongDecoder()

Method Detail

decodeback to summary
public Long decode(String s) throws DecodeException

Implements jakarta.websocket.Decoder.Text.decode.

Doc from jakarta.websocket.Decoder.Text.decode.

Decode the given String into an object of type T.

Parameters
s:String

string to be decoded.

Returns:Long

the decoded message as an object of type T

Annotations
@Override
Exceptions
DecodeException:
If the provided string cannot be decoded to type T
org.glassfish.tyrus.core.coder back to summary

public Class PrimitiveDecoders.ShortDecoder

extends PrimitiveDecoders<Short>
Class Inheritance

Field Summary

Inherited from org.glassfish.tyrus.core.coder.PrimitiveDecoders:
ALLALL_INSTANCES

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Short
decode(String
string to be decoded.
s
)

Implements jakarta.websocket.Decoder.Text.decode.

Decode the given String into an object of type T.

Inherited from org.glassfish.tyrus.core.coder.PrimitiveDecoders:
willDecode

Constructor Detail

ShortDecoderback to summary
public ShortDecoder()

Method Detail

decodeback to summary
public Short decode(String s) throws DecodeException

Implements jakarta.websocket.Decoder.Text.decode.

Doc from jakarta.websocket.Decoder.Text.decode.

Decode the given String into an object of type T.

Parameters
s:String

string to be decoded.

Returns:Short

the decoded message as an object of type T

Annotations
@Override
Exceptions
DecodeException:
If the provided string cannot be decoded to type T