log4plsql.backgroundProcess
Class XmlConfig

java.lang.Object
  extended bylog4plsql.backgroundProcess.XmlConfig

public class XmlConfig
extends java.lang.Object

use for load, parse and read a XML propeties file

Since:
LOG4PLSQL NEW IN V2.0
Version:
2b
Author:
guillaume Moulard

Constructor Summary
XmlConfig(java.lang.String configFileName)
          XMLDocument initialisation
XmlConfig(oracle.xml.parser.v2.XMLNode node)
           
 
Method Summary
static oracle.xml.parser.v2.XMLNode getNode(java.lang.String xPathPattern)
           
static java.lang.String getXpathParam(java.lang.String xPathPattern)
           
static java.lang.String getXpathParam(java.lang.String xPathPattern, java.lang.String defaultValue)
          return a string in xPathPattern place
see : http://www.w3.org/TR/xpath
for all posible use
static void main(java.lang.String[] argv)
          don't use in normal case
Is possible to use for : testing
exemple : java.exe log4plsql.XmlConfig yourXMLFile

In this case, you have a list off possible call Exemple :

(nice for cut and past in the java code.)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlConfig

public XmlConfig(java.lang.String configFileName)
XMLDocument initialisation


XmlConfig

public XmlConfig(oracle.xml.parser.v2.XMLNode node)
Method Detail

getXpathParam

public static java.lang.String getXpathParam(java.lang.String xPathPattern)

getXpathParam

public static java.lang.String getXpathParam(java.lang.String xPathPattern,
                                             java.lang.String defaultValue)
return a string in xPathPattern place
see : http://www.w3.org/TR/xpath
for all posible use


getNode

public static oracle.xml.parser.v2.XMLNode getNode(java.lang.String xPathPattern)

main

public static void main(java.lang.String[] argv)
don't use in normal case
Is possible to use for : testing
exemple : java.exe log4plsql.XmlConfig yourXMLFile

In this case, you have a list off possible call Exemple :

(nice for cut and past in the java code.)

--- My XML File ----------









ulog
ulog
jdbc:oracle:thin:@localhost:1521:ORATEST
oracle.jdbc.driver.OracleDriver









--- resutl ---------------
private static XmlConfig xmlConfig;
xmlConfig = new XmlConfig(log4plsqlProperties);
String myParam = xmlConfig.getXpathParam("/log4plsql/log4j/typeConfigurator/@confType", "NotExiste"); // = DOMConfigurator
String myParam = xmlConfig.getXpathParam("/log4plsql/log4j/fileName/@name", "NotExiste"); // = .\\properties\\log4j.xml
String myParam = xmlConfig.getXpathParam("/log4plsql/database/source/connection/@name", "NotExiste"); // = demo
String myParam = xmlConfig.getXpathParam("/log4plsql/database/source/connection/username/text()", "NotExiste"); // = ulog
String myParam = xmlConfig.getXpathParam("/log4plsql/database/source/connection/password/text()", "NotExiste"); // = ulog
String myParam = xmlConfig.getXpathParam("/log4plsql/database/source/connection/dburl/text()", "NotExiste"); // = jdbc:oracle:thin:@localhost:1521:ORATEST
String myParam = xmlConfig.getXpathParam("/log4plsql/database/source/connection/driver/text()", "NotExiste"); // = oracle.jdbc.driver.OracleDriver
String myParam = xmlConfig.getXpathParam("/log4plsql/paramAction/action/@name", "NotExiste"); // = deleteInDatabase
String myParam = xmlConfig.getXpathParam("/log4plsql/paramAction/action/@value", "NotExiste"); // = N
--------------------------