O'Reilly logo

Talend Open Studio Cookbook by Rick Barton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Importing JAR files to allow use of external Java classes

Occasionally, during development it is necessary (or simpler) to make use of Java classes that aren't already included within Talend. These may be pre-existing Java code such as financial calculations or open source libraries, which are provided by The Apache Software Foundation (www.apache.org).

In this example, we will make use of a simple Java class ExternalValidations and its ExternalValidateCustomerName method. This class performs the following simple validation:

if (customerName.startsWith("J ")) {
  return customerName.replace("J ", "James ");
} else {
  if (customerName.startsWith("Jo ")) {
    return customerName.replace("Jo ", "Joanne ");
    } else {
    return customerName;
  }
}

Getting ready

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required