TextModification provider.
More...
|
static ArrayList
< TextModification > | getTextModifications (String oldVersion, String newVersion, int highestProtocol) throws ParserConfigurationException, SAXException, IOException |
|
static ArrayList
< TextModification > | getTextModifications (Document oldVersion, Document newVersion, int highestProtocol) throws SAXException, IOException |
|
static String | nodeToString (Node root) |
|
static String | attributeToString (NamedNodeMap attributes) |
|
static void | removeNode (LinkedHashMap< String, TextModification > pathModMap, NodeDetail removeNode, int highestProtocol, Document newVersion) |
|
static boolean | replaceFirstParentNode (LinkedHashMap< String, TextModification > pathModMap, NodeDetail replaceNodeDetail, Document version, boolean replaceByDocumentNode) |
|
static void | replaceNode (LinkedHashMap< String, TextModification > pathModMap, NodeDetail replaceNodeDetail) |
|
|
static TextModification | exchangeWholeBody (Document newVersion) |
|
static Node | lastSiblingNode (Node node) |
|
static boolean | existsParentMod (LinkedHashMap< String, TextModification > pathModMap, String XPath) |
|
static void | removeAllChildMods (LinkedHashMap< String, TextModification > pathModMap, String XPath) |
|
static Node | getFirstPreviousNodeExistingInDoc (Node testedNode, Document version) |
|
static boolean | isNodeNotTextAndNotBRHR (Node testedNode) |
|
static Node | getParentIfExists (Document oldVersion, Node child) |
|
static Node | getNodeIfExists (Document version, Node node) |
|
static Node | getNodeIfExists (Document version, String XPath) |
|
static boolean | addNode (int highestProtocol, LinkedHashMap< String, TextModification > pathModMap, NodeDetail addNodeDetail, Document oldVersion) |
|
TextModification provider.
Class for providing TextModification differences between two versions of document
- Author
- xkubik22
Definition at line 53 of file TextModificationsXMLUnitProvider.java.
static boolean cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.addNode |
( |
int |
highestProtocol, |
|
|
LinkedHashMap< String, TextModification > |
pathModMap, |
|
|
NodeDetail |
addNodeDetail, |
|
|
Document |
oldVersion |
|
) |
| |
|
staticprivate |
Creates a TextModification that adds a node
- Parameters
-
highestProtocol | highest available protocol version |
pathModMap | Map of the created text modifications |
addNodeDetail | Node for add |
oldVersion | Old version of the document |
- Returns
- True if success, otherwise false
Definition at line 467 of file TextModificationsXMLUnitProvider.java.
static String cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.attributeToString |
( |
NamedNodeMap |
attributes | ) |
|
|
static |
static TextModification cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.exchangeWholeBody |
( |
Document |
newVersion | ) |
|
|
staticprivate |
Returns a text modification on whole body element
- Parameters
-
newVersion | New version of the document |
- Returns
- text modification on whole body element
Definition at line 232 of file TextModificationsXMLUnitProvider.java.
static boolean cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.existsParentMod |
( |
LinkedHashMap< String, TextModification > |
pathModMap, |
|
|
String |
XPath |
|
) |
| |
|
staticprivate |
Method that checks if there already exists a TextModification for some element or it's parent modification.
- Parameters
-
pathModMap | Map of the created text modifications |
XPath | XPath of the element |
- Returns
- true if exists otherwise false
Definition at line 333 of file TextModificationsXMLUnitProvider.java.
static Node cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.getFirstPreviousNodeExistingInDoc |
( |
Node |
testedNode, |
|
|
Document |
version |
|
) |
| |
|
staticprivate |
Method gets the first previous node of some node that exists in a version of the document
- Parameters
-
testedNode | Node fot getting it's previous node |
version | Version of a document |
- Returns
- Previous node or null
Definition at line 368 of file TextModificationsXMLUnitProvider.java.
static Node cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.getNodeIfExists |
( |
Document |
version, |
|
|
Node |
node |
|
) |
| |
|
staticprivate |
Gets the element in the version of the document
- Parameters
-
version | A Version of the document |
node | node in the version |
- Returns
- Node if exists or null
Definition at line 429 of file TextModificationsXMLUnitProvider.java.
static Node cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.getNodeIfExists |
( |
Document |
version, |
|
|
String |
XPath |
|
) |
| |
|
staticprivate |
Gets the element in the version of the document
- Parameters
-
version | A version of the document |
XPath | XPath in the version |
- Returns
- Node if exists or null
Definition at line 448 of file TextModificationsXMLUnitProvider.java.
static Node cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.getParentIfExists |
( |
Document |
oldVersion, |
|
|
Node |
child |
|
) |
| |
|
staticprivate |
Gets the parent element in the oldVersion
- Parameters
-
oldVersion | Old version of the document |
child | Child node for getting the parent node |
- Returns
- Parent node if exists or null
Definition at line 405 of file TextModificationsXMLUnitProvider.java.
static ArrayList<TextModification> cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.getTextModifications |
( |
String |
oldVersion, |
|
|
String |
newVersion, |
|
|
int |
highestProtocol |
|
) |
| throws ParserConfigurationException, SAXException, IOException |
|
static |
Provides the TextModifications
- Parameters
-
oldVersion | Old version of the document |
newVersion | New version of the document |
highestProtocol | Highest available protocol version |
- Returns
- New TextModifications
- Exceptions
-
ParserConfigurationException | |
SAXException | |
IOException | |
Definition at line 67 of file TextModificationsXMLUnitProvider.java.
static ArrayList<TextModification> cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.getTextModifications |
( |
Document |
oldVersion, |
|
|
Document |
newVersion, |
|
|
int |
highestProtocol |
|
) |
| throws SAXException, IOException |
|
static |
Provides the TextModifications
- Parameters
-
oldVersion | Old version of the document |
newVersion | New version of the document |
highestProtocol | Highest available protocol version |
- Returns
- New TextModifications
- Exceptions
-
Comparing 2 nodes with different node types
Definition at line 92 of file TextModificationsXMLUnitProvider.java.
static boolean cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.isNodeNotTextAndNotBRHR |
( |
Node |
testedNode | ) |
|
|
staticprivate |
Method that test if some node is not a text node and not a br or a hr element
- Parameters
-
- Returns
- True if node is a text node or a br or a hr element. Otherwise false.
Definition at line 389 of file TextModificationsXMLUnitProvider.java.
static Node cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.lastSiblingNode |
( |
Node |
node | ) |
|
|
staticprivate |
static String cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.nodeToString |
( |
Node |
root | ) |
|
|
static |
static void cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.removeAllChildMods |
( |
LinkedHashMap< String, TextModification > |
pathModMap, |
|
|
String |
XPath |
|
) |
| |
|
staticprivate |
Method that removes all child modifications of some element
- Parameters
-
pathModMap | Map of the created text modifications |
XPath | XPath of the element |
Definition at line 351 of file TextModificationsXMLUnitProvider.java.
static void cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.removeNode |
( |
LinkedHashMap< String, TextModification > |
pathModMap, |
|
|
NodeDetail |
removeNode, |
|
|
int |
highestProtocol, |
|
|
Document |
newVersion |
|
) |
| |
|
static |
Creates a TextModification that removes a node
- Parameters
-
pathModMap | Map of the created text modifications |
removeNode | Node for removal |
highestProtocol | highest available protocol version |
newVersion | New version of the document |
Definition at line 580 of file TextModificationsXMLUnitProvider.java.
static boolean cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.replaceFirstParentNode |
( |
LinkedHashMap< String, TextModification > |
pathModMap, |
|
|
NodeDetail |
replaceNodeDetail, |
|
|
Document |
version, |
|
|
boolean |
replaceByDocumentNode |
|
) |
| |
|
static |
Method creates a TextModification that replaces a parent node of some node Replaced parent node must exist in the version of the document
- Parameters
-
pathModMap | Map of the created text modifications |
replaceNodeDetail | Node for it's parent replace |
version | Version of the document where the parent must exist |
replaceByDocumentNode | If true then parent is replaced by the parent node from the version of the document (variable version). If true then the parent node is replaced by the specified Node (variable replaceNodeDetail) parent. |
- Returns
- True if success, otherwise false
Definition at line 614 of file TextModificationsXMLUnitProvider.java.
static void cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.replaceNode |
( |
LinkedHashMap< String, TextModification > |
pathModMap, |
|
|
NodeDetail |
replaceNodeDetail |
|
) |
| |
|
static |
Method creates a TextModification that replaces a node
- Parameters
-
pathModMap | Map of the created text modifications |
replaceNodeDetail | Node for replacement |
Definition at line 655 of file TextModificationsXMLUnitProvider.java.
The documentation for this class was generated from the following file: