6774 |
17 Mar 15 |
nicklas |
1 |
/** |
6774 |
17 Mar 15 |
nicklas |
$Id$ |
6774 |
17 Mar 15 |
nicklas |
3 |
|
6774 |
17 Mar 15 |
nicklas |
Copyright (C) 2015 Nicklas Nordborg |
6774 |
17 Mar 15 |
nicklas |
5 |
|
6774 |
17 Mar 15 |
nicklas |
This file is part of BASE - BioArray Software Environment. |
6774 |
17 Mar 15 |
nicklas |
Available at http://base.thep.lu.se/ |
6774 |
17 Mar 15 |
nicklas |
8 |
|
6774 |
17 Mar 15 |
nicklas |
BASE is free software; you can redistribute it and/or |
6774 |
17 Mar 15 |
nicklas |
modify it under the terms of the GNU General Public License |
6774 |
17 Mar 15 |
nicklas |
as published by the Free Software Foundation; either version 3 |
6774 |
17 Mar 15 |
nicklas |
of the License, or (at your option) any later version. |
6774 |
17 Mar 15 |
nicklas |
13 |
|
6774 |
17 Mar 15 |
nicklas |
BASE is distributed in the hope that it will be useful, |
6774 |
17 Mar 15 |
nicklas |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
6774 |
17 Mar 15 |
nicklas |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
6774 |
17 Mar 15 |
nicklas |
GNU General Public License for more details. |
6774 |
17 Mar 15 |
nicklas |
18 |
|
6774 |
17 Mar 15 |
nicklas |
You should have received a copy of the GNU General Public License |
6774 |
17 Mar 15 |
nicklas |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
6774 |
17 Mar 15 |
nicklas |
21 |
*/ |
6774 |
17 Mar 15 |
nicklas |
22 |
package net.sf.basedb.util.listable; |
6774 |
17 Mar 15 |
nicklas |
23 |
|
6774 |
17 Mar 15 |
nicklas |
24 |
import java.util.List; |
6774 |
17 Mar 15 |
nicklas |
25 |
|
6774 |
17 Mar 15 |
nicklas |
26 |
import net.sf.basedb.core.Item; |
6880 |
21 Apr 15 |
nicklas |
27 |
import net.sf.basedb.core.SyncFilter; |
6774 |
17 Mar 15 |
nicklas |
28 |
|
6774 |
17 Mar 15 |
nicklas |
29 |
/** |
6774 |
17 Mar 15 |
nicklas |
A source item transformer factory is responsible for creating |
6774 |
17 Mar 15 |
nicklas |
{@link SourceItemTransformer}:s that can transform between |
6880 |
21 Apr 15 |
nicklas |
the supported {@link #getSupportedSourceItems(SyncFilter.SourceItemTransform)} |
6774 |
17 Mar 15 |
nicklas |
to the specified {@link #getTargetItem()}. |
6774 |
17 Mar 15 |
nicklas |
34 |
|
6774 |
17 Mar 15 |
nicklas |
@author Nicklas |
6774 |
17 Mar 15 |
nicklas |
@since 3.5 |
6774 |
17 Mar 15 |
nicklas |
37 |
*/ |
6774 |
17 Mar 15 |
nicklas |
38 |
public interface SourceItemTransformerFactory |
6774 |
17 Mar 15 |
nicklas |
39 |
{ |
6774 |
17 Mar 15 |
nicklas |
40 |
|
6774 |
17 Mar 15 |
nicklas |
41 |
/** |
6774 |
17 Mar 15 |
nicklas |
Get the target item type of this transformer factory. All transformers |
6774 |
17 Mar 15 |
nicklas |
created by this factory are expected to have a matching |
6774 |
17 Mar 15 |
nicklas |
{@link SourceItemTransformer#getTargetItemType()}. |
6774 |
17 Mar 15 |
nicklas |
45 |
*/ |
6774 |
17 Mar 15 |
nicklas |
46 |
public Item getTargetItem(); |
6774 |
17 Mar 15 |
nicklas |
47 |
|
6774 |
17 Mar 15 |
nicklas |
48 |
/** |
6774 |
17 Mar 15 |
nicklas |
Get the supported source item types when transforming in the specified |
6880 |
21 Apr 15 |
nicklas |
direction. The {@link #create(Item, SyncFilter.SourceItemTransform)} method should |
6774 |
17 Mar 15 |
nicklas |
be able to create a {@link SourceItemTransformer} for all of the item types |
6774 |
17 Mar 15 |
nicklas |
returned by this method. |
6774 |
17 Mar 15 |
nicklas |
53 |
*/ |
6880 |
21 Apr 15 |
nicklas |
54 |
public List<Item> getSupportedSourceItems(SyncFilter.SourceItemTransform transform); |
6774 |
17 Mar 15 |
nicklas |
55 |
|
6774 |
17 Mar 15 |
nicklas |
56 |
/** |
6774 |
17 Mar 15 |
nicklas |
Create a source item transformed that can transform between the given |
6774 |
17 Mar 15 |
nicklas |
source item and the {@link #getTargetItem()}. Calling this method |
6774 |
17 Mar 15 |
nicklas |
with an unsupported combination should result in a null return value. |
6774 |
17 Mar 15 |
nicklas |
60 |
*/ |
6880 |
21 Apr 15 |
nicklas |
61 |
public SourceItemTransformer create(Item sourceItemType, SyncFilter.SourceItemTransform transform); |
6774 |
17 Mar 15 |
nicklas |
62 |
|
6774 |
17 Mar 15 |
nicklas |
63 |
} |