Project

General

Profile

Download (2.67 KB) Statistics
| Branch: | Tag: | Revision:
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.description;
11

    
12

    
13
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
14
import eu.etaxonomy.cdm.model.common.Language;
15
import eu.etaxonomy.cdm.model.common.TermVocabulary;
16

    
17
import org.apache.log4j.Logger;
18
import org.hibernate.envers.Audited;
19

    
20
import javax.persistence.*;
21
import javax.xml.bind.annotation.XmlAccessType;
22
import javax.xml.bind.annotation.XmlAccessorType;
23
import javax.xml.bind.annotation.XmlRootElement;
24
import javax.xml.bind.annotation.XmlType;
25

    
26
/**
27
 * This class represents measurement units such as "centimeter" or "degree
28
 * Celsius".
29
 * 
30
 * @author m.doering
31
 * @version 1.0
32
 * @created 08-Nov-2007 13:06:34
33
 */
34
@XmlAccessorType(XmlAccessType.FIELD)
35
@XmlType(name = "MeasurementUnit")
36
@XmlRootElement(name = "MeasurementUnit")
37
@Entity
38
@Audited
39
public class MeasurementUnit extends DefinedTermBase<MeasurementUnit> {
40
	private static final long serialVersionUID = 4904519152652248312L;
41
	@SuppressWarnings("unused")
42
	private static final Logger logger = Logger.getLogger(MeasurementUnit.class);
43
	
44
	/** 
45
	 * Class constructor: creates a new empty measurement unit instance.
46
	 * 
47
	 * @see #MeasurementUnit(String, String, String)
48
	 */
49
	protected MeasurementUnit(){
50
		super();
51
	}
52

    
53
	/** 
54
	 * Creates a new measurement unit with a description
55
	 * (in the {@link Language#DEFAULT() default language}), a label and a label abbreviation.
56
	 * 
57
	 * @param	term  		 the string (in the default language) describing the
58
	 * 						 new measurement unit to be created 
59
	 * @param	label  		 the string identifying the new measurement unit
60
	 * 						 to be created
61
	 * @param	labelAbbrev  the string identifying (in abbreviated form) the
62
	 * 						 new measurement unit to be created
63
	 * @see 				 #NewInstance()
64
	 */
65
	public MeasurementUnit(String term, String label, String labelAbbrev) {
66
		super(term, label, labelAbbrev);
67
	}
68

    
69
	
70
	/** 
71
	 * Creates a new empty measurement unit instance.
72
	 * 
73
	 * @see #MeasurementUnit(String, String, String)
74
	 */
75
	public static MeasurementUnit NewInstance(){
76
		return new MeasurementUnit();
77
	}
78
	
79
	/** 
80
	 * Creates a new empty measurement unit instance.
81
	 * 
82
	 * @see #MeasurementUnit(String, String, String)
83
	 */
84
	public static MeasurementUnit NewInstance(String term, String label, String labelAbbrev){
85
		return new MeasurementUnit(term, label, labelAbbrev);
86
	}
87

    
88
	@Override
89
	protected void setDefaultTerms(TermVocabulary<MeasurementUnit> termVocabulary) {
90
		// TODO Auto-generated method stub
91
		
92
	}
93
}
(13-13/32)