Writing User-Defined Extension Classes

You can define your own extension functions to use in transformation services. After you define a class or set of classes containing the extension functions, you build a JAR file containing these classes and add it to Sybase WorkSpace. This JAR file can be located anywhere on the file system.

To write a user-defined extension class:

  1. Create a Java project.

  2. Create a new public Java class in the project.

  3. Create public static methods in the new Java class. Choose from the following Parameter and Return types:

    Parameter Types

    Java typeExpression.xml

    boolean

    boolean

    byte

    integer

    short

    integer

    int

    integer

    long

    integer

    float

    decimal

    double

    decimal

    java.lang.String

    string

    date

    time

    dateTime

    org.w3c.dom.Node

    anyType

    org.w3c.dom.NodeList

    node-set

    Return Types

    Java typeExpression.xml

    boolean

    boolean

    byte

    integer

    short

    integer

    int

    integer

    long

    integer

    float

    decimal

    double

    decimal

    java.lang.String

    string

    date

    time

    dateTime

    Examples:

    • Java byte, short, int, or long parameter should be declared as type, integer, in an expression.xml file.

    • Depending on the context, java.lang.String parameters may be declared as string, date, time, or dateTime in expressions.xml.

  4. Write implementations for the newly-created methods.

  5. Build a JAR file for your project.

Next: Adding User-Defined Extension Function JARs

Developing Custom Classes for Transforming Message Definition Fields

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