Package edu.harvard.hul.ois.jhove
Interface Module
-
- All Known Implementing Classes:
BytestreamModule,ModuleBase
public interface ModulePublic 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
Fields Modifier and Type Field Description static intMAXIMUM_VERBOSITYstatic intMINIMUM_VERBOSITY
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidapplyDefaultParams()Applies 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.StringgetCoverage()Return details as to the specific format versions or variants that are supported by this ModuleDategetDate()Return the last modification date of the Module, as a Java Date objectList<String>getDefaultParams()Returns the list of default parameters.List<String>getFeatures()Returns the full list of features.String[]getFormat()Return the array of format names supported by this ModuleString[]getMimeType()Return the array of MIME type strings for formats supported by this ModuleStringgetName()Return the name of this Module.StringgetNote()Return the Module noteStringgetRelease()Return the release identifierStringgetRepInfoNote()Returns the RepInfo noteStringgetRights()Return the copyright information stringList<Signature>getSignature()Return the List of Signatures recognized by this ModuleList<Document>getSpecification()Returns a list ofDocumentobjects (one for each specification document of the format).StringgetValidityNote()Returns the string describing validity criteriaAgentgetVendor()Return the vendor informationStringgetWellFormedNote()Return the string describing well-formedness criteriabooleanhasFeature(String feature)Returnstrueif the module supports a given named feature, andfalseif the feature is unsupported or unknown.voidinit(String init)Per-instantiation initialization.booleanisRandomAccess()Returns the random access flag (true if the module operates on random access files, false if it operates on streams)voidparam(String param)Per-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.voidresetParams()Reset parameter settings.voidsetApp(App app)Pass the associated App object to this Module.voidsetBase(JhoveBase je)Pass 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 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(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 ExceptionApplies the default parameters.- Throws:
Exception
-
resetParams
void resetParams() throws ExceptionReset 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
-
getSpecification
List<Document> 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:
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)
Returnstrueif the module supports a given named feature, andfalseif the feature is unsupported or unknown.
-
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 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
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 parsedinfo- 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 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
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 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
void show(OutputHandler handler)
Generates information about this Module. The format of the output depends on the OutputHandler.
-
-