Developing Custom Classes for Transforming Message Definition Fields

If a message definition has fields that require any combination of custom parser, serializer, or parse extension logic, you can implement one of the following interfaces:

Custom classes must reside as a JAR in your project's CustomClasses folder.

When editing a field in a message definition, you can assign a custom class to fields.

To develop custom classes for transforming message definition fields:

  1. Use the following examples to write custom code.

    The three custom classes for transforming message definition fields

    Custom classes you can createMessage definition field property to which you assign the class

    IParseExtension

    Custom Parse Extension

    ICustomParserField

    Custom Field Parser

    ICustomSerializerField

    Custom Field Serializer
  2. From the main menu bar, select File|Import|File System to put the resulting JAR in your 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 after they are used in a message.

  3. Assign the custom 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.

Adding a Field to a Message Definition

Implementing a Custom Field Parser with ICustomParserField

Implementing a Custom Field Serializer with ICustomSerializerField

Implementing a Custom Parser Extension with IParseExtension

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