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.List;
|
12
|
|
13
|
import eu.etaxonomy.cdm.model.name.ITaxonNameBase;
|
14
|
import eu.etaxonomy.cdm.model.name.TaxonName;
|
15
|
import eu.etaxonomy.cdm.strategy.cache.HTMLTagRules;
|
16
|
import eu.etaxonomy.cdm.strategy.cache.TagEnum;
|
17
|
import eu.etaxonomy.cdm.strategy.cache.TaggedText;
|
18
|
import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
|
19
|
|
20
|
/**
|
21
|
* A name cache rendering strategy for all TaxonName subclasses.
|
22
|
* Different TaxonName subclasses could have different strategies.
|
23
|
*
|
24
|
* @author a.mueller
|
25
|
*
|
26
|
* @param <T> The concrete TaxonName class this strategy applies for
|
27
|
*/
|
28
|
public interface INameCacheStrategy<T extends ITaxonNameBase> extends IIdentifiableEntityCacheStrategy<T> {
|
29
|
|
30
|
/**
|
31
|
* Returns a list of name typified tokens that together make up the name (including authorship etc.).
|
32
|
* A token (taggedText) is a string and a type which indicates which part of a name the text
|
33
|
* belongs to. Types may be name (indicating a core part of the name, e.g. a name epithet),
|
34
|
* author (indicating an authorship part), rank, reference, etc.).
|
35
|
* <BR>
|
36
|
* Example: ["Abies"/name,"alba"/name,Rank.SUBSPECIES/rank,"alpina"/name,
|
37
|
* "Greuther (L.)"/authorship]
|
38
|
*
|
39
|
* @param taxonName
|
40
|
* @return the tagged list, <code>null</code> if taxonName is <code>null</code>
|
41
|
*/
|
42
|
public List<TaggedText> getTaggedTitle(T taxonName);
|
43
|
|
44
|
/**
|
45
|
* Same as {@link #getTaggedTitle(TaxonName)} but also includes the reference and
|
46
|
* the nomenclatural status in the result.
|
47
|
* @param taxonName
|
48
|
* @return
|
49
|
*/
|
50
|
public List<TaggedText> getTaggedFullTitle(T taxonName);
|
51
|
|
52
|
|
53
|
/**
|
54
|
* Get {@link TaggedText} for the nomenclatural status part
|
55
|
* @param taxonName
|
56
|
* @param includeSeparatorBefore if a separator should be added before
|
57
|
* @param includePostSeparator if a {@link TagEnum#postSeparator post-separator}
|
58
|
* should be added after
|
59
|
* @return
|
60
|
*/
|
61
|
public List<TaggedText> getNomStatusTags(T taxonName, boolean includeSeparatorBefore,
|
62
|
boolean includePostSeparator);
|
63
|
|
64
|
/**
|
65
|
* Returns the full title cache as a string. The full title cache contains
|
66
|
* the name cache, followed by the nomencl. reference, followed by the
|
67
|
* nomencl. status
|
68
|
* @param taxonName
|
69
|
* @return
|
70
|
*/
|
71
|
public String getFullTitleCache(T taxonName);
|
72
|
|
73
|
/**
|
74
|
* Returns the full title cache tagged by html tags according to tag rules.
|
75
|
* @param nonViralName
|
76
|
* @param htmlTagRules
|
77
|
* @return
|
78
|
*/
|
79
|
public String getFullTitleCache(T nonViralName, HTMLTagRules htmlTagRules);
|
80
|
|
81
|
|
82
|
/**
|
83
|
* Returns the title cache tagged by html tags according to tag rules.
|
84
|
* @param nonViralName
|
85
|
* @param htmlTagRules
|
86
|
* @return
|
87
|
*/
|
88
|
public String getTitleCache(T nonViralName, HTMLTagRules htmlTagRules);
|
89
|
|
90
|
/**
|
91
|
* Returns the composed scientific taxon name string without authors nor year.
|
92
|
* For viral names this returns <code>null</code>. This may be discussed
|
93
|
* as for some functionality the nameCache is crucial and therefore
|
94
|
* we maybe prefer to return the titleCache instead.
|
95
|
*
|
96
|
* @param object
|
97
|
* @return
|
98
|
*/
|
99
|
public String getNameCache(T taxonName);
|
100
|
|
101
|
|
102
|
|
103
|
/**
|
104
|
* Same as {@link #getTaggedTitle(TaxonName)} but not including authorship.
|
105
|
* @param taxonName
|
106
|
* @return
|
107
|
*/
|
108
|
public List<TaggedText> getTaggedName(T taxonName);
|
109
|
|
110
|
/**
|
111
|
* Returns the composed author string. Returns null for viral names.
|
112
|
* @param object
|
113
|
* @return
|
114
|
*/
|
115
|
public String getAuthorshipCache(T nonViralName);
|
116
|
|
117
|
}
|