Package org.apache.any23.extractor

## Class SimpleExtractorFactory<T extends Extractor<?>>

- java.lang.Object
- - org.apache.any23.extractor.SimpleExtractorFactory<T>

- Type Parameters:
    `T` - the type of the `Extractor` served by this factory.
  All Implemented Interfaces:
    `ExtractorDescription`, `ExtractorFactory<T>`
  Direct Known Subclasses:
    `AdrExtractorFactory`, `CSVExtractorFactory`, `EmbeddedJSONLDExtractorFactory`, `FunctionalSyntaxExtractorFactory`, `GeoExtractorFactory`, `HAdrExtractorFactory`, `HCalendarExtractorFactory`, `HCardExtractorFactory`, `HCardExtractorFactory`, `HeadLinkExtractorFactory`, `HEntryExtractorFactory`, `HEventExtractorFactory`, `HGeoExtractorFactory`, `HItemExtractorFactory`, `HListingExtractorFactory`, `HProductExtractorFactory`, `HRecipeExtractorFactory`, `HRecipeExtractorFactory`, `HResumeExtractorFactory`, `HResumeExtractorFactory`, `HReviewAggregateExtractorFactory`, `HReviewExtractorFactory`, `HTMLMetaExtractorFactory`, `ICalExtractorFactory`, `ICBMExtractorFactory`, `JCalExtractorFactory`, `JSONLDExtractorFactory`, `LicenseExtractorFactory`, `ManchesterSyntaxExtractorFactory`, `MicrodataExtractorFactory`, `NQuadsExtractorFactory`, `NTriplesExtractorFactory`, `RDFa11ExtractorFactory`, `RDFaExtractorFactory`, `RDFXMLExtractorFactory`, `SpeciesExtractorFactory`, `TitleExtractorFactory`, `TriXExtractorFactory`, `TurtleExtractorFactory`, `TurtleHTMLExtractorFactory`, `XCalExtractorFactory`, `XFNExtractorFactory`, `XPathExtractorFactory`, `YAMLExtractorFactory`

      public abstract class SimpleExtractorFactory<T extends Extractor<?>>
      extends Object
      implements ExtractorFactory<T>

  This class is a simple and default-like implementation of `ExtractorFactory`.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `SimpleExtractorFactory​(String name, Prefixes prefixes)` |
    `protected` | `SimpleExtractorFactory​(String name, Prefixes prefixes, Collection<String> supportedMIMETypes, String exampleInput)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `String` | `getExampleInput()` | An example input file for the extractor, to be used in auto-generated documentation.
    `String` | `getExtractorLabel()` | Returns the label for extractors created from this factory.
    `String` | `getExtractorName()` | Returns the name of the extractor.
    `Prefixes` | `getPrefixes()` | An instance defining the prefixes supported by this extractor.
    `Collection<MIMEType>` | `getSupportedMIMETypes()` | Supports wildcards, e.g.

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

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

    - ### Methods inherited from interface org.apache.any23.extractor.ExtractorFactory

      `createExtractor`

- - ### Constructor Detail

    - #### SimpleExtractorFactory

          protected SimpleExtractorFactory​(String name,
                                           Prefixes prefixes)

    - #### SimpleExtractorFactory

          protected SimpleExtractorFactory​(String name,
                                           Prefixes prefixes,
                                           Collection<String> supportedMIMETypes,
                                           String exampleInput)

  - ### Method Detail

    - #### getExtractorName

          public String getExtractorName()

      Description copied from interface: `ExtractorDescription`
      Returns the name of the extractor.
      Specified by:
        `getExtractorName` in interface `ExtractorDescription`
      Returns:
        the name of the `Extractor`

    - #### getExtractorLabel

          public String getExtractorLabel()

      Description copied from interface: `ExtractorDescription`
      Returns the label for extractors created from this factory.
      Specified by:
        `getExtractorLabel` in interface `ExtractorDescription`
      Returns:
        the label of the `Extractor`

    - #### getPrefixes

          public Prefixes getPrefixes()

      Description copied from interface: `ExtractorDescription`
      An instance defining the prefixes supported by this extractor.
      Specified by:
        `getPrefixes` in interface `ExtractorDescription`
      Returns:
        the handled `Prefixes`

    - #### getSupportedMIMETypes

          public Collection<MIMEType> getSupportedMIMETypes()

      Description copied from interface: `ExtractorFactory`
      Supports wildcards, e.g. `"*/*"` for blind extractors that merely call a web service.
      Specified by:
        `getSupportedMIMETypes` in interface `ExtractorFactory<T extends Extractor<?>>`
      Returns:
        the supported `MIMEType`

    - #### getExampleInput

          public String getExampleInput()

      Description copied from interface: `ExtractorFactory`
      An example input file for the extractor, to be used in auto-generated documentation. For the `Extractor.BlindExtractor`, this is an arbitrary IRI. For extractors that require content, it is the name of a file, relative to the factory's class file's location, it will be opened using factory.getClass().getResourceAsStream(filename). The example should be a short file that produces characteristic output if sent through the extractor. The file will be read as UTF-8, so it should either use that encoding or avoid characters outside of the US-ASCII range.
      Specified by:
        `getExampleInput` in interface `ExtractorFactory<T extends Extractor<?>>`
      Returns:
        an input example