Project

General

Profile

« Previous | Next » 

Revision 731fe9ff

Added by Andreas Müller over 12 years ago

Cleaning up name cache strategies and updating javadoc

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/name/ZooNameDefaultCacheStrategy.java
9 9

  
10 10
package eu.etaxonomy.cdm.strategy.cache.name;
11 11

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

  
14 15
import org.apache.log4j.Logger;
......
17 18
import eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor;
18 19
import eu.etaxonomy.cdm.model.name.NonViralName;
19 20
import eu.etaxonomy.cdm.model.name.ZoologicalName;
21
import eu.etaxonomy.cdm.strategy.TaggedText;
20 22

  
21 23
public class ZooNameDefaultCacheStrategy <T extends ZoologicalName> extends NonViralNameDefaultCacheStrategy<T> implements  INonViralNameCacheStrategy<T> {
22 24
	@SuppressWarnings("unused")
......
47 49
		super();
48 50
	}
49 51

  
50
	
51 52

  
53

  
54
	/**
55
	 * @return Strings that separates the author part and the year part
56
	 * @return
57
	 */
58
	public String getAuthorYearSeperator() {
59
		return AuthorYearSeperator;
60
	}
61

  
62

  
63
	public void setAuthorYearSeperator(String authorYearSeperator) {
64
		AuthorYearSeperator = authorYearSeperator;
65
	}
66
	
52 67
	/* (non-Javadoc)
53 68
	 * @see eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy#getNonCacheAuthorshipCache(eu.etaxonomy.cdm.model.name.NonViralName)
54 69
	 */
......
71 86
		if (basionymAuthor != null || exBasionymAuthor != null || originalPublicationYear != null ){
72 87
			String authorAndEx = getAuthorAndExAuthor(basionymAuthor, exBasionymAuthor);
73 88
			String originalPublicationYearString = originalPublicationYear == null ? null : String.valueOf(originalPublicationYear);
74
			String authorAndExAndYear = CdmUtils.concat(", ", authorAndEx, originalPublicationYearString );
89
			String authorAndExAndYear = CdmUtils.concat(AuthorYearSeperator, authorAndEx, originalPublicationYearString );
75 90
			basionymPart = BasionymStart + authorAndExAndYear +BasionymEnd;
76 91
		}
77 92
		if (combinationAuthor != null || exCombinationAuthor != null){
78 93
			String authorAndEx = getAuthorAndExAuthor(combinationAuthor, exCombinationAuthor);
79 94
			String publicationYearString = publicationYear == null ? null : String.valueOf(publicationYear);
80
			authorPart = CdmUtils.concat(", ", authorAndEx, publicationYearString);
95
			authorPart = CdmUtils.concat(AuthorYearSeperator, authorAndEx, publicationYearString);
81 96
		}
82 97
		result = CdmUtils.concat(BasionymAuthorCombinationAuthorSeperator, basionymPart, authorPart);
83 98
		return result;
84 99
	}
85 100
	
86 101

  
87
	/**
88
	 * @return Strings that separates the author part and the year part
89
	 * @return
90
	 */
91
	public String getAuthorYearSeperator() {
92
		return AuthorYearSeperator;
93
	}
94

  
95

  
96
	public void setAuthorYearSeperator(String authorYearSeperator) {
97
		AuthorYearSeperator = authorYearSeperator;
98
	}
99
	
100
	protected String getInfraSpeciesNameCache(NonViralName nonViralName){
102
	@Override
103
	protected List<TaggedText> getInfraSpeciesTaggedNameCache(NonViralName nonViralName){
101 104
		boolean includeMarker = ! (nonViralName.isAutonym());
102
		return getInfraSpeciesNameCache(nonViralName, includeMarker);
105
		return getInfraSpeciesTaggedNameCache(nonViralName, includeMarker);
103 106
	}
104 107

  
105 108
}

Also available in: Unified diff