Implementing a Custom Field Parser with ICustomParserField

To extend parse transformation operations for a field in a message definition, implement the ICustomParserField interface. Write your own custom logic to parse a field type. The result of this process is a custom class that is an extension point of a field. The JAR must reside in the CustomClasses folder or subfolder. When editing a message definition in the Message Definition Editor, you can assign this custom class to any number of fields.

Full source for ICustomParserField:

// package declaration
package com.sybase.jtf.parser.api;

/**
 * The ICustomParserField interface provides an extension point in which 
 * clients can develop custom code to define a means of parsing a field 
 * that is not defined in the standard API.
 */
public interface ICustomParserField {

	/**
	 * 
	 * 
	 * @param buffer The message buffer.
	 * @param offset The offset into the buffer.
	 * @param max    The maximum offset within the buffer.
	 * @param result The result of the parse.
	 * @param name   The name of the component.
	 * 
	 * @return The number of bytes consumed or -1 meaning failure.
	 */
	public int parseField(byte[] buffer, int offset, int max, ParseResult result, String name);
}

Developing a Message Definition

Developing Custom Classes for Transforming Message Definition Fields

Implementing a Custom Field Serializer with ICustomSerializerField

Implementing a Custom Parser Extension with IParseExtension

Adding a Field to a Message Definition

Custom Wire Formats

Troubleshooting Custom Wire Formats

Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com