Project

General

Profile

Download (3.36 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.List;
12

    
13
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
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 TaxonNameBase subclasses.
21
 * Different TaxonNameBase 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<T extends TaxonNameBase> extends IIdentifiableEntityCacheStrategy<T> {
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 taxonNameBase
39
     * @return the tagged list, <code>null</code> if taxonName is <code>null</code>
40
     */
41
    public List<TaggedText> getTaggedTitle(T taxonName);
42

    
43
    /**
44
     * Same as {@link #getTaggedTitle(TaxonNameBase)} but also includes the reference and
45
     * the nomenclatural status in the result.
46
     * @param taxonName
47
     * @return
48
     */
49
    public List<TaggedText> getTaggedFullTitle(T taxonName);
50

    
51
    /**
52
     * Same as {@link #getTaggedTitle(TaxonNameBase)} but not including authorship.
53
     * @param taxonName
54
     * @return
55
     */
56
    public List<TaggedText> getTaggedName(T taxonName);
57

    
58

    
59
    /**
60
     * Get {@link TaggedText} for the nomenclatural status part
61
     * @param taxonName
62
     * @param includeSeparatorBefore if a separator should be added before
63
     * @param includePostSeparator if a {@link TagEnum#postSeparator post-separator}
64
     *  should be added after
65
     * @return
66
     */
67
    public List<TaggedText> getNomStatusTags(T taxonName, boolean includeSeparatorBefore,
68
            boolean includePostSeparator);
69

    
70
    /**
71
     * Returns the full title cache as a string. The full title cache contains
72
     * the name cache, followed by the nomencl. reference, followed by the
73
     * nomencl. status
74
     * @param taxonNameBase
75
     * @return
76
     */
77
    public String getFullTitleCache(T taxonNameBase);
78

    
79
	/**
80
	 * Returns the full title cache tagged by html tags according to tag rules.
81
	 * @param nonViralName
82
	 * @param htmlTagRules
83
	 * @return
84
	 */
85
	public String getFullTitleCache(T nonViralName, HTMLTagRules htmlTagRules);
86

    
87

    
88
    /**
89
     * Returns the name cache as a string.
90
     * @param taxonNameBase
91
     * @return
92
     */
93
    public String getNameCache(T taxonNameBase);
94

    
95

    
96
	/**
97
	 * Returns the title cache tagged by html tags according to tag rules.
98
	 * @param nonViralName
99
	 * @param htmlTagRules
100
	 * @return
101
	 */
102
	public String getTitleCache(T nonViralName, HTMLTagRules htmlTagRules);
103

    
104
}
(4-4/9)