public class Patch extends Object
Modifier and Type | Field and Description |
---|---|
static URI |
PATCH_FILE_NAME
The default file name of the path.
|
Constructor and Description |
---|
Patch()
Instantiates a new patch.
|
Patch(boolean fullDiff)
Instantiates a new patch specifying the fullDiff flag.
|
Patch(boolean fullDiff,
DiffAnnotator diffAnnotator)
Instantiates a new patch specifying the fullDiff flag and an annotator to annotate the differences.
|
Patch(boolean fullDiff,
URI patchFileName)
Instantiates a new patch specifying the fullDiff flag and the file name of the resulting patch.
|
Patch(boolean fullDiff,
URI patchFileName,
DiffAnnotator diffAnnotator)
Instantiates a new patch specifying the fullDiff flag, the file name of the resulting patch, and an annotator to annotate the differences.
|
Patch(DiffAnnotator diffAnnotator)
Instantiates a new patch specifying.
|
Patch(URI patchFileName)
Instantiates a new patch specifying the file name of the resulting patch.
|
Patch(URI patchFileName,
DiffAnnotator diffAnnotator)
Instantiates a new patch specifying the file name of the resulting patch and an annotator to annotate the differences.
|
Modifier and Type | Method and Description |
---|---|
void |
annotatePatch()
Annotate the whole patch.
|
void |
deleteNode(de.unirostock.sems.xmlutils.ds.TreeNode toDelete,
int chainId)
Delete a single node.
|
void |
deleteSubtree(de.unirostock.sems.xmlutils.ds.TreeNode toDelete,
int chainId)
Mark a whole subtree as deleted.
|
String |
getAnnotationDocumentXml()
Gets the annotation document encoded in XML.
|
de.unirostock.sems.comodi.ChangeFactory |
getAnnotations()
Gets the actual annotations.
|
org.jdom2.Element |
getDeletes()
Gets the deletes.
|
org.jdom2.Document |
getDocument()
Gets the document containing all changes.
|
org.jdom2.Document |
getDocument(boolean inclAnnotations)
Gets the document containing all changes.
|
org.jdom2.Element |
getInserts()
Gets the inserts.
|
org.jdom2.Element |
getMoves()
Gets the moves.
|
int |
getNumAnnotations()
Gets the number of annotations for the differences in this patch.
|
int |
getNumAttributeChanges()
Gets the number of attribute changes.
|
int |
getNumDeletes()
Gets the number of stored delete operations.
|
int |
getNumInserts()
Gets the number of stored insert operations.
|
int |
getNumMoves()
Gets the number of stored move operations.
|
int |
getNumNodeChanges()
Gets the number of node changes.
|
int |
getNumTextChanges()
Gets the number of text changes.
|
int |
getNumUpdates()
Gets the number of stored update operations.
|
org.jdom2.Element |
getUpdates()
Gets the updates.
|
int |
insertNode(de.unirostock.sems.xmlutils.ds.DocumentNode toInsert,
int chainId)
Insert a single node.
|
void |
insertNode(de.unirostock.sems.xmlutils.ds.TreeNode toInsert,
int chainId)
Insert a single node.
|
void |
insertSubtree(de.unirostock.sems.xmlutils.ds.TreeNode toInsert,
int chainId)
Mark a whole subtree as inserted.
|
void |
updateNode(NodeConnection c,
SimpleConnectionManager conMgmt)
Update a node.
|
public static URI PATCH_FILE_NAME
public Patch(URI patchFileName, DiffAnnotator diffAnnotator)
patchFileName
- the file name of the final patchdiffAnnotator
- the annotator for detected differencespublic Patch(DiffAnnotator diffAnnotator)
PATCH_FILE_NAME
.
This will result in a patch of type fullDiff.diffAnnotator
- the annotator for detected differencespublic Patch(boolean fullDiff, URI patchFileName, DiffAnnotator diffAnnotator)
fullDiff
- the fullDiff flagpatchFileName
- the file name of the final patchdiffAnnotator
- the annotator for detected differencespublic Patch(boolean fullDiff, DiffAnnotator diffAnnotator)
PATCH_FILE_NAME
.fullDiff
- the fullDiff flagdiffAnnotator
- the annotator for detected differencespublic Patch(URI patchFileName)
PATCH_FILE_NAME
.
To annotate the differences a new instance of the DefaultDiffAnnotator
will be created.
This will result in a patch of type fullDiff.patchFileName
- the file name of the final patchpublic Patch()
PATCH_FILE_NAME
.
To annotate the differences a new instance of the DefaultDiffAnnotator
will be created.
This will result in a patch of type fullDiff.public Patch(boolean fullDiff, URI patchFileName)
DefaultDiffAnnotator
will be created.fullDiff
- the fullDiff flagpatchFileName
- the file name of the final patchpublic Patch(boolean fullDiff)
PATCH_FILE_NAME
.
To annotate the differences a new instance of the DefaultDiffAnnotator
will be created.fullDiff
- the fullDiff flagpublic int getNumMoves()
public int getNumUpdates()
public int getNumDeletes()
public int getNumInserts()
public org.jdom2.Element getDeletes()
public org.jdom2.Element getInserts()
public org.jdom2.Element getUpdates()
public org.jdom2.Element getMoves()
public int getNumNodeChanges()
public int getNumTextChanges()
public int getNumAttributeChanges()
public org.jdom2.Document getDocument(boolean inclAnnotations)
inclAnnotations
is set to true the patch will have an embedded RDF subtree with annotations of the differences.inclAnnotations
- should the annotations be embedded into the patchpublic int getNumAnnotations()
public org.jdom2.Document getDocument()
public String getAnnotationDocumentXml()
public de.unirostock.sems.comodi.ChangeFactory getAnnotations()
public void deleteSubtree(de.unirostock.sems.xmlutils.ds.TreeNode toDelete, int chainId)
toDelete
- the node rooting the subtree to deletechainId
- the chain id: id of the trigger, if this modification was triggered, or <1 otherwisepublic void deleteNode(de.unirostock.sems.xmlutils.ds.TreeNode toDelete, int chainId)
toDelete
- the node to deletechainId
- the chain id: id of the trigger, if this modification was triggered, or <1 otherwisepublic void insertSubtree(de.unirostock.sems.xmlutils.ds.TreeNode toInsert, int chainId)
toInsert
- the node rooting the subtree to insertchainId
- the chain id: id of the trigger, if this modification was triggered, or <1 otherwisepublic void insertNode(de.unirostock.sems.xmlutils.ds.TreeNode toInsert, int chainId)
toInsert
- the node to insertchainId
- the chain id: id of the trigger, if this modification was triggered, or <1 otherwisepublic int insertNode(de.unirostock.sems.xmlutils.ds.DocumentNode toInsert, int chainId)
toInsert
- the document node to insertchainId
- the chain id: id of the trigger, if this modification was triggered, or <1 otherwisepublic void updateNode(NodeConnection c, SimpleConnectionManager conMgmt)
c
- the connection between the old version of the node and the new version of it.conMgmt
- the connection managerpublic void annotatePatch()
Copyright © 2019 SEMS project @ University of Rostock. All rights reserved.