Package org.apache.any23.writer

## Class ReportingTripleHandler

- java.lang.Object
- - org.apache.any23.writer.ReportingTripleHandler

- All Implemented Interfaces:
    `AutoCloseable`, `org.apache.any23.writer.TripleHandler`

      public class ReportingTripleHandler
      extends Object
      implements org.apache.any23.writer.TripleHandler

  A `TripleHandler` that collects various information about the extraction process, such as the extractors used and the total number of triples.
  Author:
    Richard Cyganiak (richard@cyganiak.de)

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ReportingTripleHandler​(org.apache.any23.writer.TripleHandler wrapped)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `close()` |
    `void` | `closeContext​(org.apache.any23.extractor.ExtractionContext context)` |
    `void` | `endDocument​(org.eclipse.rdf4j.model.IRI documentIRI)` |
    `Collection<String>` | `getExtractorNames()` |
    `int` | `getTotalDocuments()` |
    `int` | `getTotalTriples()` |
    `void` | `openContext​(org.apache.any23.extractor.ExtractionContext context)` |
    `String` | `printReport()` |
    `void` | `receiveNamespace​(String prefix, String uri, org.apache.any23.extractor.ExtractionContext context)` |
    `void` | `receiveTriple​(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o, org.eclipse.rdf4j.model.IRI g, org.apache.any23.extractor.ExtractionContext context)` |
    `void` | `setContentLength​(long contentLength)` |
    `void` | `startDocument​(org.eclipse.rdf4j.model.IRI documentIRI)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ReportingTripleHandler

          public ReportingTripleHandler​(org.apache.any23.writer.TripleHandler wrapped)

  - ### Method Detail

    - #### getExtractorNames

          public Collection<String> getExtractorNames()

    - #### getTotalTriples

          public int getTotalTriples()

    - #### getTotalDocuments

          public int getTotalDocuments()

    - #### printReport

          public String printReport()

      Returns:
        a human readable report.

    - #### startDocument

          public void startDocument​(org.eclipse.rdf4j.model.IRI documentIRI)
                             throws org.apache.any23.writer.TripleHandlerException

      Specified by:
        `startDocument` in interface `org.apache.any23.writer.TripleHandler`
      Throws:
        `org.apache.any23.writer.TripleHandlerException`

    - #### openContext

          public void openContext​(org.apache.any23.extractor.ExtractionContext context)
                           throws org.apache.any23.writer.TripleHandlerException

      Specified by:
        `openContext` in interface `org.apache.any23.writer.TripleHandler`
      Throws:
        `org.apache.any23.writer.TripleHandlerException`

    - #### receiveNamespace

          public void receiveNamespace​(String prefix,
                                       String uri,
                                       org.apache.any23.extractor.ExtractionContext context)
                                throws org.apache.any23.writer.TripleHandlerException

      Specified by:
        `receiveNamespace` in interface `org.apache.any23.writer.TripleHandler`
      Throws:
        `org.apache.any23.writer.TripleHandlerException`

    - #### receiveTriple

          public void receiveTriple​(org.eclipse.rdf4j.model.Resource s,
                                    org.eclipse.rdf4j.model.IRI p,
                                    org.eclipse.rdf4j.model.Value o,
                                    org.eclipse.rdf4j.model.IRI g,
                                    org.apache.any23.extractor.ExtractionContext context)
                             throws org.apache.any23.writer.TripleHandlerException

      Specified by:
        `receiveTriple` in interface `org.apache.any23.writer.TripleHandler`
      Throws:
        `org.apache.any23.writer.TripleHandlerException`

    - #### setContentLength

          public void setContentLength​(long contentLength)

      Specified by:
        `setContentLength` in interface `org.apache.any23.writer.TripleHandler`

    - #### closeContext

          public void closeContext​(org.apache.any23.extractor.ExtractionContext context)
                            throws org.apache.any23.writer.TripleHandlerException

      Specified by:
        `closeContext` in interface `org.apache.any23.writer.TripleHandler`
      Throws:
        `org.apache.any23.writer.TripleHandlerException`

    - #### endDocument

          public void endDocument​(org.eclipse.rdf4j.model.IRI documentIRI)
                           throws org.apache.any23.writer.TripleHandlerException

      Specified by:
        `endDocument` in interface `org.apache.any23.writer.TripleHandler`
      Throws:
        `org.apache.any23.writer.TripleHandlerException`

    - #### close

          public void close()
                     throws org.apache.any23.writer.TripleHandlerException

      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in interface `org.apache.any23.writer.TripleHandler`
      Throws:
        `org.apache.any23.writer.TripleHandlerException`