Java Expressions Overview
You can invoke expressions in a Java transformation with the Java programming language.
Use expressions to extend the functionality of a Java transformation. For example, you can invoke an expression in a Java transformation to look up the values of input or output ports or look up the values of Java transformation variables.
To invoke expressions in a Java transformation, you generate the Java code or use Java transformation API methods to invoke the expression. You invoke the expression and use the result of the expression on the appropriate code entry tab. You can generate the Java code that invokes an expression or use API methods to write the Java code that invokes the expression.
The following table describes the methods that you can use to create and invoke expressions in a Java transformation:
Method | Description |
---|
Define Function dialog box | Enables you to create a function that invokes an expression and generate the code for an expression. |
Simple interface | Enables you to call a single API method to invoke an expression and get the result of the expression. |
Advanced interface | Enables you to define the expression, invoke the expression, and use the result of the expression. If you are familiar with object-oriented programming and want more control over invoking the expression, use the advanced interface. |
Expression Function Types
You can create expressions for a Java transformation by using the Define Function dialog box or by using the simple or advanced interface.
You can enter expressions that use input or output port variables or variables in the Java code as input parameters.
If you use the Define Function dialog box, you can validate the expression before you use it in a Java transformation.
You can invoke the following types of expression functions in a Java transformation:
Expression Function Type | Description |
---|
Transformation language functions | SQL-like functions designed to handle common expressions. |
User-defined functions | Functions that you create in the Developer tool based on transformation language functions. |
Custom functions | Functions that you create with the Custom Function API. |
You can also use unconnected transformations and built-in variables in expressions. For example, you can use an unconnected lookup transformation in an expression.