Master Index Match Engine Reference

Step 3: Define Parameter Validations (Optional)

If your custom comparators take parameters, you should create a Java class that validates the parameter properties. You need to perform this step if you defined parameters for the comparator in comparatorsList.xml. You do not need to create this file in the same package as the Java comparator class, but for packaging purposes, create it in the same working folder.

ProcedureTo Define Parameter Validations

  1. Complete Step 2: Register the Comparator in the Comparators List.

  2. Create a Java class named the same name as the Java class that defines the comparator with “ParamsValidator” appended.

    For example, if the comparator is defined by a class named ExactComparator, the parameter validation class would be ExactComparatorParamsValidator.

  3. In this class, implement com.sun.mdm.matcher.comparators.validator.ParametersValidator.

    The method contained in this class is described below.

  4. Continue to Step 4: Define Data Source Handling (Optional).

validateComparatorsParameters

Description

The ParametersValidator class contains one method, validateComparatorsParameters, that allows you to validate parameter types, ranges, and other properties. For logging purposes, you can use net.java.hulp.i18n, which is used within matcher.jar, or you can use your own logger.

Syntax

void validateComparatorsParameters(Map<String, Object> params)

Parameters

Parameter 

Type 

Description 

params 

Map 

A list of parameters to validate. 

Return Value

None.

Throws

MatcherException