|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
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 |
---|
static final int MAXIMUM_VERBOSITY
static final int MINIMUM_VERBOSITY
Method Detail |
---|
void init(java.lang.String init) throws java.lang.Exception
init
- Initialization parameter. This is typically obtained
from the configuration file.
java.lang.Exception
void setDefaultParams(java.util.List<java.lang.String> params)
params
- A List whose elements are Strings.
May be empty.void applyDefaultParams() throws java.lang.Exception
java.lang.Exception
void resetParams() throws java.lang.Exception
java.lang.Exception
void param(java.lang.String param) throws java.lang.Exception
param
- Initialization parameter.
java.lang.Exception
void setApp(App app)
void setBase(JhoveBase je)
void setVerbosity(int verbosity)
verbosity
- The requested verbosity value.java.lang.String getName()
java.lang.String getRelease()
java.util.Date getDate()
Agent getVendor()
java.lang.String getRights()
java.lang.String getNote()
java.lang.String[] getFormat()
java.lang.String[] getMimeType()
java.lang.String getCoverage()
java.util.List<Signature> getSignature()
java.util.List<Document> getSpecification()
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.
Document
java.lang.String getWellFormedNote()
java.lang.String getRepInfoNote()
java.lang.String getValidityNote()
boolean isRandomAccess()
boolean hasFeature(java.lang.String feature)
true
if the module supports a given
named feature, and false
if the feature is
unsupported or unknown.
java.util.List<java.lang.String> getFeatures()
java.util.List<java.lang.String> getDefaultParams()
int parse(java.io.InputStream stream, RepInfo info, int parseIndex) throws java.io.IOException
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.
java.io.IOException
void parse(java.io.RandomAccessFile file, RepInfo info) throws java.io.IOException
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
java.io.IOException
void checkSignatures(java.io.File file, java.io.InputStream stream, RepInfo info) throws java.io.IOException
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
java.io.IOException
void checkSignatures(java.io.File file, java.io.RandomAccessFile raf, RepInfo info) throws java.io.IOException
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
java.io.IOException
void show(OutputHandler handler)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |