Interface Module

  • All Known Implementing Classes:
    BytestreamModule, ModuleBase

    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
    • Method Detail

      • init

        void init​(String init)
           throws Exception
        Per-instantiation initialization.
        Parameters:
        init - Initialization parameter. This is typically obtained from the configuration file.
        Throws:
        Exception
      • setDefaultParams

        void setDefaultParams​(List<String> params)
        Sets list of default parameters.
        Parameters:
        params - A List whose elements are Strings. May be empty.
      • applyDefaultParams

        void applyDefaultParams()
                         throws Exception
        Applies the default parameters.
        Throws:
        Exception
      • resetParams

        void resetParams()
                  throws Exception
        Reset parameter settings. Returns to a default state without any parameters.
        Throws:
        Exception
      • param

        void param​(String param)
            throws Exception
        Per-action initialization. May be called multiple times.
        Parameters:
        param - Initialization parameter.
        Throws:
        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

        String getName()
        Return the name of this Module.
      • getRelease

        String getRelease()
        Return the release identifier
      • getDate

        Date getDate()
        Return the last modification date of the Module, as a Java Date object
      • getVendor

        Agent getVendor()
        Return the vendor information
      • getRights

        String getRights()
        Return the copyright information string
      • getNote

        String getNote()
        Return the Module note
      • getFormat

        String[] getFormat()
        Return the array of format names supported by this Module
      • getMimeType

        String[] getMimeType()
        Return the array of MIME type strings for formats supported by this Module
      • getCoverage

        String getCoverage()
        Return details as to the specific format versions or variants that are supported by this Module
      • getSignature

        List<Signature> getSignature()
        Return the List of Signatures recognized by this Module
      • getSpecification

        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

        String getWellFormedNote()
        Return the string describing well-formedness criteria
      • getRepInfoNote

        String getRepInfoNote()
        Returns the RepInfo note
      • getValidityNote

        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​(String feature)
        Returns true if the module supports a given named feature, and false if the feature is unsupported or unknown.
      • getFeatures

        List<String> getFeatures()
        Returns the full list of features.
      • getDefaultParams

        List<String> getDefaultParams()
        Returns the list of default parameters.
      • parse

        int parse​(InputStream stream,
                  RepInfo info,
                  int parseIndex)
           throws 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:
        IOException
      • parse

        void parse​(RandomAccessFile file,
                   RepInfo info)
            throws 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:
        IOException
      • checkSignatures

        void checkSignatures​(File file,
                             InputStream stream,
                             RepInfo info)
                      throws 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:
        IOException
      • checkSignatures

        void checkSignatures​(File file,
                             RandomAccessFile raf,
                             RepInfo info)
                      throws 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:
        IOException
      • show

        void show​(OutputHandler handler)
        Generates information about this Module. The format of the output depends on the OutputHandler.