2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.model
.reference
;
13 import javax
.persistence
.Entity
;
14 import javax
.persistence
.Transient
;
15 import javax
.xml
.bind
.annotation
.XmlAccessType
;
16 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
17 import javax
.xml
.bind
.annotation
.XmlElement
;
18 import javax
.xml
.bind
.annotation
.XmlType
;
20 import org
.apache
.log4j
.Logger
;
22 import eu
.etaxonomy
.cdm
.model
.agent
.TeamOrPersonBase
;
23 import eu
.etaxonomy
.cdm
.strategy
.cache
.reference
.BookDefaultCacheStrategy
;
26 * This class represents books. A book is a {@link PrintedUnitBase printed unit} usually
27 * published by a publishing company.
29 * This class corresponds, according to the TDWG ontology, to the publication type
30 * terms (from PublicationTypeTerm): <ul>
37 * @created 08-Nov-2007 13:06:13
39 @XmlAccessorType(XmlAccessType
.FIELD
)
40 @XmlType(name
= "Book", propOrder
= {
46 public class Book
extends PrintedUnitBase
implements INomenclaturalReference
, Cloneable
{
48 private static final Logger logger
= Logger
.getLogger(Book
.class);
50 @XmlElement(name
= "Edition")
51 private String edition
;
53 @XmlElement(name
= "ISBN")
56 @XmlElement(name
= "NomRefBase")
57 private NomenclaturalReferenceHelper nomRefBase
= NomenclaturalReferenceHelper
.NewInstance(this);
62 * Class constructor: creates a new empty book instance
63 * only containing the {@link strategy.cache.reference.BookDefaultCacheStrategy default cache strategy}.
65 * @see strategy.cache.reference.BookDefaultCacheStrategy
69 this.cacheStrategy
= BookDefaultCacheStrategy
.NewInstance();
73 * Creates a new empty book instance
74 * only containing the {@link strategy.cache.reference.BookDefaultCacheStrategy default cache strategy}.
77 * @see strategy.cache.reference.BookDefaultCacheStrategy
79 public static Book
NewInstance(){
85 * Returns the string representing the edition of <i>this</i> book. A book which
86 * is published once more after having been editorially revised or updated
87 * corresponds to another superior edition as the book the content of which
88 * had to be revised or updated (previous edition). Different book editions
89 * have almost the same content but may differ in layout. Editions are
90 * therefore essential for accurate citations.
92 * @return the string identifying the edition
94 public String
getEdition(){
100 public void setEdition(String edition
){
101 this.edition
= edition
;
105 * Returns the string representing the ISBN (International Standard Book
106 * Number, a unique numerical commercial book identifier, based upon the
107 * 9-digit Standard Book Numbering code) of <i>this</i> book.
109 * @return the string representing the ISBN
111 public String
getIsbn(){
117 public void setIsbn(String isbn
){
123 * Returns a formatted string containing the entire reference citation,
124 * including authors, title, edition, volume, series, corresponding to
125 * <i>this</i> book.<BR>
126 * This method overrides the generic and inherited
127 * StrictReferenceBase#getCitation() method.
129 * @see NomenclaturalReferenceHelper#getCitation()
130 * @see StrictReferenceBase#getCitation()
133 public String
getCitation(){
134 return nomRefBase
.getCitation();
138 * Returns a formatted string containing the entire citation used for
139 * nomenclatural purposes based on <i>this</i> book - including
140 * (abbreviated) title but not authors - and on the given
143 * @param microReference the string with the details (generally pages)
144 * within <i>this</i> book
145 * @return the formatted string representing the
146 * nomenclatural citation
147 * @see NomenclaturalReferenceHelper#getNomenclaturalCitation(String)
148 * @see INomenclaturalReference#getNomenclaturalCitation(String)
151 public String
getNomenclaturalCitation(String microReference
) {
152 return nomRefBase
.getNomenclaturalCitation(microReference
);
157 * Generates, according to the {@link strategy.cache.reference.BookDefaultCacheStrategy default cache strategy}
158 * assigned to <i>this</i> book, a string that identifies <i>this</i>
159 * book and returns it. This string may be stored in the inherited
160 * {@link common.IdentifiableEntity#getTitleCache() titleCache} attribute.<BR>
161 * This method overrides the generic and inherited
162 * ReferenceBase#generateTitle() method.
164 * @return the string identifying <i>this</i> book
165 * @see #getCitation()
166 * @see NomenclaturalReferenceHelper#generateTitle()
167 * @see common.IdentifiableEntity#getTitleCache()
168 * @see common.IdentifiableEntity#generateTitle()
171 public String
generateTitle(){
172 return nomRefBase
.generateTitle();
176 //*********** CLONE **********************************/
179 * Clones <i>this</i> book. This is a shortcut that enables to
180 * create a new instance that differs only slightly from <i>this</i> book
181 * by modifying only some of the attributes.<BR>
182 * This method overrides the {@link StrictReferenceBase#clone() method} from StrictReferenceBase.
184 * @see StrictReferenceBase#clone()
185 * @see media.IdentifyableMediaEntity#clone()
186 * @see java.lang.Object#clone()
189 Book result
= (Book
)super.clone();
190 //no changes to: edition, isbn