public final class XMLUpdateShredder extends XMLShredder implements Callable<Void>
Shredder, which updates a Treetank revision to the next revision, as thus it just inserts or deletes nodes, which have been changed. Renames are treated as insert new node, delete old node.
Modifier and Type | Field and Description |
---|---|
protected List<XMLEvent> |
mEvents
Events to parse.
|
protected File |
mFile
File to parse.
|
mFirstChildAppend, mReader, mWtx
Constructor and Description |
---|
XMLUpdateShredder(INodeWriteTrx paramWtx,
XMLEventReader paramReader,
EShredderInsert paramAddAsFirstChild,
Object paramData,
EShredderCommit paramCommit)
Normal constructor to invoke a shredding process on a existing
INodeWriteTrx . |
Modifier and Type | Method and Description |
---|---|
Void |
call()
Invoking the shredder.
|
static void |
main(String... args)
Main method.
|
addNewElement, addNewText, createFileReader, createListReader, createStringReader, getLatch, insertNewContent
protected transient File mFile
public XMLUpdateShredder(INodeWriteTrx paramWtx, XMLEventReader paramReader, EShredderInsert paramAddAsFirstChild, Object paramData, EShredderCommit paramCommit) throws TTException
INodeWriteTrx
.paramWtx
- INodeWriteTrx
where the new XML Fragment should be
placedparamReader
- XMLEventReader
(StAX parser) of the XML FragmentparamAddAsFirstChild
- if the insert is occuring on a node in an existing tree. false
is not possible
when wtx is on root nodeparamData
- the data the update shredder operates on. Either a List
of XMLEvent
s or a
File
paramCommit
- determines if changes should be commitedTTUsageException
- if insertasfirstChild && updateOnly is both true OR if wtx is
not pointing to doc-root and updateOnly= trueTTIOException
- if Treetank cannot access node keysTTException
public Void call() throws TTException
call
in interface Callable<Void>
call
in class XMLShredder
TTException
- if Treetank encounters something went wrongpublic static void main(String... args)
args
- Input and output files.Copyright © 2013. All Rights Reserved.