gnu.caf.util
Class XMLUtils

java.lang.Object
  extended by gnu.caf.util.XMLUtils

public class XMLUtils
extends java.lang.Object

XML 관련 처리를 위한 유틸클래스로, 주로 사용할만한 메소드로는 xmlUtil.transactXMLtoHash(String) RchXmlExporter 클래스에서 내부적으로 사용하는 클래스. Export( db -> xml ) 의 경우는 RchXmlExporter 를 사용하고, Import( xml -> HashTable ) 의 경우 transactXMLtoHash 메소드를 가지고 사용함.

Author:
java3391

Nested Class Summary
 class XMLUtils.Record
           
 
Field Summary
static int ArrayListType
           
static int HashtableType
           
static int recordType1
           
static int recordType2
           
static int recordType3
           
static int recordType4
           
static int recordType5
           
 
Constructor Summary
XMLUtils()
           
XMLUtils(java.lang.String namespace, java.lang.String prefix)
           
 
Method Summary
 boolean appendParams(java.lang.String paramName, java.lang.String paramValue)
           
 boolean appendParams(java.lang.String paramName, java.lang.String paramValue, int type)
           
protected  boolean appendParamsToDefault(java.lang.String paramName, java.lang.String paramValue)
           
protected  boolean appendParamToDataSet(java.lang.String paramName, java.lang.String paramValue)
           
protected  boolean appendParamToParams(java.lang.String paramName, java.lang.String paramValue)
           
 boolean appendRecord(java.lang.String parentNodeName, java.lang.String parentKey, int recordType, org.w3c.dom.Element childElement)
           
 java.lang.String clobToString(java.sql.Clob clob)
           
 java.util.Hashtable getDataSetHashtable()
           
 org.w3c.dom.Document getDocument(java.lang.String xml)
           
protected  org.w3c.dom.traversal.NodeIterator getNodes(org.w3c.dom.Element elem, java.lang.String xPath)
           
 java.lang.String getParam(java.lang.String key)
           
 XMLUtils.Record[] getRecords(java.lang.String source)
           
static java.util.Vector getSQL(java.util.Hashtable rootHash, java.lang.String[] tables)
           
static java.lang.String[] getSQL(java.lang.Object obj, java.lang.String table, int recordType)
           
 int getTotalCount()
           
 boolean isRownumPrint()
           
 boolean isSuccess()
           
static void main(java.lang.String[] args)
           
 org.w3c.dom.Element makeElement(java.sql.ResultSet rs, int recordType)
           
 java.lang.String makeXML()
           
static void old_main(java.lang.String[] args)
           
 void setRownumPrint(boolean rownumPrint)
           
 void setTotalCount(int totalCount)
           
protected  void transactDataSet(org.w3c.dom.Element elemDataSet, java.lang.String recordType, java.util.Hashtable dataSetHash)
           
protected  void transactDataSet(org.w3c.dom.NodeList nodeList, java.lang.String subXPath, java.util.ArrayList arrListDataSet)
           
protected  void transactRecord(org.w3c.dom.Element elemRecord, java.lang.String sXPath, java.util.ArrayList arrListRecord)
           
protected  void transactRecord(org.w3c.dom.Element elemRecord, java.lang.String recordType, java.util.Hashtable recordHash)
           
 java.lang.String transactResultSet(java.sql.ResultSet rs)
           
 java.lang.Object transactXML(java.lang.String xml, int returnType)
           
 java.util.ArrayList transactXMLtoArray(java.lang.String source)
           
 java.util.Hashtable transactXMLtoHash(java.lang.String source)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

recordType1

public static final int recordType1
See Also:
Constant Field Values

recordType2

public static final int recordType2
See Also:
Constant Field Values

recordType3

public static final int recordType3
See Also:
Constant Field Values

recordType4

public static final int recordType4
See Also:
Constant Field Values

recordType5

public static final int recordType5
See Also:
Constant Field Values

ArrayListType

public static final int ArrayListType
See Also:
Constant Field Values

HashtableType

public static final int HashtableType
See Also:
Constant Field Values
Constructor Detail

XMLUtils

public XMLUtils()

XMLUtils

public XMLUtils(java.lang.String namespace,
                java.lang.String prefix)
Method Detail

clobToString

public java.lang.String clobToString(java.sql.Clob clob)

getRecords

public XMLUtils.Record[] getRecords(java.lang.String source)

makeElement

public org.w3c.dom.Element makeElement(java.sql.ResultSet rs,
                                       int recordType)

appendRecord

public boolean appendRecord(java.lang.String parentNodeName,
                            java.lang.String parentKey,
                            int recordType,
                            org.w3c.dom.Element childElement)

appendParams

public boolean appendParams(java.lang.String paramName,
                            java.lang.String paramValue,
                            int type)

appendParams

public boolean appendParams(java.lang.String paramName,
                            java.lang.String paramValue)

appendParamsToDefault

protected boolean appendParamsToDefault(java.lang.String paramName,
                                        java.lang.String paramValue)

getParam

public java.lang.String getParam(java.lang.String key)

isSuccess

public boolean isSuccess()

appendParamToParams

protected boolean appendParamToParams(java.lang.String paramName,
                                      java.lang.String paramValue)

appendParamToDataSet

protected boolean appendParamToDataSet(java.lang.String paramName,
                                       java.lang.String paramValue)

makeXML

public java.lang.String makeXML()

transactXMLtoArray

public java.util.ArrayList transactXMLtoArray(java.lang.String source)

transactDataSet

protected void transactDataSet(org.w3c.dom.NodeList nodeList,
                               java.lang.String subXPath,
                               java.util.ArrayList arrListDataSet)
                        throws java.lang.Exception
Throws:
java.lang.Exception

transactRecord

protected void transactRecord(org.w3c.dom.Element elemRecord,
                              java.lang.String sXPath,
                              java.util.ArrayList arrListRecord)

getNodes

protected org.w3c.dom.traversal.NodeIterator getNodes(org.w3c.dom.Element elem,
                                                      java.lang.String xPath)
                                               throws java.lang.Exception
Throws:
java.lang.Exception

getTotalCount

public int getTotalCount()

setTotalCount

public void setTotalCount(int totalCount)

transactResultSet

public java.lang.String transactResultSet(java.sql.ResultSet rs)

getSQL

public static java.lang.String[] getSQL(java.lang.Object obj,
                                        java.lang.String table,
                                        int recordType)

getSQL

public static java.util.Vector getSQL(java.util.Hashtable rootHash,
                                      java.lang.String[] tables)

getDocument

public org.w3c.dom.Document getDocument(java.lang.String xml)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

transactXMLtoHash

public java.util.Hashtable transactXMLtoHash(java.lang.String source)

transactDataSet

protected void transactDataSet(org.w3c.dom.Element elemDataSet,
                               java.lang.String recordType,
                               java.util.Hashtable dataSetHash)
                        throws java.lang.Exception
Throws:
java.lang.Exception

transactRecord

protected void transactRecord(org.w3c.dom.Element elemRecord,
                              java.lang.String recordType,
                              java.util.Hashtable recordHash)

transactXML

public java.lang.Object transactXML(java.lang.String xml,
                                    int returnType)
                             throws java.lang.Exception
Throws:
java.lang.Exception

getDataSetHashtable

public java.util.Hashtable getDataSetHashtable()

old_main

public static void old_main(java.lang.String[] args)
                     throws java.lang.Exception
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

isRownumPrint

public boolean isRownumPrint()

setRownumPrint

public void setRownumPrint(boolean rownumPrint)


Copyright © 2003 All Rights Reserved.