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
|
|
10
|
package eu.etaxonomy.cdm.model.media;
|
11
|
|
12
|
import java.util.Set;
|
13
|
import java.util.UUID;
|
14
|
|
15
|
import javax.xml.bind.annotation.XmlEnum;
|
16
|
import javax.xml.bind.annotation.XmlEnumValue;
|
17
|
|
18
|
import org.apache.log4j.Logger;
|
19
|
|
20
|
import eu.etaxonomy.cdm.model.term.EnumeratedTermVoc;
|
21
|
import eu.etaxonomy.cdm.model.term.IEnumTerm;
|
22
|
|
23
|
|
24
|
/**
|
25
|
* The external link type is used to define the type of an {@link ExternalLink external link}.<BR>
|
26
|
*
|
27
|
* @author a.mueller
|
28
|
* @created 09.06.2017
|
29
|
*/
|
30
|
@XmlEnum
|
31
|
public enum ExternalLinkType implements IEnumTerm<ExternalLinkType>{
|
32
|
|
33
|
//0
|
34
|
/**
|
35
|
* Unknown link type is the type to be used if no information is available about the type.
|
36
|
*/
|
37
|
@XmlEnumValue("Unknown")
|
38
|
Unknown(UUID.fromString("270c0fa7-8c11-4a66-a0d7-deb6592e7f40"), "Unknown Link Type","UNK", null),
|
39
|
|
40
|
//1
|
41
|
/**
|
42
|
* Link type to represent a web site.
|
43
|
*/
|
44
|
@XmlEnumValue("WebSite")
|
45
|
WebSite(UUID.fromString("40f128af-b953-4943-af91-9b2f6b030546"), "WebSite", "WS", null),
|
46
|
|
47
|
//2
|
48
|
/**
|
49
|
* Link type to represent a file.
|
50
|
*/
|
51
|
@XmlEnumValue("File")
|
52
|
File(UUID.fromString("6e7ee084-d8a1-4813-b45a-218414c8795b"), "File", "FI", null),
|
53
|
|
54
|
;
|
55
|
|
56
|
// **************** END ENUM **********************/
|
57
|
|
58
|
@SuppressWarnings("unused")
|
59
|
private static final Logger logger = Logger.getLogger(ExternalLinkType.class);
|
60
|
|
61
|
private ExternalLinkType(UUID uuid, String defaultString, String key){
|
62
|
this(uuid, defaultString, key, null);
|
63
|
}
|
64
|
|
65
|
private ExternalLinkType(UUID uuid, String defaultString, String key, ExternalLinkType parent){
|
66
|
delegateVocTerm = EnumeratedTermVoc.addTerm(getClass(), this, uuid, defaultString, key, parent);
|
67
|
}
|
68
|
|
69
|
|
70
|
// *************************** DELEGATE **************************************/
|
71
|
|
72
|
private static EnumeratedTermVoc<ExternalLinkType> delegateVoc;
|
73
|
private IEnumTerm<ExternalLinkType> delegateVocTerm;
|
74
|
|
75
|
static {
|
76
|
delegateVoc = EnumeratedTermVoc.getVoc(ExternalLinkType.class);
|
77
|
}
|
78
|
|
79
|
@Override
|
80
|
public String getKey(){return delegateVocTerm.getKey();}
|
81
|
|
82
|
@Override
|
83
|
public String getMessage(){return delegateVocTerm.getMessage();}
|
84
|
|
85
|
@Override
|
86
|
public String getMessage(eu.etaxonomy.cdm.model.common.Language language){return delegateVocTerm.getMessage(language);}
|
87
|
|
88
|
@Override
|
89
|
public UUID getUuid() {return delegateVocTerm.getUuid();}
|
90
|
|
91
|
@Override
|
92
|
public ExternalLinkType getKindOf() {return delegateVocTerm.getKindOf();}
|
93
|
|
94
|
@Override
|
95
|
public Set<ExternalLinkType> getGeneralizationOf() {return delegateVocTerm.getGeneralizationOf();}
|
96
|
|
97
|
@Override
|
98
|
public boolean isKindOf(ExternalLinkType ancestor) {return delegateVocTerm.isKindOf(ancestor); }
|
99
|
|
100
|
@Override
|
101
|
public Set<ExternalLinkType> getGeneralizationOf(boolean recursive) {return delegateVocTerm.getGeneralizationOf(recursive);}
|
102
|
|
103
|
public static ExternalLinkType getByKey(String key){return delegateVoc.getByKey(key);}
|
104
|
public static ExternalLinkType getByUuid(UUID uuid) {return delegateVoc.getByUuid(uuid);}
|
105
|
|
106
|
|
107
|
|
108
|
}
|