Class CompositeTripleHandler

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

    public class CompositeTripleHandler
    extends Object
    implements org.apache.any23.writer.TripleHandler
    A TripleHandler multi decorator, that wraps zero or more other triple handlers and dispatches all events to each of them.
    Author:
    Richard Cyganiak (richard@cyganiak.de)
    • Constructor Detail

      • CompositeTripleHandler

        public CompositeTripleHandler()
        Constructor with empty decorated list.
      • CompositeTripleHandler

        public CompositeTripleHandler​(Collection<org.apache.any23.writer.TripleHandler> children)
        Constructor with initial list of decorated handlers.
        Parameters:
        children - list of decorated handlers.
    • Method Detail

      • addChild

        public void addChild​(org.apache.any23.writer.TripleHandler child)
        Adds a decorated handler.
        Parameters:
        child - the decorated handler.
      • getChilds

        public Collection<org.apache.any23.writer.TripleHandler> getChilds()
      • 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
      • 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
      • 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
      • 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
      • 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
      • 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
      • setContentLength

        public void setContentLength​(long contentLength)
        Specified by:
        setContentLength in interface org.apache.any23.writer.TripleHandler