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.log4j.Logger;
|
15
|
|
16
|
/**
|
17
|
* @author a.mueller
|
18
|
* @created 07.08.2009
|
19
|
* @version 1.0
|
20
|
*/
|
21
|
public class FieldMatcher extends FieldMatcherBase{
|
22
|
@SuppressWarnings("unused")
|
23
|
private static final Logger logger = Logger.getLogger(FieldMatcher.class);
|
24
|
|
25
|
private IMatchStrategy matchStrategy;
|
26
|
|
27
|
public static FieldMatcher NewInstance(Field field, MatchMode matchMode, IMatchStrategy matchStrategy){
|
28
|
return new FieldMatcher(field.getName(), field, matchMode, matchStrategy);
|
29
|
}
|
30
|
|
31
|
public static FieldMatcher NewInstance(Field field, MatchMode matchMode){
|
32
|
return new FieldMatcher(field.getName(), field, matchMode, null);
|
33
|
}
|
34
|
|
35
|
private FieldMatcher (String propertyname, Field field, MatchMode matchMode, IMatchStrategy matchStrategy){
|
36
|
super(propertyname, field, matchMode);
|
37
|
this.matchStrategy = matchStrategy;
|
38
|
}
|
39
|
|
40
|
/**
|
41
|
* @return the matchStrategy
|
42
|
*/
|
43
|
public IMatchStrategy getMatchStrategy() {
|
44
|
return matchStrategy;
|
45
|
}
|
46
|
|
47
|
/**
|
48
|
* @param matchStrategy the matchStrategy to set
|
49
|
*/
|
50
|
public void setMatchStrategy(IMatchStrategy matchStrategy) {
|
51
|
this.matchStrategy = matchStrategy;
|
52
|
}
|
53
|
|
54
|
|
55
|
}
|