Project

General

Profile

Download (1.8 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.cache.name;
11

    
12
import java.util.List;
13
import java.util.UUID;
14

    
15
import org.apache.log4j.Logger;
16

    
17
import eu.etaxonomy.cdm.model.name.INonViralName;
18
import eu.etaxonomy.cdm.model.name.Rank;
19
import eu.etaxonomy.cdm.model.name.TaxonName;
20
import eu.etaxonomy.cdm.strategy.cache.TagEnum;
21
import eu.etaxonomy.cdm.strategy.cache.TaggedText;
22

    
23
public class ZooNameNoMarkerCacheStrategy
24
                extends TaxonNameDefaultCacheStrategy {
25

    
26
    @SuppressWarnings("unused")
27
	private static final Logger logger = Logger.getLogger(ZooNameNoMarkerCacheStrategy.class);
28
	private static final long serialVersionUID = 2821727191810867550L;
29

    
30
	final static UUID uuid = UUID.fromString("8ffa5f04-0303-4875-be44-dac5ff95b874");
31
	@Override
32
	public UUID getUuid(){return uuid;}
33

    
34
	public static ZooNameNoMarkerCacheStrategy NewInstance(){
35
		return new ZooNameNoMarkerCacheStrategy();
36
	}
37

    
38
	private ZooNameNoMarkerCacheStrategy(){
39
		super();
40
	}
41

    
42
	@Override
43
    protected boolean includeInfraSpecificMarkerForZooNames(TaxonName name){
44
        boolean result = super.includeInfraSpecificMarkerForZooNames(name);
45
	    if (Rank.SUBSPECIES().equals(name.getRank())){
46
	        result = false;
47
	    }
48
        return result;
49
    }
50

    
51
	@Override
52
	protected void addInfraGenericPart(INonViralName name, List<TaggedText> tags, String infraGenericMarker,
53
	        String infraGenEpi) {
54
		//add epitheton
55
		if (isNotBlank(infraGenEpi)){
56
	        tags.add(new TaggedText(TagEnum.name, "(" + infraGenEpi + ")"));
57
        }
58
	}
59
}
(7-7/7)