Project

General

Profile

Download (1.62 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.reference;
11

    
12
import eu.etaxonomy.cdm.model.common.TimePeriod;
13
import org.apache.log4j.Logger;
14

    
15
import javax.persistence.*;
16

    
17
/**
18
 * A year() method is required to get the year of publication out of the
19
 * datePublished field
20
 * @author m.doering
21
 * @version 1.0
22
 * @created 08-Nov-2007 13:06:54
23
 */
24
@Entity
25
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
26
public abstract class StrictReferenceBase extends ReferenceBase{
27
	static Logger logger = Logger.getLogger(StrictReferenceBase.class);
28
	//Title of the reference
29
	private String title;
30
	//The date range assigned to the reference. ISO Date range like. Flexible, year can be left out, etc
31
	private TimePeriod datePublished;
32
	
33

    
34
	public String getTitle(){
35
		return this.title;
36
	}
37
	public void setTitle(String title){
38
		this.title = title;
39
	}
40

    
41
	public TimePeriod getDatePublished(){
42
		return this.datePublished;
43
	}
44
	public void setDatePublished(TimePeriod datePublished){
45
		this.datePublished = datePublished;
46
	}
47

    
48
	/**
49
	 * returns a formatted string containing the entire reference citation including
50
	 * authors
51
	 */
52
	@Transient
53
	public String getCitation(){
54
		return "";
55
	}
56

    
57
	/**
58
	 * transform the datePublished into a string representation for a year
59
	 */
60
	@Transient
61
	public String getYear(){
62
		if (this.getDatePublished() == null){
63
			return null;
64
		}else{
65
			return getDatePublished().getYear();
66
		}
67
	}
68

    
69

    
70
}
(24-24/27)