Project

General

Profile

« Previous | Next » 

Revision 9691cba9

Added by Andreas Müller over 3 years ago

cleanup

View differences:

cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/dto/tdwg/voc/Relationship.java
1 1
/**
2 2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
3
* European Distributed Institute of Taxonomy
4 4
* http://www.e-taxonomy.eu
5
* 
5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
......
24 24
})
25 25
@XmlRootElement(name = "Relationship",namespace = "http://rs.tdwg.org/ontology/voc/TaxonConcept#")
26 26
public class Relationship extends BaseThing {
27
	
27

  
28 28
	@XmlElement(name = "fromTaxon", namespace = "http://rs.tdwg.org/ontology/voc/TaxonConcept#")
29 29
	private FromTaxon fromTaxon;
30
	
30

  
31 31
	@XmlElement(namespace = "http://rs.tdwg.org/ontology/voc/TaxonConcept#")
32 32
	private RelationshipCategory relationshipCategory;
33
	
33

  
34 34
	@XmlElement(name = "toTaxon", namespace = "http://rs.tdwg.org/ontology/voc/TaxonConcept#")
35 35
	private ToTaxon toTaxon;
36
	
36

  
37 37
	public TaxonConcept getFromTaxon() {
38 38
		return fromTaxon != null ? fromTaxon.getTaxonConcept() : null;
39 39
	}
......
49 49
	public void setRelationshipCategory(TaxonRelationshipTerm relationshipCategory) {
50 50
		this.relationshipCategory = new RelationshipCategory(relationshipCategory,false);
51 51
	}
52
	
52

  
53 53
	public TaxonRelationshipTerm getRelationshipCategoryRelation() {
54 54
		return relationshipCategory != null ? relationshipCategory.getTaxonRelationshipTerm() : null;
55 55
	}
......
71 71
        "taxonConcept"
72 72
    })
73 73
	public static class FromTaxon extends LinkType {
74
		
74

  
75 75
		@XmlElement(name = "TaxonConcept", namespace = "http://rs.tdwg.org/ontology/voc/TaxonConcept#")
76 76
		private TaxonConcept taxonConcept;
77 77

  
78 78
		protected FromTaxon() {}
79
		
79

  
80 80
		protected FromTaxon(TaxonConcept taxonConcept) {
81 81
	        if(taxonConcept != null && taxonConcept.getIdentifier() != null) {
82 82
			    //this.setResource(taxonConcept.getIdentifier());
83 83
	        	this.setTaxonConcept(taxonConcept);
84 84
	        }
85 85
		}
86
		
86

  
87 87
		protected TaxonConcept getTaxonConcept() {
88 88
			return taxonConcept;
89 89
		}
90 90

  
91 91
		protected void setTaxonConcept(TaxonConcept taxonConcept) {
92 92
			this.taxonConcept = taxonConcept;
93
		}		
93
		}
94 94
	}
95
	
95

  
96 96
	@XmlAccessorType(XmlAccessType.FIELD)
97 97
    @XmlType(name = "ToTaxon", propOrder = {
98 98
        "taxonConcept"
99 99
    })
100 100
	public static class ToTaxon extends LinkType {
101
		
101

  
102 102
		@XmlElement(name = "TaxonConcept", namespace = "http://rs.tdwg.org/ontology/voc/TaxonConcept#")
103 103
		private TaxonConcept taxonConcept;
104
		
104

  
105 105
		protected ToTaxon() {}
106
		
106

  
107 107
		protected ToTaxon(TaxonConcept taxonConcept) {
108 108
			    this.setTaxonConcept(taxonConcept);
109 109
		}
......
115 115
		protected void setTaxonConcept(TaxonConcept taxonConcept) {
116 116
			this.taxonConcept = taxonConcept;
117 117
		}
118
		
118

  
119 119
	}
120
	
120

  
121 121
	@XmlAccessorType(XmlAccessType.FIELD)
122 122
    @XmlType(name = "RelationshipCategory", propOrder = {
123 123
        "taxonRelationshipTerm"
124 124
    })
125 125
	public static class RelationshipCategory extends LinkType {
126
		
126

  
127 127
		@XmlElement(name = "TaxonRelationshipTerm", namespace = "http://rs.tdwg.org/ontology/voc/TaxonConcept#")
128 128
		private TaxonRelationshipTerm taxonRelationshipTerm;
129
		
129

  
130 130
		protected RelationshipCategory() {}
131
		
131

  
132 132
		protected RelationshipCategory(TaxonRelationshipTerm taxonRelationshipTerm, boolean useRelation) {
133 133
			if(useRelation) {
134 134
			    if(taxonRelationshipTerm != null) {
135
			    	if(taxonRelationshipTerm.getIdentifier() != null)
136
			    	this.setResource(taxonRelationshipTerm.getIdentifier());
135
			    	if(taxonRelationshipTerm.getIdentifier() != null) {
136
                        this.setResource(taxonRelationshipTerm.getIdentifier());
137
                    }
137 138
			    }  else {
138 139
			    	this.taxonRelationshipTerm = taxonRelationshipTerm;
139 140
			    }
......
153 154
		protected RelationshipCategory(TaxonRelationshipTerm taxonRelationshipTerm) {
154 155
			this.taxonRelationshipTerm = taxonRelationshipTerm;
155 156
		}
156
		
157

  
157 158
	}
158 159
}

Also available in: Unified diff