|
|
Regular Expression ParserOverviewThe Regular Expression Parser validates and parses Connectors' input/output against some regular expression. It uses the free Regular Expressions for Java library "gnu.regxep" available at http://www.cacas.org/java/gnu/regexp/. Please, consult "gnu.regexp" documentation for the regular expression notation supported and for the library's specification. The Regular Expression Parser is designed as a useful example that shows how to implement your own Parser in Java and integrate it in the Metamerge Integrator. Functional SpecificationConfigurationThe Parser provides the following parameters:
InputA single line from the input will correspond to a single Entry. OutputAll Attributes enumerated in the
attributeNames parameter that exist in the Entry
are concatenated to form a single string (in the order they
appear in the attributeNames parameter). Source CodeYou can view the source code of the Regular Expression Parser here . The Regular Expression Parser source file (with JavaDocs) is included here. Installation1. From the Regular Expressions for
Java website download the package gnu.regexp-1.1.3a.tar.gz.
(If this link has changed, please go to the library's page http://www.cacas.org/java/gnu/regexp/
and download library's latest version). Extract the archive's
contents keeping path information. Copy
the file "gnu-regexp-1.1.3.jar" (placed in the "lib" folder) to
the "jars" subfolder
of
the MI root directory.
2. Download the Regular Expression
Parser jar archive regExpParser.jar.
Add the file "regExpParser.jar" to the "jars" subfolder of the MI root
directory.
3. Edit "miadmin.lax" (placed in the MI root
folder) "lax.class.path" property to contain the regular expression
library path and the parser path (i.e. add
";jars/regExpParser.jar;jars/gnu-regexp-1.1.3.jar" at the end of the
property value)
4. Edit "miserver.lax" (placed in the MI root)
"lax.class.path" property to contain the regular expression library
path and the parser jar path (i.e. add
";jars/regExpParser.jar;jars/gnu-regexp-1.1.3.jar" at the end of the
property value)
5.
Finally you have to open MI Admin and add the Regular Expression Parser as
a Base Template in each MI configuration you intend to use the Parser
in. To do this: (1) press the "Add" button in the "Parser Templates"
tab of the "Base Templates" section in MI
Admin; (2) in the "Define Parser" dialog box input how you would like to
name the Parser in the "Name" edit-box and and place the
text "com.architech.parser.rspRegExpParser" in the "Java Class" edit-box; (3) Open the
newly added Parser Template and add the
following parameters: "regularExpression" and
"attributeNames".
DownloadsAn example configuration that demonstrates the Regular Expression Parser is included here . |
![]() |
|