Project

General

Profile

Download (1.5 KB) Statistics
| Branch: | Tag: | Revision:
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 class FieldMatcher extends FieldMatcherBase{
21
	@SuppressWarnings("unused")
22
	private static final Logger logger = LogManager.getLogger(FieldMatcher.class);
23

    
24
	private IMatchStrategy matchStrategy;
25

    
26
	public static FieldMatcher NewInstance(Field field, MatchMode matchMode, IMatchStrategy matchStrategy){
27
		return new FieldMatcher(field.getName(), field, matchMode, matchStrategy);
28
	}
29

    
30
	public static FieldMatcher NewInstance(Field field, MatchMode matchMode){
31
		return new FieldMatcher(field.getName(), field, matchMode, null);
32
	}
33

    
34
	private FieldMatcher (String propertyname, Field field, MatchMode matchMode, IMatchStrategy matchStrategy){
35
		super(propertyname, field, matchMode);
36
		this.matchStrategy = matchStrategy;
37
	}
38

    
39
	/**
40
	 * @return the matchStrategy
41
	 */
42
	public IMatchStrategy getMatchStrategy() {
43
		return matchStrategy;
44
	}
45

    
46
	/**
47
	 * @param matchStrategy the matchStrategy to set
48
	 */
49
	public void setMatchStrategy(IMatchStrategyEqual matchStrategy) {
50
		this.matchStrategy = matchStrategy;
51
	}
52

    
53

    
54
}
(3-3/18)