eu.bootstrep.JdomMethods
Class ManageJdom

java.lang.Object
  extended by eu.bootstrep.JdomMethods.ManageJdom

public class ManageJdom
extends java.lang.Object

The ManageJdom class contains methods to access and parse an XML file.
This class is responsible for


Field Summary
(package private)  DbMethods DB
          An instance on DbMethods Class.
(package private)  Logger Log
          An instance of Logger Class
(package private)  TheElement mainElem
          An instance of the TheElement bean.
(package private)  WorkDictionary WD
          An instance of WorkDictionary Class.
 
Constructor Summary
ManageJdom()
          Creates a new instance of ManageJdom
 
Method Summary
private  java.lang.String[] extractFromBitMap(java.lang.String[][] lObj, java.lang.Integer pos)
          This method returns an array with values contained at column position pos.
 void findAttribute(java.lang.String[][] lObj, java.lang.String[][] fatlObj, PropertyBean PB, MainBean MB, MessageBean mesBn, ListBean LB, org.jdom.Element elem, org.jdom.Element theParent, org.jdom.Element theGranParent, java.lang.String theFile, java.lang.String theRelFile, java.lang.Integer deep, java.lang.Integer bitMap)
          This method extracts attributes along with their values from XIF-XML elements.
Depending on bitMap value, element attributes are concatenate with father and/or granfather attributes.
 org.jdom.Element getRoot(PropertyBean PB, MainBean MB, MessageBean mesBn, ListBean LB, org.jdom.Document doc)
          This method retrieves the root element of XML input file.
private  java.lang.Boolean isNotPresent(java.util.ArrayList list, java.lang.String supp)
          This method checks whether the string supp is already in the list list
 void loadNode(PropertyBean PB, MainBean MB, MessageBean mesBn, ListBean LB, TableBean tabBn, org.jdom.Element elem, java.lang.Integer deep)
          This method loads the node and parse it.
 org.jdom.Document parseDocument(PropertyBean PB, MainBean MB, MessageBean mesBn, ListBean LB, java.lang.Boolean validate)
          This method builds a JDOM Document from the input XML file.
This method uses the JDOM libraries to parse the input document and create a valid JDOM document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Log

Logger Log
An instance of Logger Class


DB

DbMethods DB
An instance on DbMethods Class.


WD

WorkDictionary WD
An instance of WorkDictionary Class.


mainElem

TheElement mainElem
An instance of the TheElement bean.

Constructor Detail

ManageJdom

public ManageJdom()
Creates a new instance of ManageJdom

Method Detail

parseDocument

public org.jdom.Document parseDocument(PropertyBean PB,
                                       MainBean MB,
                                       MessageBean mesBn,
                                       ListBean LB,
                                       java.lang.Boolean validate)
This method builds a JDOM Document from the input XML file.
This method uses the JDOM libraries to parse the input document and create a valid JDOM document.
The input file is retrieved using the PB.getXmlFileName

Parameters:
PB - PropertyBean
MB - mainBean
LB - ListBean
mesBn - MessageBean
validate - A boolean: true to validate
Returns:
A valid JDom Document

getRoot

public org.jdom.Element getRoot(PropertyBean PB,
                                MainBean MB,
                                MessageBean mesBn,
                                ListBean LB,
                                org.jdom.Document doc)
This method retrieves the root element of XML input file.
The doc parameter is the XML document parsed in the parseDocument method

Parameters:
PB - PropertyBean
MB - MainBean
mesBn - MessageBean
LB - ListBean
doc - The JDOM document
Returns:
The root element or null

isNotPresent

private java.lang.Boolean isNotPresent(java.util.ArrayList list,
                                       java.lang.String supp)
This method checks whether the string supp is already in the list list

Parameters:
list - The checked list
supp - The input string
Returns:
true if the string supp is in the list list

loadNode

public void loadNode(PropertyBean PB,
                     MainBean MB,
                     MessageBean mesBn,
                     ListBean LB,
                     TableBean tabBn,
                     org.jdom.Element elem,
                     java.lang.Integer deep)
This method loads the node and parse it. This method performs the following steps:

Parameters:
PB - PropertyBean
MB - MainBean
mesBn - MessageBean
LB - ListBean
tabBn - TableBean
elem - The element
deep - The indentation of the input element

findAttribute

public void findAttribute(java.lang.String[][] lObj,
                          java.lang.String[][] fatlObj,
                          PropertyBean PB,
                          MainBean MB,
                          MessageBean mesBn,
                          ListBean LB,
                          org.jdom.Element elem,
                          org.jdom.Element theParent,
                          org.jdom.Element theGranParent,
                          java.lang.String theFile,
                          java.lang.String theRelFile,
                          java.lang.Integer deep,
                          java.lang.Integer bitMap)
This method extracts attributes along with their values from XIF-XML elements.
Depending on bitMap value, element attributes are concatenate with father and/or granfather attributes. This method fills an hashTable whose key is the file containing data to load into staging and correspondence tables. The value of the hashTable is the content of such files.

Parameters:
lObj - The object which shapes the element. This parameter is linked to records in the WORK_DITMAP_ID_TABLE. If bitMap is 0, this object contains data about the granparent of the element.
fatlObj - The object which shapes the father element. This parameter is linked to records in the WORK_DITMAP_ID_TABLE
PB - The PropertyBean
MB - The MainBean
mesBn - The MessageBean
LB - The ListBean
elem - The input element
theParent - The parent of input element
theGranParent - The granparent of input element
theFile - Input file containing data for staging tables. File name is equal to element name
theRelFile - Input file containing data for correndondence staging tables. File name is equal to table name
deep - The indentation of element elem
bitMap - The bitMap of element elem

extractFromBitMap

private java.lang.String[] extractFromBitMap(java.lang.String[][] lObj,
                                             java.lang.Integer pos)
This method returns an array with values contained at column position pos.
The array is the pos-th column of lObj.

Parameters:
lObj - The input object
pos - The column, the method will extract from lObj
Returns:
an array with values contained at column position pos