Examples of ExampleInputOutput


Examples of org.apache.any23.extractor.ExampleInputOutput

     * @param extractorName the name of the extractor
     * @throws IOException raised if no extractor is found with that name
     */
    public void printExampleInput(String extractorName) throws IOException {
        ExtractorFactory<?> factory = getFactory(extractorName);
        ExampleInputOutput example = new ExampleInputOutput(factory);
        String input = example.getExampleInput();
        if (input == null) {
            throw new IllegalArgumentException("Extractor " + extractorName + " provides no example input");
        }
        System.out.println(input);
    }
View Full Code Here

Examples of org.apache.any23.extractor.ExampleInputOutput

     * @throws IOException raised if no extractor is found with that name
     * @throws ExtractionException
     */
    public void printExampleOutput(String extractorName) throws IOException, ExtractionException {
        ExtractorFactory<?> factory = getFactory(extractorName);
        ExampleInputOutput example = new ExampleInputOutput(factory);
        String output = example.getExampleOutput();
        if (output == null) {
            throw new IllegalArgumentException("Extractor " + extractorName + " provides no example output");
        }
        System.out.println(output);
    }
View Full Code Here

Examples of org.apache.any23.extractor.ExampleInputOutput

     * @throws ExtractionException
     */
    public void printReport() throws IOException, ExtractionException {
        for (String extractorName : ExtractorRegistry.getInstance().getAllNames()) {
            ExtractorFactory<?> factory = ExtractorRegistry.getInstance().getFactory(extractorName);
            ExampleInputOutput example = new ExampleInputOutput(factory);
            System.out.println("Extractor: " + extractorName);
            System.out.println("\ttype: " + getType(factory));
            System.out.println();
            final String exampleInput = example.getExampleInput();
            if(exampleInput == null) {
                System.out.println("(No Example Available)");
            } else {
                System.out.println("-------- Example Input  --------");
                System.out.println(exampleInput);
                System.out.println("-------- Example Output --------");
                String output = example.getExampleOutput();
                System.out.println(output == null || output.trim().length() == 0 ? "(No Output Generated)" : output);
            }
            System.out.println("================================");
            System.out.println();
        }
View Full Code Here

Examples of org.apache.any23.extractor.ExampleInputOutput

     * @param registry
     * @throws IOException raised if no extractor is found with that name
     */
    public void printExampleInput(String extractorName, ExtractorRegistry registry) throws IOException {
        ExtractorFactory<?> factory = getFactory(registry, extractorName);
        ExampleInputOutput example = new ExampleInputOutput(factory);
        String input = example.getExampleInput();
        if (input == null) {
            throw new IllegalArgumentException("Extractor " + extractorName + " provides no example input");
        }
        System.out.println(input);
    }
View Full Code Here

Examples of org.apache.any23.extractor.ExampleInputOutput

     * @throws IOException raised if no extractor is found with that name
     * @throws ExtractionException
     */
    public void printExampleOutput(String extractorName, ExtractorRegistry registry) throws IOException, ExtractionException {
        ExtractorFactory<?> factory = getFactory(registry, extractorName);
        ExampleInputOutput example = new ExampleInputOutput(factory);
        String output = example.getExampleOutput();
        if (output == null) {
            throw new IllegalArgumentException("Extractor " + extractorName + " provides no example output");
        }
        System.out.println(output);
    }
View Full Code Here

Examples of org.apache.any23.extractor.ExampleInputOutput

     * @throws ExtractionException
     */
    public void printReport(ExtractorRegistry registry) throws IOException, ExtractionException {
        for (String extractorName : registry.getAllNames()) {
            ExtractorFactory<?> factory = registry.getFactory(extractorName);
            ExampleInputOutput example = new ExampleInputOutput(factory);
            System.out.println("Extractor: " + extractorName);
            System.out.println("\ttype: " + getType(factory));
            System.out.println();
            final String exampleInput = example.getExampleInput();
            if(exampleInput == null) {
                System.out.println("(No Example Available)");
            } else {
                System.out.println("-------- Example Input  --------");
                System.out.println(exampleInput);
                System.out.println("-------- Example Output --------");
                String output = example.getExampleOutput();
                System.out.println(output == null || output.trim().length() == 0 ? "(No Output Generated)" : output);
            }
            System.out.println("================================");
            System.out.println();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.