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
.io
.common
.mapping
;
12 import java
.util
.ArrayList
;
13 import java
.util
.HashSet
;
14 import java
.util
.List
;
17 import org
.apache
.log4j
.Logger
;
19 import eu
.etaxonomy
.cdm
.io
.common
.mapping
.CdmAttributeMapperBase
;
26 public abstract class CdmSingleAttributeMapperBase
extends CdmAttributeMapperBase
{
27 @SuppressWarnings("unused")
28 private static final Logger logger
= Logger
.getLogger(CdmSingleAttributeMapperBase
.class);
30 private String sourceValue
;
31 private String destinationValue
;
32 protected Object defaultValue
;
34 protected CdmSingleAttributeMapperBase(String sourceAttributString
, String destinationAttributeString
){
35 this(sourceAttributString
,destinationAttributeString
, null);
38 protected CdmSingleAttributeMapperBase(String sourceAttributString
, String destinationAttributeString
, Object defaultValue
){
39 this.sourceValue
= sourceAttributString
;
40 this.destinationValue
= destinationAttributeString
;
41 this.defaultValue
= defaultValue
;
45 public String
getSourceAttribute(){
49 public String
getDestinationAttribute(){
50 return destinationValue
;
54 public Set
<String
> getSourceAttributes(){
55 Set
<String
> result
= new HashSet
<String
>();
56 result
.add(sourceValue
);
61 public Set
<String
> getDestinationAttributes(){
62 Set
<String
> result
= new HashSet
<String
>();
63 if(destinationValue
!= null){
64 result
.add(destinationValue
);
71 public List
<String
> getSourceAttributeList(){
72 List
<String
> result
= new ArrayList
<String
>();
73 result
.add(sourceValue
);
78 public List
<String
> getDestinationAttributeList(){
79 List
<String
> result
= new ArrayList
<String
>();
80 if(destinationValue
!= null){
81 result
.add(destinationValue
);
86 public abstract Class
getTypeClass();