4A Server -  2.0
 All Classes Namespaces Files Functions Variables Enumerator
cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider Class Reference

TextModification provider. More...

Collaboration diagram for cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider:
Collaboration graph

Static Public Member Functions

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 Private Member Functions

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)
 

Detailed Description

TextModification provider.

Class for providing TextModification differences between two versions of document

Author
xkubik22

Definition at line 53 of file TextModificationsXMLUnitProvider.java.

Member Function Documentation

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
highestProtocolhighest available protocol version
pathModMapMap of the created text modifications
addNodeDetailNode for add
oldVersionOld version of the document
Returns
True if success, otherwise false

Definition at line 467 of file TextModificationsXMLUnitProvider.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static String cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.attributeToString ( NamedNodeMap  attributes)
static

Converts attribute map into string

Parameters
attributesAttribute map for conversion
Returns
Attribute converted to string

Definition at line 288 of file TextModificationsXMLUnitProvider.java.

Here is the caller graph for this function:

static TextModification cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.exchangeWholeBody ( Document  newVersion)
staticprivate

Returns a text modification on whole body element

Parameters
newVersionNew version of the document
Returns
text modification on whole body element

Definition at line 232 of file TextModificationsXMLUnitProvider.java.

Here is the call graph for this function:

Here is the caller graph for this function:

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
pathModMapMap of the created text modifications
XPathXPath of the element
Returns
true if exists otherwise false

Definition at line 333 of file TextModificationsXMLUnitProvider.java.

Here is the caller graph for this function:

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
testedNodeNode fot getting it's previous node
versionVersion of a document
Returns
Previous node or null

Definition at line 368 of file TextModificationsXMLUnitProvider.java.

Here is the caller graph for this function:

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
versionA Version of the document
nodenode in the version
Returns
Node if exists or null

Definition at line 429 of file TextModificationsXMLUnitProvider.java.

Here is the caller graph for this function:

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
versionA version of the document
XPathXPath 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
oldVersionOld version of the document
childChild node for getting the parent node
Returns
Parent node if exists or null

Definition at line 405 of file TextModificationsXMLUnitProvider.java.

Here is the caller graph for this function:

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
oldVersionOld version of the document
newVersionNew version of the document
highestProtocolHighest 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
oldVersionOld version of the document
newVersionNew version of the document
highestProtocolHighest available protocol version
Returns
New TextModifications
Exceptions
SAXException
IOException

Comparing 2 nodes with different node types

Definition at line 92 of file TextModificationsXMLUnitProvider.java.

Here is the call graph for this function:

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
testedNodeNode for test
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.

Here is the caller graph for this function:

static Node cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.lastSiblingNode ( Node  node)
staticprivate

Method that gets the last sibling of the node

Parameters
nodeNode for sibling
Returns
Last sibling

Definition at line 317 of file TextModificationsXMLUnitProvider.java.

static String cz.vutbr.fit.knot.annotations.textModifications.TextModificationsXMLUnitProvider.nodeToString ( Node  root)
static

Converts node into string form

Parameters
rootNode to convert
Returns
Returns node in string form

Definition at line 249 of file TextModificationsXMLUnitProvider.java.

Here is the call graph for this function:

Here is the caller graph for this function:

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
pathModMapMap of the created text modifications
XPathXPath of the element

Definition at line 351 of file TextModificationsXMLUnitProvider.java.

Here is the caller graph for this function:

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
pathModMapMap of the created text modifications
removeNodeNode for removal
highestProtocolhighest available protocol version
newVersionNew version of the document

Definition at line 580 of file TextModificationsXMLUnitProvider.java.

Here is the call graph for this function:

Here is the caller graph for this function:

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
pathModMapMap of the created text modifications
replaceNodeDetailNode for it's parent replace
versionVersion of the document where the parent must exist
replaceByDocumentNodeIf 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.

Here is the call graph for this function:

Here is the caller graph for this function:

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
pathModMapMap of the created text modifications
replaceNodeDetailNode for replacement

Definition at line 655 of file TextModificationsXMLUnitProvider.java.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: