1   /*
2    * RDFpro - An extensible tool for building stream-oriented RDF processing libraries.
3    * 
4    * Written in 2014 by Francesco Corcoglioniti with support by Marco Amadori, Michele Mostarda,
5    * Alessio Palmero Aprosio and Marco Rospocher. Contact info on http://rdfpro.fbk.eu/
6    * 
7    * To the extent possible under law, the authors have dedicated all copyright and related and
8    * neighboring rights to this software to the public domain worldwide. This software is
9    * distributed without any warranty.
10   * 
11   * You should have received a copy of the CC0 Public Domain Dedication along with this software.
12   * If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
13   */
14  package eu.fbk.rdfpro;
15  
16  import org.openrdf.model.Statement;
17  import org.openrdf.rio.RDFHandler;
18  import org.openrdf.rio.RDFHandlerException;
19  
20  /**
21   * Base implementation of {@code RDFHandler} + {@code AutoCloseable}.
22   * <p>
23   * The implementation of {@code AutoCloseable} allows for this class and its subclasses to be
24   * notified by RDFpro runtime when they are no more needed, so that allocated resources can be
25   * released if necessary. For this reason, it may be convenient to start from this class when
26   * implementing your specialized {@code RDFHandler}.
27   * </p>
28   */
29  public abstract class AbstractRDFHandler implements RDFHandler, AutoCloseable {
30  
31      /**
32       * Default constructor.
33       */
34      protected AbstractRDFHandler() {
35      }
36  
37      /**
38       * Does nothing.
39       */
40      @Override
41      public void startRDF() throws RDFHandlerException {
42      }
43  
44      /**
45       * Does nothing.
46       */
47      @Override
48      public void handleComment(final String comment) throws RDFHandlerException {
49      }
50  
51      /**
52       * Does nothing.
53       */
54      @Override
55      public void handleNamespace(final String prefix, final String uri) throws RDFHandlerException {
56      }
57  
58      /**
59       * Does nothing.
60       */
61      @Override
62      public void handleStatement(final Statement statement) throws RDFHandlerException {
63      }
64  
65      /**
66       * Does nothing.
67       */
68      @Override
69      public void endRDF() throws RDFHandlerException {
70      }
71  
72      /**
73       * Does nothing.
74       */
75      @Override
76      public void close() {
77      }
78  
79  }