Implementing a Custom Parser Extension with IParseExtension

If you need to perform data scrubbing or any other custom post-processing of a parsed field in a message definition, implement the IParseExtension interface. 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 setting properties of a field in a message definition, you can assign this custom class to any number of fields.

Full source for IParseExtension:

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

/**
 * The IParseExtension interface provides an extension point in which 
 * clients can develop custom code to extend the field parsing 
 * capability of any IParser. Once a field has been parsed by an IParser, 
 * the <b>extend</b> method of a class that implements the IParseExtension 
 * interface can be called on that field to allow for additional 
 * functionality such as custom modification, substitution, additional 
 * validation and data scrubbing.
 */
public interface IParseExtension {

	/**
	 * Called on a parsed field to allow clients to extend the field 
	 * parsing capabilty of an IParser. 
	 * 
	 * @param field The parsed field (represented as a byte array).
	 * 
	 * @return The modified field (represented as a byte array).
	 */
	public byte[] extend(byte[] field);
}

Developing a Message Definition

Developing Custom Classes for Transforming Message Definition Fields

Implementing a Custom Field Parser with ICustomParserField

Implementing a Custom Field Serializer with ICustomSerializerField

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