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 eu
.etaxonomy
.cdm
.model
.common
.ReferencedEntityBase
;
14 import eu
.etaxonomy
.cdm
.model
.reference
.Generic
;
15 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
22 public class ReferenceUtil
{
24 * Returns the entity's citation. If none exists, gives the
25 * entity a Generic citation.
30 public static ReferenceBase
<?
> getOrCreateCitation(ReferencedEntityBase entity
) {
31 ReferenceBase
<?
> citation
= entity
.getCitation();
32 if (citation
== null) {
33 citation
= Generic
.NewInstance();
34 entity
.setCitation(citation
);