Class ExtractorDocumentation

  • All Implemented Interfaces:
    org.apache.any23.cli.Tool

    public class ExtractorDocumentation
    extends Object
    This class provides some command-line documentation about available extractors and their usage.
    • Constructor Detail

      • ExtractorDocumentation

        public ExtractorDocumentation()
    • Method Detail

      • printError

        public void printError​(String msg)
        Print an error message.
        Parameters:
        msg - the error message to be printed
      • printExtractorList

        public void printExtractorList​(org.apache.any23.extractor.ExtractorRegistry registry)
        Prints the list of all the available extractor names, labels and supported mimetypes.
        Parameters:
        registry - the ExtractorRegistry containing all extractors
      • printExampleInput

        public void printExampleInput​(String extractorName,
                                      org.apache.any23.extractor.ExtractorRegistry registry)
                               throws IOException
        Prints an example of input for the provided extractor.
        Parameters:
        extractorName - the name of the extractor
        registry - the ExtractorRegistry containing all extractors
        Throws:
        IOException - raised if no extractor is found with that name
      • printExampleOutput

        public void printExampleOutput​(String extractorName,
                                       org.apache.any23.extractor.ExtractorRegistry registry)
                                throws IOException,
                                       org.apache.any23.extractor.ExtractionException
        Prints an output example for the given extractor.
        Parameters:
        extractorName - the extractor name
        registry - the ExtractorRegistry containing all extractors
        Throws:
        IOException - raised if no extractor is found with that name
        org.apache.any23.extractor.ExtractionException - if there is an error duing extraction
      • printReport

        public void printReport​(org.apache.any23.extractor.ExtractorRegistry registry)
                         throws IOException,
                                org.apache.any23.extractor.ExtractionException
        Prints a complete report on all the available extractors.
        Parameters:
        registry - the ExtractorRegistry containing all extractors
        Throws:
        IOException - raised if no extractor is found with that name
        org.apache.any23.extractor.ExtractionException - if there is an error duing extraction