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

Document update Helper. More...

Collaboration diagram for cz.vutbr.fit.knot.annotations.document.DocumentUpdateHelper:
Collaboration graph

Static Public Member Functions

static Node getDocumentNode (Document doc, String path)
 
static String getNodePathForReversed (String xpath, Node sourceNode, String childNodeName, int mode)
 
static String nodeToString (Node root)
 
static String nodeAttributesToString (NamedNodeMap map)
 
static void sortModifications (ArrayList< TextModification > list)
 
static void removeListElements (ArrayList< TextModification > list, int start, int end)
 

Detailed Description

Document update Helper.

Document update helper class which contains methods necessary to provide modification process

Author
Jan Paulovcak (xpaulo00 at stud.fit.vutbr.cz)

Definition at line 38 of file DocumentUpdateHelper.java.

Member Function Documentation

static Node cz.vutbr.fit.knot.annotations.document.DocumentUpdateHelper.getDocumentNode ( Document  doc,
String  path 
)
static

Search for a node with exact Xpath within a given document

Parameters
docDocument in which method will search for a node
pathXpath of node
Returns
Returns node on success, null otherwise

Definition at line 48 of file DocumentUpdateHelper.java.

static String cz.vutbr.fit.knot.annotations.document.DocumentUpdateHelper.getNodePathForReversed ( String  xpath,
Node  sourceNode,
String  childNodeName,
int  mode 
)
static

Creates XPath for node that will be used in reversed modifications

It uses name of child node as a stopper while counting number of nodes with the same name

Parameters
xpathXPath of source node
sourceNodeNode used in modification
childNodeNameNode name of child node
modeMode of text modification

Definition at line 73 of file DocumentUpdateHelper.java.

static String cz.vutbr.fit.knot.annotations.document.DocumentUpdateHelper.nodeAttributesToString ( NamedNodeMap  map)
static

Converts all node's attributes into string form

Parameters
mapMap with attributes
Returns
Returns attributes in string form

Definition at line 164 of file DocumentUpdateHelper.java.

Here is the caller graph for this function:

static String cz.vutbr.fit.knot.annotations.document.DocumentUpdateHelper.nodeToString ( Node  root)
static

Converts node into string form

Parameters
rootNode to convert
Returns
Returns node in string form

Definition at line 117 of file DocumentUpdateHelper.java.

Here is the call graph for this function:

static void cz.vutbr.fit.knot.annotations.document.DocumentUpdateHelper.removeListElements ( ArrayList< TextModification list,
int  start,
int  end 
)
static

Removes unnecessary elements from array list

Parameters
listArray list of elements
startStart position
endEnd position

Definition at line 206 of file DocumentUpdateHelper.java.

static void cz.vutbr.fit.knot.annotations.document.DocumentUpdateHelper.sortModifications ( ArrayList< TextModification list)
static

Sorts list of modifications based upon two criteriums First is to sort XPaths alphabetically, in descending order Second is applied only in case that XPaths are the same, then the modification with higher priority will be first Priority levels of modifications are set within Constants module

Parameters
listList of modifications

Definition at line 185 of file DocumentUpdateHelper.java.

Here is the call graph for this function:


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