1
|
package eu.etaxonomy.cdm.remote.dto.oaipmh;
|
2
|
|
3
|
import javax.xml.bind.annotation.XmlEnum;
|
4
|
|
5
|
import eu.etaxonomy.cdm.model.agent.Institution;
|
6
|
import eu.etaxonomy.cdm.model.agent.Person;
|
7
|
import eu.etaxonomy.cdm.model.agent.Team;
|
8
|
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
|
9
|
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
|
10
|
import eu.etaxonomy.cdm.model.description.SpecimenDescription;
|
11
|
import eu.etaxonomy.cdm.model.description.TaxonDescription;
|
12
|
import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
|
13
|
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
14
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
15
|
import eu.etaxonomy.cdm.model.taxon.Synonym;
|
16
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
17
|
|
18
|
@XmlEnum
|
19
|
public enum SetSpec {
|
20
|
PERSON("person","People", Person.class,null),
|
21
|
TEAM("team","Teams of People", Team.class,null),
|
22
|
INSTITUTION("institution", "Institutions & Organisations", Institution.class,null),
|
23
|
TEAM_OR_PERSON("teamOrPerson", "Teams of individuals and individuals", TeamOrPersonBase.class,new SetSpec[]{TEAM,PERSON}),
|
24
|
TAXON("taxon","Accepted Taxon Concepts", Taxon.class,null),
|
25
|
SYNONYM("synonym","Synonyms", Synonym.class,null),
|
26
|
BACTERIAL_NAME("taxonName", "Scientific Taxon Names", TaxonNameBase.class,null),
|
27
|
// CULTIVAR_PLANT_NAME("cultivarPlantName","Scientific Names governed by the ICNCP",CultivarPlantName.class,null),
|
28
|
// BOTANICAL_NAME("botanicalName","Scientific Names governed by the ICBN",BotanicalName.class,new SetSpec[]{CULTIVAR_PLANT_NAME}),
|
29
|
// ZOOLOGICAL_NAME("zoologicalName","Scientific Names governed by the ICZN",ZoologicalName.class,null),
|
30
|
// NONVIRAL_NAME("nonviralName","Scientific Names governed by the ICNB, ICNCP, ICBN, or ICZN",NonViralName.class,new SetSpec[]{BACTERIAL_NAME,BOTANICAL_NAME,ZOOLOGICAL_NAME}),
|
31
|
// VIRAL_NAME("viralName","Scientific Names governed by the ICTV",ViralName.class,null),
|
32
|
TAXON_DESCRIPTION("taxonDescription","Descriptions of taxonomic concepts",TaxonDescription.class,null),
|
33
|
TAXON_NAME_DESCRIPTION("taxonNameDescription","Descriptions of scientific names",TaxonNameDescription.class,null),
|
34
|
SPECIMEN_DESCRIPTION("specimenDescription","Descriptions of specimens and occurrences",SpecimenDescription.class,null),
|
35
|
REFERENCE("reference","Any kind of Reference",Reference.class,null);
|
36
|
|
37
|
private String spec;
|
38
|
private String name;
|
39
|
private SetSpec[] innerSets;
|
40
|
private Class<? extends IdentifiableEntity> setClass;
|
41
|
|
42
|
private SetSpec(String spec, String name, Class<? extends IdentifiableEntity> setClass,SetSpec[] innerSets) {
|
43
|
this.setClass = setClass;
|
44
|
this.innerSets = innerSets;
|
45
|
this.spec = spec;
|
46
|
this.name = name;
|
47
|
}
|
48
|
|
49
|
public Class<? extends IdentifiableEntity> getSetClass() {
|
50
|
return setClass;
|
51
|
}
|
52
|
|
53
|
public SetSpec[] getInnerSets() {
|
54
|
return innerSets;
|
55
|
}
|
56
|
|
57
|
public String getName() {
|
58
|
return name;
|
59
|
}
|
60
|
|
61
|
public String getSpec() {
|
62
|
return spec;
|
63
|
}
|
64
|
|
65
|
public static SetSpec bySpec(String spec){
|
66
|
for(SetSpec setSpec : SetSpec.values()) {
|
67
|
if(setSpec.getSpec().equals(spec)) {
|
68
|
return setSpec;
|
69
|
}
|
70
|
}
|
71
|
return null;
|
72
|
}
|
73
|
}
|