1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.cdm.strategy.match;
|
11
|
|
12
|
import java.lang.reflect.Field;
|
13
|
|
14
|
import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
|
15
|
|
16
|
/**
|
17
|
* @author a.mueller
|
18
|
* @since 07.08.2009
|
19
|
*/
|
20
|
public abstract class FieldMatcherBase {
|
21
|
@SuppressWarnings("unused")
|
22
|
private static final Logger logger = LogManager.getLogger(FieldMatcherBase.class);
|
23
|
|
24
|
private String propertyName ;
|
25
|
private Field field;
|
26
|
private MatchMode matchMode;
|
27
|
|
28
|
protected FieldMatcherBase (String propertyname, Field field, MatchMode matchMode){
|
29
|
this.propertyName = propertyname;
|
30
|
this.field = field;
|
31
|
this.matchMode = matchMode;
|
32
|
}
|
33
|
|
34
|
/**
|
35
|
* @return the propertyName
|
36
|
*/
|
37
|
public String getPropertyName() {
|
38
|
return propertyName;
|
39
|
}
|
40
|
|
41
|
/**
|
42
|
* @param propertyName the propertyName to set
|
43
|
*/
|
44
|
public void setPropertyName(String propertyName) {
|
45
|
this.propertyName = propertyName;
|
46
|
}
|
47
|
|
48
|
/**
|
49
|
* @return the field
|
50
|
*/
|
51
|
public Field getField() {
|
52
|
return field;
|
53
|
}
|
54
|
|
55
|
/**
|
56
|
* @param field the field to set
|
57
|
*/
|
58
|
public void setField(Field field) {
|
59
|
this.field = field;
|
60
|
}
|
61
|
|
62
|
|
63
|
|
64
|
/**
|
65
|
* @return the matchMode
|
66
|
*/
|
67
|
public MatchMode getMatchMode() {
|
68
|
return matchMode;
|
69
|
}
|
70
|
|
71
|
/**
|
72
|
* @param matchMode the matchMode to set
|
73
|
*/
|
74
|
public void setMatchMode(MatchMode matchMode) {
|
75
|
this.matchMode = matchMode;
|
76
|
}
|
77
|
|
78
|
@Override
|
79
|
public String toString(){
|
80
|
if (propertyName == null || matchMode == null){
|
81
|
return super.toString();
|
82
|
}
|
83
|
return "[" + propertyName + "->" + matchMode.toString() +"]";
|
84
|
}
|
85
|
|
86
|
|
87
|
}
|