1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2007 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
|
11
|
package eu.etaxonomy.cdm.strategy.match;
|
12
|
|
13
|
import java.lang.reflect.Field;
|
14
|
|
15
|
import org.apache.log4j.Logger;
|
16
|
|
17
|
/**
|
18
|
* @author a.mueller
|
19
|
* @created 07.08.2009
|
20
|
* @version 1.0
|
21
|
*/
|
22
|
public class FieldMatcher extends FieldMatcherBase{
|
23
|
@SuppressWarnings("unused")
|
24
|
private static final Logger logger = Logger.getLogger(FieldMatcher.class);
|
25
|
|
26
|
private IMatchStrategy matchStrategy;
|
27
|
|
28
|
public static FieldMatcher NewInstance(Field field, MatchMode matchMode, IMatchStrategy matchStrategy){
|
29
|
return new FieldMatcher(field.getName(), field, matchMode, matchStrategy);
|
30
|
}
|
31
|
|
32
|
public static FieldMatcher NewInstance(Field field, MatchMode matchMode){
|
33
|
return new FieldMatcher(field.getName(), field, matchMode, null);
|
34
|
}
|
35
|
|
36
|
private FieldMatcher (String propertyname, Field field, MatchMode matchMode, IMatchStrategy matchStrategy){
|
37
|
super(propertyname, field, matchMode);
|
38
|
this.matchStrategy = matchStrategy;
|
39
|
}
|
40
|
|
41
|
/**
|
42
|
* @return the matchStrategy
|
43
|
*/
|
44
|
public IMatchStrategy getMatchStrategy() {
|
45
|
return matchStrategy;
|
46
|
}
|
47
|
|
48
|
/**
|
49
|
* @param matchStrategy the matchStrategy to set
|
50
|
*/
|
51
|
public void setMatchStrategy(IMatchStrategy matchStrategy) {
|
52
|
this.matchStrategy = matchStrategy;
|
53
|
}
|
54
|
|
55
|
|
56
|
}
|