Module (JHOVE Documentation)
Date: 2013-09-08

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.harvard.hul.ois.jhove
Interface Module

All Known Implementing Classes:
  AiffModule, AsciiModule, BytestreamModule, GifModule, HtmlModule, Jpeg2000Module, JpegModule, ModuleBase, PdfModule, TiffModule, Utf8Module, WaveModule, XmlModule

    public interface Module

Public interface for Jhove format-specific plug-in modules. All format modules must implement the Module interface; usually the best way to do this will be to subclass ModuleBase. Modules must be declared in the configuration file and present in the Classpath to be recognized by Jhove.

See Also:
  `ModuleBase`

Field Summary
`static int` | `MAXIMUM_VERBOSITY`
`static int` | `MINIMUM_VERBOSITY`

Method Summary
`void` | `applyDefaultParams()` Applies the default parameters.
`void` | `checkSignatures(java.io.File file, java.io.InputStream stream, RepInfo info)` Check if the digital object conforms to this Module's internal signature information.
`void` | `checkSignatures(java.io.File file, java.io.RandomAccessFile raf, RepInfo info)` Check if the digital object conforms to this Module's internal signature information.
`java.lang.String` | `getCoverage()` Return details as to the specific format versions or variants that are supported by this Module
`java.util.Date` | `getDate()` Return the last modification date of the Module, as a Java Date object
`java.util.List<java.lang.String>` | `getDefaultParams()` Returns the list of default parameters.
`java.util.List<java.lang.String>` | `getFeatures()` Returns the full list of features.
`java.lang.String[]` | `getFormat()` Return the array of format names supported by this Module
`java.lang.String[]` | `getMimeType()` Return the array of MIME type strings for formats supported by this Module
`java.lang.String` | `getName()` Return the name of this Module.
`java.lang.String` | `getNote()` Return the Module note
`java.lang.String` | `getRelease()` Return the release identifier
`java.lang.String` | `getRepInfoNote()` Returns the RepInfo note
`java.lang.String` | `getRights()` Return the copyright information string
`java.util.List<Signature>` | `getSignature()` Return the List of Signatures recognized by this Module
`java.util.List<Document>` | `getSpecification()` Returns a list of `Document` objects (one for each specification document of the format).
`java.lang.String` | `getValidityNote()` Returns the string describing validity criteria
`Agent` | `getVendor()` Return the vendor information
`java.lang.String` | `getWellFormedNote()` Return the string describing well-formedness criteria
`boolean` | `hasFeature(java.lang.String feature)` Returns `true` if the module supports a given named feature, and `false` if the feature is unsupported or unknown.
`void` | `init(java.lang.String init)` Per-instantiation initialization.
`boolean` | `isRandomAccess()` Returns the random access flag (true if the module operates on random access files, false if it operates on streams)
`void` | `param(java.lang.String param)` Per-action initialization.
`int` | `parse(java.io.InputStream stream, RepInfo info, int parseIndex)` Parse the content of a stream digital object and store the results in RepInfo.
`void` | `parse(java.io.RandomAccessFile file, RepInfo info)` Parse the content of a random access digital object and store the results in RepInfo.
`void` | `resetParams()` Reset parameter settings.
`void` | `setApp(App app)` Pass the associated App object to this Module.
`void` | `setBase(JhoveBase je)` Pass the JHOVE engine object to this Module.
`void` | `setDefaultParams(java.util.List<java.lang.String> params)` Sets list of default parameters.
`void` | `setVerbosity(int verbosity)` Set the degree of verbosity desired from the module.
`void` | `show(OutputHandler handler)` Generates information about this Module.

Field Detail

### MAXIMUM_VERBOSITY

    static final int MAXIMUM_VERBOSITY

See Also:
  Constant Field Values

### MINIMUM_VERBOSITY

    static final int MINIMUM_VERBOSITY

See Also:
  Constant Field Values

Method Detail

### init

    void init(java.lang.String init)
              throws java.lang.Exception

  Per-instantiation initialization.

  Parameters:
    `init` - Initialization parameter. This is typically obtained from the configuration file.
  Throws:
    `java.lang.Exception`

### setDefaultParams

    void setDefaultParams(java.util.List<java.lang.String> params)

  Sets list of default parameters.

  Parameters:
    `params` - A List whose elements are Strings. May be empty.

### applyDefaultParams

    void applyDefaultParams()
                            throws java.lang.Exception

  Applies the default parameters.

  Throws:
    `java.lang.Exception`

### resetParams

    void resetParams()
                     throws java.lang.Exception

  Reset parameter settings. Returns to a default state without any parameters.

  Throws:
    `java.lang.Exception`

### param

    void param(java.lang.String param)
               throws java.lang.Exception

  Per-action initialization. May be called multiple times.

  Parameters:
    `param` - Initialization parameter.
  Throws:
    `java.lang.Exception`

### setApp

    void setApp(App app)

  Pass the associated App object to this Module. The App makes various services available.

### setBase

    void setBase(JhoveBase je)

  Pass the JHOVE engine object to this Module.

### setVerbosity

    void setVerbosity(int verbosity)

  Set the degree of verbosity desired from the module.

  Parameters:
    `verbosity` - The requested verbosity value.

### getName

    java.lang.String getName()

  Return the name of this Module.

### getRelease

    java.lang.String getRelease()

  Return the release identifier

### getDate

    java.util.Date getDate()

  Return the last modification date of the Module, as a Java Date object

### getVendor

    Agent getVendor()

  Return the vendor information

### getRights

    java.lang.String getRights()

  Return the copyright information string

### getNote

    java.lang.String getNote()

  Return the Module note

### getFormat

    java.lang.String[] getFormat()

  Return the array of format names supported by this Module

### getMimeType

    java.lang.String[] getMimeType()

  Return the array of MIME type strings for formats supported by this Module

### getCoverage

    java.lang.String getCoverage()

  Return details as to the specific format versions or variants that are supported by this Module

### getSignature

    java.util.List<Signature> getSignature()

  Return the List of Signatures recognized by this Module

### getSpecification

    java.util.List<Document> getSpecification()

  Returns a list of `Document` objects (one for each specification document of the format). The specification list is generated by the Module, and specifications cannot be added by callers.

  See Also:
    `Document`

### getWellFormedNote

    java.lang.String getWellFormedNote()

  Return the string describing well-formedness criteria

### getRepInfoNote

    java.lang.String getRepInfoNote()

  Returns the RepInfo note

### getValidityNote

    java.lang.String getValidityNote()

  Returns the string describing validity criteria

### isRandomAccess

    boolean isRandomAccess()

  Returns the random access flag (true if the module operates on random access files, false if it operates on streams)

### hasFeature

    boolean hasFeature(java.lang.String feature)

  Returns `true` if the module supports a given named feature, and `false` if the feature is unsupported or unknown.

### getFeatures

    java.util.List<java.lang.String> getFeatures()

  Returns the full list of features.

### getDefaultParams

    java.util.List<java.lang.String> getDefaultParams()

  Returns the list of default parameters.

### parse

    int parse(java.io.InputStream stream,
              RepInfo info,
              int parseIndex)
              throws java.io.IOException

  Parse the content of a stream digital object and store the results in RepInfo. A given Module will normally implement only one of the two parse methods, leaving the other as a stub.

  Parameters:
    `stream` - An InputStream, positioned at its beginning, which is generated from the object to be parsed. If multiple calls to `parse` are made on the basis of a nonzero value being returned, a new InputStream must be provided each time.
    `info` - A fresh (on the first call) RepInfo object which will be modified to reflect the results of the parsing If multiple calls to `parse` are made on the basis of a nonzero value being returned, the same RepInfo object should be passed with each call.
    `parseIndex` - Must be 0 in first call to `parse`. If `parse` returns a nonzero value, it must be called again with `parseIndex` equal to that return value.
  Throws:
    `java.io.IOException`

### parse

    void parse(java.io.RandomAccessFile file,
               RepInfo info)
               throws java.io.IOException

  Parse the content of a random access digital object and store the results in RepInfo. A given Module will normally implement only one of the two parse methods, leaving the other as a stub.

  Parameters:
    `file` - A RandomAccessFile, positioned at its beginning, which is generated from the object to be parsed
    `info` - A fresh RepInfo object which will be modified to reflect the results of the parsing
  Throws:
    `java.io.IOException`

### checkSignatures

    void checkSignatures(java.io.File file,
                         java.io.InputStream stream,
                         RepInfo info)
                         throws java.io.IOException

  Check if the digital object conforms to this Module's internal signature information.

  Parameters:
    `file` - A File object for the object being parsed
    `stream` - An InputStream, positioned at its beginning, which is generated from the object to be parsed
    `info` - A fresh RepInfo object which will be modified to reflect the results of the test
  Throws:
    `java.io.IOException`

### checkSignatures

    void checkSignatures(java.io.File file,
                         java.io.RandomAccessFile raf,
                         RepInfo info)
                         throws java.io.IOException

  Check if the digital object conforms to this Module's internal signature information.

  Parameters:
    `file` - A File object for the object being parsed
    `raf` - A RandomAccessFile, positioned at its beginning, which is generated from the object to be parsed
    `info` - A fresh RepInfo object which will be modified to reflect the results of the test
  Throws:
    `java.io.IOException`

### show

    void show(OutputHandler handler)

  Generates information about this Module. The format of the output depends on the OutputHandler.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD