# tJavaFlex

Provides a Java code editor that lets you enter personalized code in order to integrate it in Talend program.

tJavaFlex enables you to add Java code to the Start/Main/End code sections of this component itself. With tJavaFlex, you can enter the three java-code parts (start, main and end) that constitute a kind of component dedicated to do a desired operation.

## tJavaFlex Standard properties

These properties are used to configure tJavaFlex running in the Standard Job framework.

The Standard tJavaFlex component belongs to the Custom Code family.

The component in this framework is available in all Talend products.

## Basic settings

| Properties | Description |
| --- | --- |
| Schema and Edit<br>Schema | <ul> <li> <p>A schema is a row description. It defines the number of fields            (columns) to be processed and passed on to the next component. When you create a Spark            Job, avoid the reserved word <kbd>line</kbd> when naming the            fields.</p> <p>Click <span>Sync columns</span> to retrieve                                the schema from the previous component in the Job.</p> <p>This component offers the advantage of the                  dynamic schema feature. This allows you to retrieve unknown columns from source                  files or to copy batches of columns from a source without mapping each column                  individually. For further information about dynamic schemas, see <a href="https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/dynamic-schema" target="_blank">Dynamic schema</a>.</p> <p>This            dynamic schema feature is designed for the purpose of retrieving unknown columns of a            table and is recommended to be used for this purpose only; it is not recommended for the            use of creating tables.</p> </li> <li> <p> <span>Built-In</span>: You create and store the schema locally for this component                only.</p> </li> <li> <p> <span>Repository</span>: You have already created the schema and stored it in the                Repository. You can reuse it in various projects and Job designs.</p> <p>When the schema to be reused has default values that are            integers or functions, ensure that these default values are not enclosed within            quotation marks. If they are, you must remove the quotation marks manually.</p> <p>For more information, see <a href="https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/retrieving-table-schemas?tocId=_C1~eFOlN~GM_JR2qkBYZg" target="_blank">Retrieving table schemas</a>.</p> </li> <li> <p>Click <span>Edit        schema</span> to make changes to the schema. If the current schema is of the <span>Repository</span> type, three options are available:</p> <ul> <li> <p> <span>View schema</span>: choose this                option to view the schema only.</p> </li> <li> <p> <span>Change to built-in property</span>:                choose this option to change the schema to <span>Built-in</span> for local changes.</p> </li> <li> <p> <span>Update repository connection</span>:                choose this option to change the schema stored in the repository and decide whether                to propagate the changes to all the Jobs upon completion.</p> <p>If you just want to                propagate the changes to the current Job, you can select <span>No</span> upon completion and choose this schema metadata                again in the <span>Repository Content</span>                window.</p> </li> </ul> </li> </ul> |
| Data Auto Propagate | Select this check box to automatically propagate the data to the<br>component that follows. |
| Start code | Enter the Java code that will be called during the initialization<br>phase. |
| Main code | Enter the Java code to be applied for each line in the data<br>flow. |
| End code | Enter the Java code that will be called during the closing<br>phase. |

## Advanced settings

| Properties | Description |
| --- | --- |
| Import | Enter the Java code that helps to import, if necessary, external<br>libraries used in the Main code box<br>of the Basic settings view. |
| tStatCatcher Statistics | Select this check box to gather the Job processing metadata at a<br>job level as well as at each component level. |

## Global Variables

| Variables | Description |
| --- | --- |
| Global Variables | ERROR\_MESSAGE: the error message generated by the<br>component when an error occurs. This is an After variable and it returns a string. This<br>variable functions only if the Die on error checkbox is<br>cleared, if the component has this checkbox.<br><br>A Flow variable functions during the execution of a component<br>while an After variable functions after the execution of the component.<br><br>To fill up a field or expression with a variable, press Ctrl+Space to access the variable list and choose the variable to use from<br>it.<br><br>For more information about variables, see [Using contexts and variables](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/contexts-and-variables). |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | You can use this component as a start, intermediate or output<br>component. You can as well use it as a one-component subJob. |
| Limitation | You should know the Java language. |

**Related concepts**

* [Generating data flow](https://help.qlik.com/talend/en-US/components/8.0/java-custom-code/tjavaflex-tlogrow-generating-data-flow-standard-component-this)
* [Processing rows of data with tJavaFlex](https://help.qlik.com/talend/en-US/components/8.0/java-custom-code/tjavaflex-trowgenerator-processing-rows-of-data-with-tjavaflex-standard-component-this)
* [Using tJavaFlex to display file content based on a dynamic schema](https://help.qlik.com/talend/en-US/components/8.0/java-custom-code/tjavaflex-tfileinputdelimited-tfileoutputdelimited-tfileoutputdelimited-using-tjavaflex-to-display-file-content-based-on-dynamic-schema-standard-component-enterprise-this)