Project

General

Profile

Download (3.41 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.ITaxonNameBase;
14
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
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 TaxonNameBase subclasses.
22
 * Different TaxonNameBase 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 taxonNameBase
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(TaxonNameBase)} 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
     * Same as {@link #getTaggedTitle(TaxonNameBase)} but not including authorship.
54
     * @param taxonName
55
     * @return
56
     */
57
    public List<TaggedText> getTaggedName(T taxonName);
58

    
59

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

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

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

    
88

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

    
96

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

    
105
}
(4-4/9)