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