1   /**
2    * Distribution License:
3    * JSword is free software; you can redistribute it and/or modify it under
4    * the terms of the GNU Lesser General Public License, version 2.1 as published by
5    * the Free Software Foundation. This program is distributed in the hope
6    * that it will be useful, but WITHOUT ANY WARRANTY; without even the
7    * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
8    * See the GNU Lesser General Public License for more details.
9    *
10   * The License is available on the internet at:
11   *       http://www.gnu.org/copyleft/lgpl.html
12   * or by writing to:
13   *      Free Software Foundation, Inc.
14   *      59 Temple Place - Suite 330
15   *      Boston, MA 02111-1307, USA
16   *
17   * Copyright: 2005
18   *     The copyright to this program is held by it's authors.
19   *
20   * ID: $Id: Filter.java 2110 2011-03-08 13:55:32Z dmsmith $
21   */
22  package org.crosswire.jsword.book.filter;
23  
24  import java.util.List;
25  
26  import org.crosswire.jsword.book.Book;
27  import org.crosswire.jsword.passage.Key;
28  import org.jdom.Content;
29  
30  /**
31   * A generic interface for things that can convert a String into OSIS data.
32   * 
33   * @see gnu.lgpl.License for license details.<br>
34   *      The copyright to this program is held by it's authors.
35   * @author Joe Walker [joe at eireneh dot com]
36   */
37  public interface Filter extends Cloneable {
38      /**
39       * Converter from plain (encoded) text to OSIS data
40       * 
41       * @param key
42       *            The key for the text
43       * @param plain
44       *            The encoded text
45       * @return a List of OSIS Elements
46       */
47      List<Content> toOSIS(Book book, Key key, String plain);
48  
49      /**
50       * This needs to be declared here so that it is visible as a method on a
51       * derived Filter.
52       * 
53       * @return A complete copy of ourselves
54       */
55      Filter clone();
56  }
57