|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.harvard.hul.ois.jhove.ModuleBase
edu.harvard.hul.ois.jhove.module.XmlModule
public class XmlModule
Module for identification and validation of XML files.
| Field Summary | |
|---|---|
protected java.lang.String |
_baseURL
|
protected Checksummer |
_ckSummer
PRIVATE INSTANCE FIELDS. |
protected ChecksumInputStream |
_cstream
|
protected java.io.DataInputStream |
_dstream
|
protected java.util.Map<java.lang.String,java.io.File> |
_localSchemas
|
protected Property |
_metadata
|
protected boolean |
_parseFromSig
|
protected java.util.List<Property> |
_propList
|
protected boolean |
_sigWantsDecl
|
protected TextMDMetadata |
_textMD
|
protected boolean |
_withTextMD
|
protected java.lang.String |
_xhtmlDoctype
|
| Fields inherited from class edu.harvard.hul.ois.jhove.ModuleBase |
|---|
_app, _bigEndian, _checksumFinished, _countStream, _coverage, _crc32, _date, _defaultParams, _features, _format, _init, _isRandomAccess, _je, _logger, _md5, _mimeType, _name, _nByte, _note, _param, _release, _repInfoNote, _rights, _sha1, _signature, _specification, _validityNote, _vendor, _verbosity, _wellFormedNote |
| Fields inherited from interface edu.harvard.hul.ois.jhove.Module |
|---|
MAXIMUM_VERBOSITY, MINIMUM_VERBOSITY |
| Constructor Summary | |
|---|---|
XmlModule()
Instantiate an XmlModule object. |
|
| Method Summary | |
|---|---|
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. |
protected void |
initParse()
Initializes the state of the module for parsing. |
protected static java.lang.String |
intTo4DigitHex(int n)
|
protected static boolean |
isNotEmpty(java.lang.String value)
Verification that the string contains something usefull. |
protected static boolean |
nameInCollection(java.lang.String name,
java.util.Collection<java.lang.String> coll)
|
void |
param(java.lang.String param)
Per-action initialization. |
int |
parse(java.io.InputStream stream,
RepInfo info,
int parseIndex)
Parse the content of a purported XML digital object and store the results in RepInfo. |
void |
resetParams()
Reset parameter settings. |
void |
setXhtmlDoctype(java.lang.String doctype)
Sets the value of the doctype string, assumed to have been forced to upper case. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Checksummer _ckSummer
protected ChecksumInputStream _cstream
protected java.io.DataInputStream _dstream
protected java.util.List<Property> _propList
protected Property _metadata
protected java.lang.String _xhtmlDoctype
protected java.lang.String _baseURL
protected boolean _sigWantsDecl
protected boolean _parseFromSig
protected boolean _withTextMD
protected TextMDMetadata _textMD
protected java.util.Map<java.lang.String,java.io.File> _localSchemas
| Constructor Detail |
|---|
public XmlModule()
| Method Detail |
|---|
public void setXhtmlDoctype(java.lang.String doctype)
public void resetParams()
throws java.lang.Exception
resetParams in interface ModuleresetParams in class ModuleBasejava.lang.Exceptionpublic void param(java.lang.String param)
param in interface Moduleparam in class ModuleBaseparam - The module parameter; under command-line Jhove, the -p parameter.
If the parameter starts with "schema", then the part to the
right of the equal sign identifies a URI with a local path
(URI, then semicolon, then path).
If the first character is 's' and the parameter isn't "schema",
then signature checking requires
a document declaration, and the rest of the URL is considered
as follows.
If the parameter begins with 'b' or 'B', then the remainder of
the parameter is used as a base URL. Otherwise it is ignored,
and there is no base URL.
public int parse(java.io.InputStream stream,
RepInfo info,
int parseIndex)
throws java.io.IOException
parse in interface Moduleparse in class ModuleBasestream - 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 checkSignatures(java.io.File file,
java.io.InputStream stream,
RepInfo info)
throws java.io.IOException
checkSignatures in interface ModulecheckSignatures in class ModuleBasefile - 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.IOExceptionprotected void initParse()
ModuleBase
initParse in class ModuleBase
protected static boolean nameInCollection(java.lang.String name,
java.util.Collection<java.lang.String> coll)
protected static java.lang.String intTo4DigitHex(int n)
protected static boolean isNotEmpty(java.lang.String value)
value - string to test
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||