Project

General

Profile

Download (977 Bytes) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2014 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
package eu.etaxonomy.cdm.model;
10

    
11
import org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter;
12

    
13
/**
14
 * Special implementation for the cdm which allows to also match
15
 * cdm types be their simple class name
16
 *
17
 *
18
 * @author a.kohlbecker
19
 * @since Jul 31, 2014
20
 *
21
 */
22
public class CdmSimpleNameTypeFilter extends AbstractTypeHierarchyTraversingFilter {
23

    
24

    
25
    private final String simpleName;
26

    
27
    /**
28
     * @param targetType
29
     */
30
    public CdmSimpleNameTypeFilter(String simpleName) {
31
        super(false, false);
32
        this.simpleName = simpleName;
33
    }
34

    
35
    @Override
36
    protected boolean matchClassName(String className) {
37
        return className.endsWith("." + simpleName);
38
    }
39

    
40
}
(3-3/10)