Package org.apache.qpid.protonj2.codec
Interface TypeEncoder<V>
-
- Type Parameters:
V
- the concrete Type that this encoder handles.
- All Known Subinterfaces:
DescribedTypeEncoder<V>
,PrimitiveTypeEncoder<V>
- All Known Implementing Classes:
AbstractDescribedListTypeEncoder
,AbstractDescribedMapTypeEncoder
,AbstractDescribedTypeEncoder
,AbstractPrimitiveTypeEncoder
,AcceptedTypeEncoder
,AmqpSequenceTypeEncoder
,AmqpValueTypeEncoder
,ApplicationPropertiesTypeEncoder
,ArrayTypeEncoder
,AttachTypeEncoder
,BeginTypeEncoder
,BinaryTypeEncoder
,BooleanTypeEncoder
,ByteTypeEncoder
,CharacterTypeEncoder
,CloseTypeEncoder
,CoordinatorTypeEncoder
,DataTypeEncoder
,Decimal128TypeEncoder
,Decimal32TypeEncoder
,Decimal64TypeEncoder
,DeclaredTypeEncoder
,DeclareTypeEncoder
,DeleteOnCloseTypeEncoder
,DeleteOnNoLinksOrMessagesTypeEncoder
,DeleteOnNoLinksTypeEncoder
,DeleteOnNoMessagesTypeEncoder
,DeliveryAnnotationsTypeEncoder
,DeliveryTagEncoder
,DetachTypeEncoder
,DischargeTypeEncoder
,DispositionTypeEncoder
,DoubleTypeEncoder
,EndTypeEncoder
,ErrorConditionTypeEncoder
,FloatTypeEncoder
,FlowTypeEncoder
,FooterTypeEncoder
,HeaderTypeEncoder
,IntegerTypeEncoder
,ListTypeEncoder
,LongTypeEncoder
,MapTypeEncoder
,MessageAnnotationsTypeEncoder
,ModifiedTypeEncoder
,NullTypeEncoder
,OpenTypeEncoder
,PropertiesTypeEncoder
,ReceivedTypeEncoder
,RejectedTypeEncoder
,ReleasedTypeEncoder
,SaslChallengeTypeEncoder
,SaslInitTypeEncoder
,SaslMechanismsTypeEncoder
,SaslOutcomeTypeEncoder
,SaslResponseTypeEncoder
,ShortTypeEncoder
,SourceTypeEncoder
,StringTypeEncoder
,SymbolTypeEncoder
,TargetTypeEncoder
,TimestampTypeEncoder
,TransactionStateTypeEncoder
,TransferTypeEncoder
,UnknownDescribedTypeEncoder
,UnsignedByteTypeEncoder
,UnsignedIntegerTypeEncoder
,UnsignedLongTypeEncoder
,UnsignedShortTypeEncoder
,UUIDTypeEncoder
public interface TypeEncoder<V>
Interface for an encoder of a specific AMQP Type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Class<V>
getTypeClass()
boolean
isArrayType()
void
writeArray(ProtonBuffer buffer, EncoderState state, java.lang.Object[] values)
Write an array elements of the AMQP type to the given byte buffer.void
writeRawArray(ProtonBuffer buffer, EncoderState state, java.lang.Object[] values)
Write an array elements of the AMQP type to the given byte buffer.void
writeType(ProtonBuffer buffer, EncoderState state, V value)
Write the full AMQP type data to the given byte buffer.
-
-
-
Method Detail
-
getTypeClass
java.lang.Class<V> getTypeClass()
- Returns:
- the Class type that this encoder handles.
-
isArrayType
boolean isArrayType()
- Returns:
- true if the type handled by this encoded is an AMQP Array type.
-
writeType
void writeType(ProtonBuffer buffer, EncoderState state, V value) throws EncodeException
Write the full AMQP type data to the given byte buffer.This can consist of writing both a type constructor value and the bytes that make up the value of the type being written.
- Parameters:
buffer
- The buffer to write the AMQP type tostate
- The current encoder statevalue
- The value that is to be written.- Throws:
EncodeException
- if an error occurs while encoding the given value.
-
writeArray
void writeArray(ProtonBuffer buffer, EncoderState state, java.lang.Object[] values) throws EncodeException
Write an array elements of the AMQP type to the given byte buffer.This method writes the full Array type definition of an array of the type this encoder manages.
- Parameters:
buffer
- The buffer to write the AMQP array elements tostate
- The current encoder statevalues
- The array of values that is to be written.- Throws:
EncodeException
- if an error occurs while encoding the given value.
-
writeRawArray
void writeRawArray(ProtonBuffer buffer, EncoderState state, java.lang.Object[] values) throws EncodeException
Write an array elements of the AMQP type to the given byte buffer.This method writes only the body portion of an AMQP array of this type, the array encoding, size and element count should be assumed to be managed by the caller.
- Parameters:
buffer
- The buffer to write the AMQP array elements tostate
- The current encoder statevalues
- The array of values that is to be written.- Throws:
EncodeException
- if an error occurs while encoding the given value.
-
-