Project

General

Profile

Download (1.25 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2015 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.format.occurrences;
10

    
11
import eu.etaxonomy.cdm.model.media.Media;
12
import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
13

    
14
/**
15
 * @author pplitzner
16
 \* @since Nov 30, 2015
17
 *
18
 */
19
public class MediaSpecimenFormatter extends DerivedUnitFormatter {
20

    
21
    public MediaSpecimenFormatter(Object object, FormatKey[] formatKeys) {
22
        super(object, formatKeys);
23
    }
24

    
25
    @Override
26
    protected void initFormatKeys(Object object) {
27
        super.initFormatKeys(object);
28
        MediaSpecimen mediaSpecimen = (MediaSpecimen)object;
29
        Media media = mediaSpecimen.getMediaSpecimen();
30
        if(media!=null){
31
            if(media.getArtist()!=null){
32
                formatKeyMap.put(FormatKey.MEDIA_ARTIST, media.getArtist().toString());
33
            }
34
            if(media.getTitle()!=null){
35
                formatKeyMap.put(FormatKey.MEDIA_TITLE, media.getTitle().getText());
36
            }
37
            formatKeyMap.put(FormatKey.MEDIA_TITLE_CACHE, media.getTitleCache());
38
        }
39
    }
40

    
41
}
(6-6/9)