3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.store
.model
;
13 import org
.apache
.log4j
.Logger
;
15 import eu
.etaxonomy
.cdm
.model
.common
.ReferencedEntityBase
;
16 import eu
.etaxonomy
.cdm
.model
.reference
.Generic
;
17 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
24 public class ReferenceUtil
{
25 private static final Logger logger
= Logger
26 .getLogger(ReferenceUtil
.class);
29 * Returns the entity's citation. If none exists, gives the
30 * entity a Generic citation.
35 public static ReferenceBase
getOrCreateCitation(ReferencedEntityBase entity
) {
36 ReferenceBase citation
= entity
.getCitation();
37 if (citation
== null) {
38 citation
= Generic
.NewInstance();
39 entity
.setCitation(citation
);