Loading Java library to validate email addresses - Cloud - 7.3

Talend Job Script Reference Guide

Version
Cloud
7.3
Language
English
Product
Talend Big Data
Talend Big Data Platform
Talend Cloud
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend CommandLine
Talend Studio
Content
Design and Development > Designing Jobs
Last publication date
2023-09-13

The Java code defined in the first tJavaRow component requires a Java library to be loaded before it can work. Follow the procedure below to add and configure a tLibraryLoad component to load that Java library and import the relevant classes at the time of Job execution.

Procedure

  1. Next to the second tJavaRow component, add a new component, tLibraryLoad.
    addComponent {
    	setComponentDefinition {
    		TYPE: "tLibraryLoad",
    		NAME: "tLibraryLoad_1",
    		POSITION: 256, 64
    	}
    
    }
  2. Next to the setComponentDefinition {} function, use the setSettings {} function to load the Java library and import the needed classes.
    	setSettings {
    		LIBRARY : "\"jakarta-oro-2.0.8.jar\"",
    		IMPORT : "import org.apache.oro.text.regex.Perl5Matcher;
    import org.apache.oro.text.regex.Perl5Compiler;
    import org.apache.oro.text.regex.Pattern;"
    	}