biz.onixs.fix.fastnew
Interface Template


public interface Template

This is an interface that classes will used when implementing a FAST template.


Method Summary
 void appendField(biz.onixs.fix.fastnew.TemplateField field)
          Adds a field to the container.
 Template copy()
           
 int decode(byte[] buffer, int offset, biz.onixs.fix.fastnew.DecoderPresenceMap presenceMap, Decoder decoder)
          This function will decode the message in the byte buffer and put the decoded fields into the message provided.
 int encode(Encoder encoder, byte[] buffer)
          This function will encode the message into the byte buffer provided using this template.
 biz.onixs.fix.fastnew.TemplateField[] getFields()
          This function returns an array of the fields added to this container in the order they were added.
 String getFixMessageType()
           
 String getId()
          This function will return the template id for this template.
 int getIdAsInt()
           
 String getName()
           
 

Method Detail

encode

int encode(Encoder encoder,
           byte[] buffer)
This function will encode the message into the byte buffer provided using this template.

Parameters:
buffer - the byte buffer in which to place the encoded message
Returns:
the length of the encoded message

decode

int decode(byte[] buffer,
           int offset,
           biz.onixs.fix.fastnew.DecoderPresenceMap presenceMap,
           Decoder decoder)
This function will decode the message in the byte buffer and put the decoded fields into the message provided.

VERY IMPORTANT NOTE: Because the template id itself is encoded into the message, the caller of this function needs to do some setup work before invoking this function.

The FAST specification states that an encoded message starts with a presence map followed immediately by the template id. Therefore the caller of this function needs to decode the presence map and extract the template id before calling this function. This implies that the presence map and offset passed into this function already take into account these operations.

The different decoder strategy classes available should shield the end user from this, as well as provide an example of how this is done.

Parameters:
buffer - the buffer that contains the encoded message to decode
offset - the offset into the buffer where the decoder should start decoding
presenceMap - the presence map to use for decoding this message

getId

String getId()
This function will return the template id for this template.

Returns:
this template's id

getName

String getName()

copy

Template copy()

getFixMessageType

String getFixMessageType()

getIdAsInt

int getIdAsInt()

appendField

void appendField(biz.onixs.fix.fastnew.TemplateField field)
Adds a field to the container.

Parameters:
field - the field to add to the container

getFields

biz.onixs.fix.fastnew.TemplateField[] getFields()
This function returns an array of the fields added to this container in the order they were added.

Returns:
an array of the fields added to this container


Copyright © 2005-2012 Onix Solutions. All Rights Reserved.