src/core/net/sf/basedb/util/extensions/xml/PluginDefinitionFilter.java

Code
Comments
Other
Rev Date Author Line
5617 28 Apr 11 nicklas 1 /**
5617 28 Apr 11 nicklas 2   $Id: ExtensionPointFilter.java 5598 2011-03-30 09:44:57Z nicklas $
5617 28 Apr 11 nicklas 3
5617 28 Apr 11 nicklas 4   Copyright (C) 2011 Nicklas Nordborg
5617 28 Apr 11 nicklas 5
5617 28 Apr 11 nicklas 6   This file is part of BASE - BioArray Software Environment.
5617 28 Apr 11 nicklas 7   Available at http://base.thep.lu.se/
5617 28 Apr 11 nicklas 8
5617 28 Apr 11 nicklas 9   BASE is free software; you can redistribute it and/or
5617 28 Apr 11 nicklas 10   modify it under the terms of the GNU General Public License
5617 28 Apr 11 nicklas 11   as published by the Free Software Foundation; either version 3
5617 28 Apr 11 nicklas 12   of the License, or (at your option) any later version.
5617 28 Apr 11 nicklas 13
5617 28 Apr 11 nicklas 14   BASE is distributed in the hope that it will be useful,
5617 28 Apr 11 nicklas 15   but WITHOUT ANY WARRANTY; without even the implied warranty of
5617 28 Apr 11 nicklas 16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5617 28 Apr 11 nicklas 17   GNU General Public License for more details.
5617 28 Apr 11 nicklas 18
5617 28 Apr 11 nicklas 19   You should have received a copy of the GNU General Public License
5617 28 Apr 11 nicklas 20   along with BASE. If not, see <http://www.gnu.org/licenses/>.
5617 28 Apr 11 nicklas 21 */
5617 28 Apr 11 nicklas 22 package net.sf.basedb.util.extensions.xml;
5617 28 Apr 11 nicklas 23
6473 11 Jun 14 nicklas 24 import org.jdom2.Element;
5617 28 Apr 11 nicklas 25
5617 28 Apr 11 nicklas 26 import net.sf.basedb.util.filter.Filter;
5617 28 Apr 11 nicklas 27
5617 28 Apr 11 nicklas 28 /**
5617 28 Apr 11 nicklas 29   Filter implementation that only matches tags for plug-in definitions.
5617 28 Apr 11 nicklas 30   This filter is useful if the parser is not interested in extensions.
5617 28 Apr 11 nicklas 31   
5617 28 Apr 11 nicklas 32   @author Nicklas
5617 28 Apr 11 nicklas 33   @since 3.0
5617 28 Apr 11 nicklas 34   @base.modified $Date: 2011-03-30 11:44:57 +0200 (on, 30 mar 2011) $
5617 28 Apr 11 nicklas 35 */
5617 28 Apr 11 nicklas 36 public class PluginDefinitionFilter
5617 28 Apr 11 nicklas 37   implements Filter<Element>
5617 28 Apr 11 nicklas 38 {
5617 28 Apr 11 nicklas 39
5617 28 Apr 11 nicklas 40   
5617 28 Apr 11 nicklas 41   /**
5617 28 Apr 11 nicklas 42     Create a new filter.
5617 28 Apr 11 nicklas 43   */
5617 28 Apr 11 nicklas 44   public PluginDefinitionFilter()
5617 28 Apr 11 nicklas 45   {}
5617 28 Apr 11 nicklas 46   
5617 28 Apr 11 nicklas 47   /*
5617 28 Apr 11 nicklas 48     From the Filter interface
5617 28 Apr 11 nicklas 49     --------------------------
5617 28 Apr 11 nicklas 50   */
5617 28 Apr 11 nicklas 51   @Override
5617 28 Apr 11 nicklas 52   public boolean evaluate(Element tag)
5617 28 Apr 11 nicklas 53   {
5617 28 Apr 11 nicklas 54     return "plugin-definition".equals(tag.getName());
5617 28 Apr 11 nicklas 55   }
5617 28 Apr 11 nicklas 56   // --------------------------
5617 28 Apr 11 nicklas 57 }