Developing Custom Classes for Transforming Message Definition Fields

If your message definition has fields that require any combination of custom parser, serializer, or parse extension logic, you can implement any of the following interfaces: IParseExtension, ICustomParserField, or ICustomSerializerField. Custom classes must reside as a JAR in your Message Designer project's CustomClasses folder.

When editing a field in a message definition, you can assign one or more custom classes to the field in the Field Properties section.

  1. Use the following examples to write custom code.

    Custom Classes You Can CreateMessage Definition Field Property to Which You Assign It

    IParseExtension

    Custom Parse Extension

    ICustomParserField

    Custom Field Parser

    ICustomSerializerField

    Custom Field Serializer
  2. Select File|Import|File System to put the resulting JAR in your Message Designer project in the CustomClasses folder or subfolder. You can jar the classes individually or in groups as long as the JAR file includes all dependencies used in your implementation. At packaging time, the entire JAR is packaged.

    Note

    Make sure no duplicate classes exist in any JAR in the the same project.

    Warning

    To avoid packaging errors, do not rename JARs in the CustomClasses folder once they have been used in a message.

  3. When finished, assign the class to any number of fields in a message definition.

    When you validate a message definition that uses custom classes, the validation routine does not verify the existence or functionality of the custom classes.

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