This topic contains example code to implement a custom field serializer in a message definition to take field data from the parsed data container and return additional data into the outgoing message, along with any specified wire formatting.
package com.sybase.jtf.serializer.api;
/**
* This interface allows the user to define their own method to write to the
* output message.
*/
public interface ICustomSerializerField
{
/**
* This method allows the user to define a way to modify the data in a field
* and write the modified data to the message directly. The byte array that
* is returned will be added to the output message.
*
* @param fieldData An array of bytes that contains the data
* in the field named in the message definition.
* Note that this will be a null reference if
* no field is named in the message definition.
* @throws SerializationException Thrown if this method fails for any reason
* (as defined by the user). A call to the
* method Exception.getMessage() will be made
* if the exception is considered fatal to
* the serialization of the message being
* processed.
*/
public byte[] serializeField(byte[] fieldData) throws SerializationException;
}
Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com
Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.