Project

General

Profile

Revision 4f817727

ID4f8177279c7ef6e7b10efe9f8de0068062dd704d
Parent 6c8124b2
Child 816fdaa0

Added by Andreas Müller over 1 year ago

ref #8442 move AuthorityType to model.common

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/hibernate/EnumUserType.java
24 24
import org.hibernate.usertype.UserType;
25 25
import org.jadira.usertype.dateandtime.shared.spi.AbstractUserType;
26 26

  
27
import eu.etaxonomy.cdm.model.common.AuthorityType;
27 28
import eu.etaxonomy.cdm.model.media.ExternalLinkType;
28 29
import eu.etaxonomy.cdm.model.metadata.CdmMetaDataPropertyName;
29 30
import eu.etaxonomy.cdm.model.molecular.SequenceDirection;
......
34 35
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
35 36
import eu.etaxonomy.cdm.model.permission.CRUD;
36 37
import eu.etaxonomy.cdm.model.permission.PermissionClass;
37
import eu.etaxonomy.cdm.model.reference.AuthorityType;
38 38
import eu.etaxonomy.cdm.model.reference.OriginalSourceType;
39 39
import eu.etaxonomy.cdm.model.reference.ReferenceType;
40 40
import eu.etaxonomy.cdm.model.term.IKeyTerm;
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/AuthorityType.java
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.common;
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 type of authority for an externally loaded entity.
26
 *
27
 * @author a.mueller
28
 * @since 21.09.2017
29
 */
30
@XmlEnum
31
public enum AuthorityType implements IEnumTerm<AuthorityType>{
32

  
33
	/**
34
	 * The entity is managed externally.
35
	 */
36
	@XmlEnumValue("Extern")
37
	EXTERN(UUID.fromString("9a20f0ac-fe97-4b88-aa08-8d34a6d99359"), "Extern", "EXT", null),
38

  
39
	//0
40
	/**
41
	 * The entity has been imported from an external source but is now
42
	 * managed locally. However, the link to the external source is
43
	 * still important e.g. to compare the 2 versions.
44
	 */
45
	@XmlEnumValue("Local")
46
	LOCAL(UUID.fromString("47a38db6-b8b0-4fd5-8752-677408fba4f8"), "Local", "LOC", null),
47

  
48
	;
49

  
50
	@SuppressWarnings("unused")
51
	private static final Logger logger = Logger.getLogger(AuthorityType.class);
52

  
53

  
54
	private AuthorityType(UUID uuid, String defaultString, String key, AuthorityType parent){
55
		delegateVocTerm = EnumeratedTermVoc.addTerm(getClass(), this, uuid, defaultString, key, parent);
56
	}
57

  
58
// *************************** DELEGATE **************************************/
59

  
60
	private static EnumeratedTermVoc<AuthorityType> delegateVoc;
61
	private IEnumTerm<AuthorityType> delegateVocTerm;
62

  
63
	static {
64
		delegateVoc = EnumeratedTermVoc.getVoc(AuthorityType.class);
65
	}
66

  
67
	@Override
68
	public String getKey(){return delegateVocTerm.getKey();}
69

  
70
	@Override
71
    public String getMessage(){return delegateVocTerm.getMessage();}
72

  
73
	@Override
74
    public String getMessage(Language language){return delegateVocTerm.getMessage(language);}
75

  
76
	@Override
77
    public UUID getUuid() {return delegateVocTerm.getUuid();}
78

  
79
	@Override
80
    public AuthorityType getKindOf() {return delegateVocTerm.getKindOf();}
81

  
82
	@Override
83
    public Set<AuthorityType> getGeneralizationOf() {return delegateVocTerm.getGeneralizationOf();}
84

  
85
	@Override
86
	public boolean isKindOf(AuthorityType ancestor) {return delegateVocTerm.isKindOf(ancestor);	}
87

  
88
	@Override
89
    public Set<AuthorityType> getGeneralizationOf(boolean recursive) {return delegateVocTerm.getGeneralizationOf(recursive);}
90

  
91
	public static AuthorityType getByKey(String key){return delegateVoc.getByKey(key);}
92
    public static AuthorityType getByUuid(UUID uuid) {return delegateVoc.getByUuid(uuid);}
93

  
94

  
95
}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/AuthorityType.java
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.reference;
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.common.Language;
21
import eu.etaxonomy.cdm.model.term.EnumeratedTermVoc;
22
import eu.etaxonomy.cdm.model.term.IEnumTerm;
23

  
24

  
25
/**
26
 * The type of authority for an externally loaded entity.
27
 *
28
 * @author a.mueller
29
 * @since 21.09.2017
30
 */
31
@XmlEnum
32
public enum AuthorityType implements IEnumTerm<AuthorityType>{
33

  
34
	/**
35
	 * The entity is managed externally.
36
	 */
37
	@XmlEnumValue("Extern")
38
	EXTERN(UUID.fromString("9a20f0ac-fe97-4b88-aa08-8d34a6d99359"), "Extern", "EXT", null),
39

  
40
	//0
41
	/**
42
	 * The entity has been imported from an external source but is now
43
	 * managed locally. However, the link to the external source is
44
	 * still important e.g. to compare the 2 versions.
45
	 */
46
	@XmlEnumValue("Local")
47
	LOCAL(UUID.fromString("47a38db6-b8b0-4fd5-8752-677408fba4f8"), "Local", "LOC", null),
48

  
49
	;
50

  
51
	@SuppressWarnings("unused")
52
	private static final Logger logger = Logger.getLogger(AuthorityType.class);
53

  
54

  
55
	private AuthorityType(UUID uuid, String defaultString, String key, AuthorityType parent){
56
		delegateVocTerm = EnumeratedTermVoc.addTerm(getClass(), this, uuid, defaultString, key, parent);
57
	}
58

  
59
// *************************** DELEGATE **************************************/
60

  
61
	private static EnumeratedTermVoc<AuthorityType> delegateVoc;
62
	private IEnumTerm<AuthorityType> delegateVocTerm;
63

  
64
	static {
65
		delegateVoc = EnumeratedTermVoc.getVoc(AuthorityType.class);
66
	}
67

  
68
	@Override
69
	public String getKey(){return delegateVocTerm.getKey();}
70

  
71
	@Override
72
    public String getMessage(){return delegateVocTerm.getMessage();}
73

  
74
	@Override
75
    public String getMessage(Language language){return delegateVocTerm.getMessage(language);}
76

  
77
	@Override
78
    public UUID getUuid() {return delegateVocTerm.getUuid();}
79

  
80
	@Override
81
    public AuthorityType getKindOf() {return delegateVocTerm.getKindOf();}
82

  
83
	@Override
84
    public Set<AuthorityType> getGeneralizationOf() {return delegateVocTerm.getGeneralizationOf();}
85

  
86
	@Override
87
	public boolean isKindOf(AuthorityType ancestor) {return delegateVocTerm.isKindOf(ancestor);	}
88

  
89
	@Override
90
    public Set<AuthorityType> getGeneralizationOf(boolean recursive) {return delegateVocTerm.getGeneralizationOf(recursive);}
91

  
92
	public static AuthorityType getByKey(String key){return delegateVoc.getByKey(key);}
93
    public static AuthorityType getByUuid(UUID uuid) {return delegateVoc.getByUuid(uuid);}
94

  
95

  
96
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)