src/core/net/sf/basedb/util/overview/validator/NodeValidatorFactory.java

Code
Comments
Other
Rev Date Author Line
4740 05 Feb 09 nicklas 1 /**
4740 05 Feb 09 nicklas 2   $Id$
4740 05 Feb 09 nicklas 3
4740 05 Feb 09 nicklas 4   Copyright (C) 2008 Nicklas Nordborg
4740 05 Feb 09 nicklas 5
4740 05 Feb 09 nicklas 6   This file is part of BASE - BioArray Software Environment.
4740 05 Feb 09 nicklas 7   Available at http://base.thep.lu.se/
4740 05 Feb 09 nicklas 8
4740 05 Feb 09 nicklas 9   BASE is free software; you can redistribute it and/or
4740 05 Feb 09 nicklas 10   modify it under the terms of the GNU General Public License
4740 05 Feb 09 nicklas 11   as published by the Free Software Foundation; either version 3
4740 05 Feb 09 nicklas 12   of the License, or (at your option) any later version.
4740 05 Feb 09 nicklas 13
4740 05 Feb 09 nicklas 14   BASE is distributed in the hope that it will be useful,
4740 05 Feb 09 nicklas 15   but WITHOUT ANY WARRANTY; without even the implied warranty of
4740 05 Feb 09 nicklas 16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4740 05 Feb 09 nicklas 17   GNU General Public License for more details.
4740 05 Feb 09 nicklas 18
4740 05 Feb 09 nicklas 19   You should have received a copy of the GNU General Public License
4740 05 Feb 09 nicklas 20   along with BASE. If not, see <http://www.gnu.org/licenses/>.
4740 05 Feb 09 nicklas 21 */
4740 05 Feb 09 nicklas 22 package net.sf.basedb.util.overview.validator;
4740 05 Feb 09 nicklas 23
4740 05 Feb 09 nicklas 24 import net.sf.basedb.core.BaseException;
4740 05 Feb 09 nicklas 25 import net.sf.basedb.core.ItemNotFoundException;
4740 05 Feb 09 nicklas 26
4740 05 Feb 09 nicklas 27 /**
4740 05 Feb 09 nicklas 28   A node validator factory is a class that know how to
4740 05 Feb 09 nicklas 29   create {@link NodeValidator}:s for a given key domain.
4740 05 Feb 09 nicklas 30
4740 05 Feb 09 nicklas 31   @author Nicklas
4740 05 Feb 09 nicklas 32   @version 2.10
4740 05 Feb 09 nicklas 33   @base.modified $Date$
4740 05 Feb 09 nicklas 34 */
4740 05 Feb 09 nicklas 35 public interface NodeValidatorFactory<L, K>
4740 05 Feb 09 nicklas 36 {
4740 05 Feb 09 nicklas 37
4740 05 Feb 09 nicklas 38   /**
4864 30 Mar 09 nicklas 39     Disable/enabled node validation programmatically. When a 
4864 30 Mar 09 nicklas 40     node validator factory is disabled the {@link #createNodeValidator(Object)}
4864 30 Mar 09 nicklas 41     should return null or a {@link NullNodeValidator} for all
4864 30 Mar 09 nicklas 42     requests.
4864 30 Mar 09 nicklas 43     @param disabled TRUE to disable node validation
4864 30 Mar 09 nicklas 44     @since 2.11
4864 30 Mar 09 nicklas 45   */
4864 30 Mar 09 nicklas 46   public void setDisabled(boolean disabled);
4864 30 Mar 09 nicklas 47   
4864 30 Mar 09 nicklas 48   /**
4864 30 Mar 09 nicklas 49     Check if node validation has been disabled.
4864 30 Mar 09 nicklas 50     @return TRUE if validation has been disabled
4864 30 Mar 09 nicklas 51     @since 2.11
4864 30 Mar 09 nicklas 52   */
4864 30 Mar 09 nicklas 53   public boolean isDisabled();
4864 30 Mar 09 nicklas 54   
4864 30 Mar 09 nicklas 55   /**
4740 05 Feb 09 nicklas 56     Create a node validator that knows how to validate nodes for items
4740 05 Feb 09 nicklas 57     that are specified by the given key. The key can be almost anything.
4740 05 Feb 09 nicklas 58     The interpretation of it is entirely up to the factory implementation.
4740 05 Feb 09 nicklas 59     
4740 05 Feb 09 nicklas 60     @param key A key that can be used to identify which items the node
4740 05 Feb 09 nicklas 61       validator should handle
4740 05 Feb 09 nicklas 62     @return A node validator object, or null if no validator exists
4740 05 Feb 09 nicklas 63     @throws ItemNotFoundException If a node loader for the given key 
4740 05 Feb 09 nicklas 64       can't be found. NOTE! Instead of throwing an exception it is possible
4740 05 Feb 09 nicklas 65       to simply return null or a {@link NullNodeValidator} or any other 
4740 05 Feb 09 nicklas 66       "generic" implementation.
4740 05 Feb 09 nicklas 67     @throws BaseException If there is any other problem creating the
4740 05 Feb 09 nicklas 68       node validator
4740 05 Feb 09 nicklas 69   */
4740 05 Feb 09 nicklas 70   public NodeValidator<? extends L> createNodeValidator(K key);
4740 05 Feb 09 nicklas 71
4740 05 Feb 09 nicklas 72 }