src/core/net/sf/basedb/util/listable/SourceItemTransformerFactory.java

Code
Comments
Other
Rev Date Author Line
6774 17 Mar 15 nicklas 1 /**
6774 17 Mar 15 nicklas 2   $Id$
6774 17 Mar 15 nicklas 3
6774 17 Mar 15 nicklas 4   Copyright (C) 2015 Nicklas Nordborg
6774 17 Mar 15 nicklas 5
6774 17 Mar 15 nicklas 6   This file is part of BASE - BioArray Software Environment.
6774 17 Mar 15 nicklas 7   Available at http://base.thep.lu.se/
6774 17 Mar 15 nicklas 8
6774 17 Mar 15 nicklas 9   BASE is free software; you can redistribute it and/or
6774 17 Mar 15 nicklas 10   modify it under the terms of the GNU General Public License
6774 17 Mar 15 nicklas 11   as published by the Free Software Foundation; either version 3
6774 17 Mar 15 nicklas 12   of the License, or (at your option) any later version.
6774 17 Mar 15 nicklas 13
6774 17 Mar 15 nicklas 14   BASE is distributed in the hope that it will be useful,
6774 17 Mar 15 nicklas 15   but WITHOUT ANY WARRANTY; without even the implied warranty of
6774 17 Mar 15 nicklas 16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
6774 17 Mar 15 nicklas 17   GNU General Public License for more details.
6774 17 Mar 15 nicklas 18
6774 17 Mar 15 nicklas 19   You should have received a copy of the GNU General Public License
6774 17 Mar 15 nicklas 20   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 30   A source item transformer factory is responsible for creating
6774 17 Mar 15 nicklas 31   {@link SourceItemTransformer}:s that can transform between
6880 21 Apr 15 nicklas 32   the supported {@link #getSupportedSourceItems(SyncFilter.SourceItemTransform)}
6774 17 Mar 15 nicklas 33   to the specified {@link #getTargetItem()}.
6774 17 Mar 15 nicklas 34   
6774 17 Mar 15 nicklas 35   @author Nicklas
6774 17 Mar 15 nicklas 36   @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 42     Get the target item type of this transformer factory. All transformers
6774 17 Mar 15 nicklas 43     created by this factory are expected to have a matching
6774 17 Mar 15 nicklas 44     {@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 49     Get the supported source item types when transforming in the specified
6880 21 Apr 15 nicklas 50     direction. The {@link #create(Item, SyncFilter.SourceItemTransform)} method should
6774 17 Mar 15 nicklas 51     be able to create a {@link SourceItemTransformer} for all of the item types
6774 17 Mar 15 nicklas 52     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 57     Create a source item transformed that can transform between the given 
6774 17 Mar 15 nicklas 58     source item and the {@link #getTargetItem()}. Calling this method
6774 17 Mar 15 nicklas 59     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 }