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