Project

General

Profile

Download (2.11 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
package eu.etaxonomy.cdm.strategy.cache.name;
10

    
11
import java.util.UUID;
12

    
13
import org.apache.log4j.Logger;
14

    
15
import eu.etaxonomy.cdm.common.CdmUtils;
16
import eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor;
17
import eu.etaxonomy.cdm.model.name.IBotanicalName;
18

    
19
/**
20
 * T
21
 * @author a.mueller
22
 *
23
 */
24
public class BotanicNameDefaultCacheStrategy<T extends IBotanicalName>
25
            extends NonViralNameDefaultCacheStrategy<T>
26
            implements  INonViralNameCacheStrategy<T> {
27

    
28
    @SuppressWarnings("unused")
29
	private static final Logger logger = Logger.getLogger(BotanicNameDefaultCacheStrategy.class);
30
	private static final long serialVersionUID = 2679554971446197111L;
31

    
32
	final static UUID uuid = UUID.fromString("1cdda0d1-d5bc-480f-bf08-40a510a2f223");
33

    
34
	@Override
35
	public  UUID getUuid(){
36
		return uuid;
37
	}
38

    
39

    
40
	public static BotanicNameDefaultCacheStrategy NewInstance(){
41
		return new BotanicNameDefaultCacheStrategy();
42
	}
43

    
44
	/**
45
	 * Returns the AuthorCache part for a combination of an author and an ex author. This applies on combination authors
46
	 * as well as on basionym/orginal combination authors.
47
	 * The correct order is exAuthor ex author though some botanist do not know about and do it the
48
	 * other way round. (see 46.4-46.6 ICBN (Vienna Code, 2006))
49
	 * @param author the author
50
	 * @param exAuthor the ex-author
51
	 * @return
52
	 */
53
	@Override
54
	protected String getAuthorAndExAuthor(INomenclaturalAuthor author, INomenclaturalAuthor exAuthor){
55
		String result = "";
56
		String authorString = "";
57
		String exAuthorString = "";
58

    
59
		if (author != null){
60
			authorString = CdmUtils.Nz(author.getNomenclaturalTitle());
61
		}
62
		if (exAuthor != null){
63
			exAuthorString = CdmUtils.Nz(exAuthor.getNomenclaturalTitle());
64
			exAuthorString += ExAuthorSeperator;
65
		}
66

    
67
		result = exAuthorString + authorString;
68
		return result;
69

    
70
	}
71

    
72
}
(2-2/9)