Class SimpleFieldMatchList
- All Implemented Interfaces:
FieldMatchList
@NotThreadSafe public class SimpleFieldMatchList extends java.lang.Object implements FieldMatchList
This class is restricted to use with simple documents. In an XML document, there will be a record tag that identifies a record for a comparison operation. Within the record, there are attributes with tags. The simple format does not support comparison on fields nested more deeply than the attributes contained a the level below the record level. However, structured fields of the records can be copied to a basis of agreement if the record matches based on the attributes.
TBD Thread safety? at the moment I don't see how the class is being used and am not sure we have protected it from multithreading errors.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
SimpleFieldMatchList.MatchItem
Nested classes/interfaces inherited from interface pygar.documents.FieldMatchList
FieldMatchList.MATCHACTION
-
Constructor Summary
Constructors Constructor Description SimpleFieldMatchList()
-
Method Summary
Modifier and Type Method Description void
addComparison(java.lang.String resultName, EncryptedFieldTable tbl, boolean required, FieldMatchList.MATCHACTION report, java.lang.String tagNameA, java.lang.String fieldA, java.lang.String tagNameB, java.lang.String fieldB)
Add to match list a comparison between fields in two records in two documents.void
addInclude(java.lang.String tagName, java.lang.String fieldName, java.lang.String resultName)
Add a field from the input records that will be included in the match report (basis) when a match occurs.static void
main(java.lang.String[] args)
-
Constructor Details
-
SimpleFieldMatchList
public SimpleFieldMatchList()
-
-
Method Details
-
addComparison
public void addComparison(java.lang.String resultName, EncryptedFieldTable tbl, boolean required, FieldMatchList.MATCHACTION report, java.lang.String tagNameA, java.lang.String fieldA, java.lang.String tagNameB, java.lang.String fieldB) throws ConfigurationErrorDescription copied from interface:FieldMatchList
Add to match list a comparison between fields in two records in two documents. The comparison looks for an equality between field values or an overlap between real value ranges or a real and a real range, or an overlap between lists, or list membership. Where a field name is required, a qualified name is used. Logically, this qualified name begins with the record name in which the field is found. As our convention, we supply the record name as a separate parameter. The remainder of the field name is supplied by a second parameter.Comparison occur between records in two documents. The parameters in this method name two records in different documents. The order of the records in the method invocation is not important because the matcher will try to match records in both directions. For example, to match record A with record B in documents 1 and 2 the matcher will first look for A in document 1 and B in document 2. Next it will reverse the roles and look for A in document 2 and B in document 1.
The order in which the list is constructed can be an optimization hint to the matcher. The first comparisons should have the least probability of success thereby reducing the total number of comparisons. However, subclasses may implement the comparison in an manner.
- Specified by:
addComparison
in interfaceFieldMatchList
- Parameters:
resultName
- a name to refer to this match specification, optionally a name in the EncryptedFieldTable for use in a result record in the basis for agreement.tbl
- the encrypted field table that describes the documentsrequired
- true if these fields must match in order for the records to matchreport
- specifies how the result of the comparison is reported in the resulttagNameA
- the XML tag that identifies the first record in the comparisonfieldA
- the field in the first record for the comparisontagNameB
- the XML tag that identifies the first record in the comparisonfieldB
- the field in the first record for the comparison- Throws:
ConfigurationError
-
addInclude
public void addInclude(java.lang.String tagName, java.lang.String fieldName, java.lang.String resultName)Description copied from interface:FieldMatchList
Add a field from the input records that will be included in the match report (basis) when a match occurs. A field must be included or it is omitted from the report by default. An included field is copied in its entirety even if it has substructure. Thus, fields that are not available for comparison because they are structure may by copied for the report, if a match is found.The purpose of the field match list is primarily the specification of how to match fields in records within documents. However, a document may have, in addition to records, various administrative fields located at the level 1 of the document. It does not make sense to match these, but it may be desirable to copy them to the result of a match. The list of included fields can be extended to handle these administative fields quite easily. For these fields, specify the name of the field as the tagName and provide an empty string for both the fieldName and the resultName.
- Specified by:
addInclude
in interfaceFieldMatchList
- Parameters:
tagName
- the name of the record where the field is foundfieldName
- the name of the fieldresultName
- the name of the field when it is copied to the basis
-
main
public static void main(java.lang.String[] args)- Parameters:
args
-
-