Featured Post

Applying Email Validation to a JavaFX TextField Using Binding

This example uses the same controller as in a previous post but adds a use case to support email validation.  A Commons Validator object is ...

Saturday, May 21, 2011

BRules 0.3 Released for Talend Open Studio

BRules is a collection of routines that validates data elements in Talend Open Studio. Version 0.3, which includes the new validation routines isXML(), okChars(), and isBlank(), was uploaded to the Talend Exchange.
The Talend Open Studio Routine BRules, or Business Rules, contains a set of validation functions for use in Talend components like tMap. Version 0.1 wrapped up Google's phone number validation library (libphonenumber). Version 0.2 adds the shorthand routines "all()" and "xor()" that handle empty values passed in the input schema.  Version 0.3 includes the string testing routines isXML(), okChars(), and isBlank().

isXML

A check for well-formedness in cases where an XSD isn't readily available.  (If one is available, use tXSDValidator.)

isXML("<message>hello</message>", "ISO8859_1") returns true

isXML("<message>hello", "ISO8859_1") returns false

There is also a version that leaves off the charset and defaults to "UTF-8".

okChars

Test the string against the passed-in character set.

okChar("hello", "ISO8859_1") returns true

isBlank

Test the string for null, empty string, or whitespace

 isBlank("     ") returns true

No comments:

Post a Comment