Class ProtonDecoderState
- java.lang.Object
- 
- org.apache.qpid.protonj2.codec.decoders.ProtonDecoderState
 
- 
- All Implemented Interfaces:
- DecoderState
 
 public final class ProtonDecoderState extends Object implements DecoderState State object used by the Built in Decoder implementation.
- 
- 
Constructor SummaryConstructors Constructor Description ProtonDecoderState(ProtonDecoder decoder)Create a newDecoderStateinstance that is joined forever to the givenDecoder.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description StringdecodeUTF8(ProtonBuffer buffer, int length)Given a set of UTF-8 encoded bytes decode and return the String that represents that UTF-8 value.ProtonDecodergetDecoder()UTF8DecodergetStringDecoder()ProtonDecoderStatereset()Resets any intermediate state back to default values.ProtonDecoderStatesetStringDecoder(UTF8Decoder stringDecoder)Sets a custom UTF-8Stringdecoder that will be used for allStringdecoding done from the encoder associated with thisDecoderStateinstance.
 
- 
- 
- 
Constructor Detail- 
ProtonDecoderStatepublic ProtonDecoderState(ProtonDecoder decoder) Create a newDecoderStateinstance that is joined forever to the givenDecoder.- Parameters:
- decoder- The- Decoderthat this state instance is assigned to.
 
 
- 
 - 
Method Detail- 
getDecoderpublic ProtonDecoder getDecoder() - Specified by:
- getDecoderin interface- DecoderState
- Returns:
- the decoder that created this state object
 
 - 
resetpublic ProtonDecoderState reset() Description copied from interface:DecoderStateResets any intermediate state back to default values.- Specified by:
- resetin interface- DecoderState
- Returns:
- this DecoderStateinstance.
 
 - 
getStringDecoderpublic UTF8Decoder getStringDecoder() - Returns:
- the currently set custom UTF-8 Stringdecoder or null if non set.
 
 - 
setStringDecoderpublic ProtonDecoderState setStringDecoder(UTF8Decoder stringDecoder) Sets a custom UTF-8Stringdecoder that will be used for allStringdecoding done from the encoder associated with thisDecoderStateinstance. If no decoder is registered then the implementation uses its own decoding algorithm.- Parameters:
- stringDecoder- a custom- UTF8Decoderthat will be used for all- Stringdecoding.
- Returns:
- this Decoderinstance.
 
 - 
decodeUTF8public String decodeUTF8(ProtonBuffer buffer, int length) throws DecodeException Description copied from interface:DecoderStateGiven a set of UTF-8 encoded bytes decode and return the String that represents that UTF-8 value.- Specified by:
- decodeUTF8in interface- DecoderState
- Parameters:
- buffer- A buffer containing the UTF-8 encoded bytes to be decoded.
- length- The number of bytes in the passed buffer that comprise the UTF-8 encoding.
- Returns:
- a String that represents the UTF-8 decoded bytes.
- Throws:
- DecodeException- if an error occurs while decoding the string value.
 
 
- 
 
-