com.norconex.importer.tagger.impl
Class RenameTagger
java.lang.Object
com.norconex.importer.tagger.impl.RenameTagger
- All Implemented Interfaces:
- IXMLConfigurable, IImportHandler, IDocumentTagger, Serializable
public class RenameTagger
- extends Object
- implements IDocumentTagger, IXMLConfigurable
Rename metadata fields to different names. If the target name already
exists, the values of the original field name will be added, unless
"overwrite" is set to true
.
Can be used both as a pre-parse or post-parse handler.
XML configuration usage:
<tagger class="com.norconex.importer.tagger.impl.RenameTagger">
<rename fromName="(from field)" toName="(to field)" overwrite="[false|true] />
<-- multiple rename tags allowed -->
</tagger>
- Author:
- Pascal Essiembre
- See Also:
- Serialized Form
RenameTagger
public RenameTagger()
tagDocument
public void tagDocument(String reference,
InputStream document,
Properties metadata,
boolean parsed)
throws IOException
- Description copied from interface:
IDocumentTagger
- Tags a document with extra metadata information.
- Specified by:
tagDocument
in interface IDocumentTagger
- Parameters:
reference
- document reference (e.g. URL)document
- documentmetadata
- document metadataparsed
- whether the document has been parsed already or not (a
parsed document should normally be text-based)
- Throws:
IOException
- problem reading the document
addRename
public void addRename(String fromName,
String toName,
boolean overwrite)
loadFromXML
public void loadFromXML(Reader in)
throws IOException
- Specified by:
loadFromXML
in interface IXMLConfigurable
- Throws:
IOException
saveToXML
public void saveToXML(Writer out)
throws IOException
- Specified by:
saveToXML
in interface IXMLConfigurable
- Throws:
IOException
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2009-2013 Norconex Inc.. All Rights Reserved.