Table of Contents

Search

  1. Preface
  2. Working with Transformations
  3. Aggregator Transformation
  4. Custom Transformation
  5. Custom Transformation Functions
  6. Data Masking Transformation
  7. Data Masking Examples
  8. Expression Transformation
  9. External Procedure Transformation
  10. Filter Transformation
  11. HTTP Transformation
  12. Identity Resolution Transformation
  13. Java Transformation
  14. Java Transformation API Reference
  15. Java Expressions
  16. Java Transformation Example
  17. Joiner Transformation
  18. Lookup Transformation
  19. Lookup Caches
  20. Dynamic Lookup Cache
  21. Normalizer Transformation
  22. Rank Transformation
  23. Router Transformation
  24. Sequence Generator Transformation
  25. Sorter Transformation
  26. Source Qualifier Transformation
  27. SQL Transformation
  28. Using the SQL Transformation in a Mapping
  29. Stored Procedure Transformation
  30. Transaction Control Transformation
  31. Union Transformation
  32. Unstructured Data Transformation
  33. Update Strategy Transformation
  34. XML Transformations

Transformation Guide

Transformation Guide

Using the Java Code Tab

Using the Java Code Tab

Use the Java Code tab to define, compile, and fix compilation errors in Java code. Create code snippets in the code entry tabs.
When you define the java code, you can perform the following task:
  • Define static code or a static block, instance variables, and user-defined methods.
  • Define Java expressions, and define transformation logic.
  • Use Java transformation API methods and standard Java language constructs.
  • Import third-party Java APIs, built-in Java packages, or custom Java packages. You can use Java code snippets from Java packages.
After you develop code snippets, you can compile the Java code and view the results of the compilation in the Output window or view the full Java code.
The Java Code tab contains the following components:
  • Navigator.
    Add input or output ports or APIs to a code snippet. The Navigator lists the input and output ports for the transformation, the available Java transformation APIs, and a description of the port or API function. For input and output ports, the description includes the port name, type, datatype, precision, and scale. For API functions, the description includes the syntax and use of the API function.
    The Navigator disables any port or API function that is unavailable for the code entry tab. For example, you cannot add ports or call API functions from the Import Packages code entry tab.
  • Code window.
    Develop Java code for the transformation. The code window uses basic Java syntax highlighting.
  • Code entry tabs.
    Define transformation behavior. Each code entry tab has an associated Code window. To enter Java code for a code entry tab, click the tab and write Java code in the Code window.
  • Define Expression link.
    Opens the Define Expression dialog box that you use to create Java expressions.
  • Settings link.
    Opens the Settings dialog box. Use the Settings dialog box to set the classpath for third-party and custom Java packages, to enable high precision for Decimal datatypes, and to process subsecond data. The PowerCenter Client includes files within the classpath when it compiles the java code.
  • Compile link.
    Compiles the Java code for the transformation. Output from the Java compiler, including error and informational messages, appears in the Output window.
  • Full Code link
    . Opens the Full Code window to display the complete class code for the Java transformation. The complete code for the transformation includes the Java code from the code entry tabs added to the Java transformation class template.
  • Output window.
    Displays the compilation results for the Java transformation class. You can right-click an error message in the Output window to locate the error in the snippet code or the full code for the Java transformation class in the Full Code window. You can also double-click an error in the Output window to locate the source of the error.

0 COMMENTS

We’d like to hear from you!