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
;
12 import java
.util
.ArrayList
;
13 import java
.util
.HashSet
;
14 import java
.util
.List
;
17 import org
.apache
.log4j
.Logger
;
25 public class CdmIoMapping
{
26 private static final Logger logger
= Logger
.getLogger(CdmIoMapping
.class);
28 List
<CdmIoMapperBase
> mapperList
= new ArrayList
<CdmIoMapperBase
>();
29 Set
<String
> sourceAttributes
= new HashSet
<String
>();
30 Set
<String
> destinationAttributes
= new HashSet
<String
>();
31 List
<String
> sourceAttributeList
= new ArrayList
<String
>();
32 List
<String
> destinationAttributeList
= new ArrayList
<String
>();
35 public void addMapper(CdmIoMapperBase mapper
){
36 mapperList
.add(mapper
);
37 sourceAttributes
.add(mapper
.getSourceAttribute());
38 sourceAttributeList
.add(mapper
.getSourceAttribute());
39 destinationAttributes
.add(mapper
.getDestinationAttribute());
40 destinationAttributeList
.add(mapper
.getDestinationAttribute());
43 public Set
<String
> getSourceAttributes(){
44 Set
<String
> result
= new HashSet
<String
>();
45 result
.addAll(sourceAttributes
);
49 public Set
<String
> getSourceAttributesLowerCase(){
50 Set
<String
> result
= new HashSet
<String
>();
51 for(String attr
: sourceAttributes
){
53 result
.add(attr
.toLowerCase());
61 public Set
<String
> getDestinationAttributes(){
62 Set
<String
> result
= new HashSet
<String
>();
63 result
.addAll(destinationAttributes
);