public abstract class AbstractMetadataChecksummer extends Object implements IMetadataChecksummer, IXMLConfigurable
IMetadataChecksummer
giving the option
to keep the generated checksum. The checksum can be stored
in a target field name specified. If no target field name is specified,
it stores it under the
metadata field name CollectorMetadata.COLLECTOR_CHECKSUM_METADATA
.
<metadataChecksummer class="(subclass)"> keep="[false|true]" targetField="(optional metadata field to store the checksum)" />
targetField
is ignored unless the keep
attribute is set to true
.Constructor and Description |
---|
AbstractMetadataChecksummer() |
Modifier and Type | Method and Description |
---|---|
String |
createMetadataChecksum(Properties metadata)
Creates a metadata checksum.
|
protected abstract String |
doCreateMetaChecksum(Properties metadata) |
boolean |
equals(Object other) |
String |
getTargetField()
Gets the metadata field to use to store the checksum value.
|
int |
hashCode() |
boolean |
isKeep()
Whether to keep the metadata checksum value as a new metadata field.
|
protected abstract void |
loadChecksummerFromXML(XMLConfiguration xml) |
void |
loadFromXML(Reader in) |
protected abstract void |
saveChecksummerToXML(EnhancedXMLStreamWriter writer) |
void |
saveToXML(Writer out) |
void |
setKeep(boolean keep)
Sets whether to keep the metadata checksum value as a new metadata field.
|
void |
setTargetField(String targetField)
Sets the metadata field name to use to store the checksum value.
|
String |
toString() |
public final String createMetadataChecksum(Properties metadata)
IMetadataChecksummer
createMetadataChecksum
in interface IMetadataChecksummer
metadata
- all metadata valuesprotected abstract String doCreateMetaChecksum(Properties metadata)
public boolean isKeep()
true
to keep the checksumpublic void setKeep(boolean keep)
keep
- true
to keep the checksumpublic String getTargetField()
CollectorMetadata.COLLECTOR_CHECKSUM_METADATA
.
Only applicable if isKeep()
returns true
public void setTargetField(String targetField)
targetField
- the metadata field namepublic final void loadFromXML(Reader in)
loadFromXML
in interface IXMLConfigurable
protected abstract void loadChecksummerFromXML(XMLConfiguration xml)
public final void saveToXML(Writer out) throws IOException
saveToXML
in interface IXMLConfigurable
IOException
protected abstract void saveChecksummerToXML(EnhancedXMLStreamWriter writer) throws XMLStreamException
XMLStreamException
Copyright © 2014–2021 Norconex Inc.. All rights reserved.