public class XmlModule
extends ModuleBase
| Modifier and Type | Field and Description |
|---|---|
protected String |
_baseURL |
protected Checksummer |
_ckSummer
PRIVATE INSTANCE FIELDS.
|
protected ChecksumInputStream |
_cstream |
protected DataInputStream |
_dstream |
protected Map<String,File> |
_localSchemas |
protected Property |
_metadata |
protected boolean |
_parseFromSig |
protected List<Property> |
_propList |
protected boolean |
_sigWantsDecl |
protected TextMDMetadata |
_textMD |
protected boolean |
_withTextMD |
protected String |
_xhtmlDoctype |
| Constructor and Description |
|---|
XmlModule()
Instantiate an XmlModule object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkSignatures(File file,
InputStream stream,
RepInfo info)
Check if the digital object conforms to this Module's
internal signature information.
|
protected void |
initParse() |
protected static String |
intTo4DigitHex(int n) |
protected static boolean |
isNotEmpty(String value)
Verification that the string contains something usefull.
|
protected static boolean |
nameInCollection(String name,
Collection<String> coll) |
void |
param(String param)
Per-action initialization.
|
int |
parse(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(String doctype)
Sets the value of the doctype string, assumed to have been forced
to upper case.
|
protected Checksummer _ckSummer
protected ChecksumInputStream _cstream
protected DataInputStream _dstream
protected List<Property> _propList
protected Property _metadata
protected String _xhtmlDoctype
protected String _baseURL
protected boolean _sigWantsDecl
protected boolean _parseFromSig
protected boolean _withTextMD
protected TextMDMetadata _textMD
public void setXhtmlDoctype(String doctype)
public void resetParams()
throws Exception
Exceptionpublic void param(String param)
param - 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(InputStream stream, RepInfo info, int parseIndex) throws 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.IOExceptionpublic void checkSignatures(File file, InputStream stream, RepInfo info) throws 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 testIOExceptionprotected void initParse()
protected static boolean nameInCollection(String name, Collection<String> coll)
protected static String intTo4DigitHex(int n)
protected static boolean isNotEmpty(String value)
value - string to testCopyright © 2008–2017 The Open Preservation Foundation. All rights reserved.