Writing User-Defined Extension Classes

Define your own extension functions to use in transformation services.

After you define a class or set of classes containing the extension functions, build a JAR file containing these classes and add it to Sybase WorkSpace. The JAR file can be located anywhere on the file system.

  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:
    Table 1. Parameter types
    Java type Expression.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
    Table 2. Return types
    Java type Expression.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 can be declared as string, date, time, or dateTime in expressions.xml.
  4. Write implementations for the methods.
  5. Build a JAR file for the project.
Next 

Add user-defined extension function JAR files.

Related tasks
Modifying the Tool Palette
Adding a User-Defined Extension Function JAR
Editing the Expressions XML File

Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.