Class ExternalParser

    • Field Detail

      • INPUT_FILE_TOKEN

        public static final String INPUT_FILE_TOKEN
        The token, which if present in the Command string, will be replaced with the input filename. Alternately, the input data can be streamed over STDIN.
        See Also:
        Constant Field Values
      • OUTPUT_FILE_TOKEN

        public static final String OUTPUT_FILE_TOKEN
        The token, which if present in the Command string, will be replaced with the output filename. Alternately, the output data can be collected on STDOUT.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ExternalParser

        public ExternalParser()
    • Method Detail

      • check

        public static boolean check​(String checkCmd,
                                    int... errorValue)
        Checks to see if the command can be run. Typically used with something like "myapp --version" to check to see if "myapp" is installed and on the path.
        Parameters:
        checkCmd - The check command to run
        errorValue - What is considered an error value?
      • check

        public static boolean check​(String[] checkCmd,
                                    int... errorValue)
      • getSupportedTypes

        public Set<MediaType> getSupportedTypes​(ParseContext context)
        Description copied from interface: Parser
        Returns the set of media types supported by this parser when used with the given parse context.
        Specified by:
        getSupportedTypes in interface Parser
        Parameters:
        context - parse context
        Returns:
        immutable set of media types
      • getSupportedTypes

        public Set<MediaType> getSupportedTypes()
      • setSupportedTypes

        public void setSupportedTypes​(Set<MediaType> supportedTypes)
      • getCommand

        public String[] getCommand()
      • setIgnoredLineConsumer

        public void setIgnoredLineConsumer​(ExternalParser.LineConsumer ignoredLineConsumer)
        Set a consumer for the lines ignored by the parse functions
        Parameters:
        ignoredLineConsumer - consumer instance
      • getMetadataExtractionPatterns

        public Map<Pattern,​String> getMetadataExtractionPatterns()
      • setMetadataExtractionPatterns

        public void setMetadataExtractionPatterns​(Map<Pattern,​String> patterns)
        Sets the map of regular expression patterns and Metadata keys. Any matching patterns will have the matching metadata entries set. Set this to null to disable Metadata extraction.