Package edu.harvard.hul.ois.jhove
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionvoidApplies the default parameters.voidcheckSignatures(File file, InputStream stream, RepInfo info) Check if the digital object conforms to this Module's internal signature information.voidcheckSignatures(File file, RandomAccessFile raf, RepInfo info) Check if the digital object conforms to this Module's internal signature information.Return details as to the specific format versions or variants that are supported by this ModulegetDate()Return the last modification date of the Module, as a Java Date objectReturns the list of default parameters.Returns the full list of features.String[]Return the array of format names supported by this ModuleString[]Return the array of MIME type strings for formats supported by this ModulegetName()Return the name of this Module.getNote()Return the Module noteReturn the release identifierReturns the RepInfo noteReturn the copyright information stringReturn the List of Signatures recognized by this ModuleReturns a list ofDocumentobjects (one for each specification document of the format).Returns the string describing validity criteriaReturn the vendor informationReturn the string describing well-formedness criteriabooleanhasFeature(String feature) Returnstrueif the module supports a given named feature, andfalseif the feature is unsupported or unknown.voidPer-instantiation initialization.booleanReturns the random access flag (true if the module operates on random access files, false if it operates on streams)voidPer-action initialization.intparse(InputStream stream, RepInfo info, int parseIndex) Parse the content of a stream digital object and store the results in RepInfo.voidparse(RandomAccessFile file, RepInfo info) Parse the content of a random access digital object and store the results in RepInfo.voidReset parameter settings.voidPass the associated App object to this Module.voidPass the JHOVE engine object to this Module.voidsetDefaultParams(List<String> params) Sets list of default parameters.voidsetVerbosity(int verbosity) Set the degree of verbosity desired from the module.voidshow(OutputHandler handler) Generates information about this Module.
-
Field Details
-
MAXIMUM_VERBOSITY
static final int MAXIMUM_VERBOSITY- See Also:
-
MINIMUM_VERBOSITY
static final int MINIMUM_VERBOSITY- See Also:
-
-
Method Details
-
init
Per-instantiation initialization.- Parameters:
init- Initialization parameter. This is typically obtained from the configuration file.- Throws:
Exception
-
setDefaultParams
Sets list of default parameters.- Parameters:
params- A List whose elements are Strings. May be empty.
-
applyDefaultParams
Applies the default parameters.- Throws:
Exception
-
resetParams
Reset parameter settings. Returns to a default state without any parameters.- Throws:
Exception
-
param
Per-action initialization. May be called multiple times.- Parameters:
param- Initialization parameter.- Throws:
Exception
-
setApp
Pass the associated App object to this Module. The App makes various services available. -
setBase
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
Return the List of Signatures recognized by this Module -
getSpecification
Returns a list ofDocumentobjects (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:
-
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
Returnstrueif the module supports a given named feature, andfalseif the feature is unsupported or unknown. -
getFeatures
Returns the full list of features. -
getDefaultParams
Returns the list of default parameters. -
parse
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 toparseare 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 toparseare 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 toparse. Ifparsereturns a nonzero value, it must be called again withparseIndexequal to that return value.- Throws:
IOException
-
parse
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 parsedinfo- A fresh RepInfo object which will be modified to reflect the results of the parsing- Throws:
IOException
-
checkSignatures
Check if the digital object conforms to this Module's internal signature information.- Parameters:
file- A File object for the object being parsedstream- An InputStream, positioned at its beginning, which is generated from the object to be parsedinfo- A fresh RepInfo object which will be modified to reflect the results of the test- Throws:
IOException
-
checkSignatures
Check if the digital object conforms to this Module's internal signature information.- Parameters:
file- A File object for the object being parsedraf- A RandomAccessFile, positioned at its beginning, which is generated from the object to be parsedinfo- A fresh RepInfo object which will be modified to reflect the results of the test- Throws:
IOException
-
show
Generates information about this Module. The format of the output depends on the OutputHandler.
-