2 * Copyright (C) 2009 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
.strategy
;
12 import java
.io
.Serializable
;
13 import java
.lang
.annotation
.Annotation
;
14 import java
.lang
.reflect
.Field
;
15 import java
.lang
.reflect
.Modifier
;
16 import java
.util
.Collection
;
17 import java
.util
.HashMap
;
19 import java
.util
.UUID
;
21 import javax
.persistence
.Transient
;
23 import org
.apache
.log4j
.Logger
;
24 import org
.joda
.time
.DateTime
;
26 import eu
.etaxonomy
.cdm
.model
.agent
.Contact
;
27 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
28 import eu
.etaxonomy
.cdm
.model
.common
.LSID
;
29 import eu
.etaxonomy
.cdm
.model
.common
.TimePeriod
;
32 public abstract class StrategyBase
implements IStrategy
, Serializable
{
33 private static final long serialVersionUID
= -274791080847215663L;
34 @SuppressWarnings("unused")
35 private static final Logger logger
= Logger
.getLogger(StrategyBase
.class);
37 final static UUID uuid
= UUID
.fromString("2ff2b1d6-17a6-4807-a55f-f6b45bf429b7");
39 abstract protected UUID
getUuid();
41 protected StrategyBase(){
51 protected static boolean isCollection(Class
<?
> fieldType
) {
52 if (Collection
.class.isAssignableFrom(fieldType
) ){
63 protected boolean isPrimitive(Class
<?
> fieldType
) {
64 if (fieldType
.isPrimitive()){
75 protected boolean isSingleCdmBaseObject(Class
<?
> fieldType
) {
76 if (CdmBase
.class.isAssignableFrom(fieldType
)){
87 protected boolean isUserType(Class
<?
> fieldType
) {
88 if ( fieldType
== TimePeriod
.class ||
89 fieldType
== DateTime
.class ||
90 fieldType
== LSID
.class ||
91 fieldType
== Contact
.class