it.unimo.dbgroup.momis.XmlTools
Class BaseXmlTools

java.lang.Object
  extended byit.unimo.dbgroup.momis.XmlTools.BaseXmlTools
Direct Known Subclasses:
BaseObjectDomStreamer, DomNavigator

public class BaseXmlTools
extends java.lang.Object

Base class for all XmlTools.

It provides some shared constants usefull to understand the Xml input or output that must be processed. It also provide basic debug methods to raise exceptions, to convert elements to String or to write debug messages.

Author:
Davide Lenzi nov 2000

Field Summary
static boolean _debug
          Tells if debug messages are Enabled or disabled.
(package private) static int ATTR_TYPE
           
static java.lang.String attrArrayLength
           
static java.lang.String attrBalanced
           
static java.lang.String attrClassName
           
static java.lang.String attrClassNameAsTagName
           
static java.lang.String attrDescr
           
static java.lang.String attrField
           
static java.lang.String attrFullClassNameAsAttribute
           
static java.lang.String attrFullJavaClassName
           
static java.lang.String attrObjectArchive
           
static java.lang.String attrObjectID
           
static java.lang.String attrObjectREF
           
static java.lang.String attrSUID
           
static java.lang.String attrValue
           
(package private) static int CDATA_TYPE
           
(package private) static int COMMENT_TYPE
           
(package private) static int DOCFRAG_TYPE
           
(package private) static int DOCTYPE_TYPE
           
(package private) static int DOCUMENT_TYPE
           
(package private) static int ELEMENT_TYPE
           
(package private) static int ENTITY_TYPE
           
(package private) static int ENTITYREF_TYPE
           
static java.lang.String metaNameSpace
           
(package private) static int NOTATION_TYPE
           
(package private) static int PROCINSTR_TYPE
           
static java.lang.String tagArray
           
static java.lang.String tagBoolean
           
static java.lang.String tagByte
           
static java.lang.String tagChar
           
static java.lang.String tagDouble
           
static java.lang.String tagEndDefaultData
           
static java.lang.String tagFloat
           
static java.lang.String tagInt
           
static java.lang.String tagLong
           
static java.lang.String tagMapEntry
           
static java.lang.String tagMeta
           
static java.lang.String tagNull
           
static java.lang.String tagObject
           
static java.lang.String tagShort
           
static java.lang.String tagSUIDEntry
           
static java.lang.String tagSuperclass
           
(package private) static int TEXT_TYPE
           
 
Constructor Summary
protected BaseXmlTools()
          Default constructor.
 
Method Summary
static void debug(java.lang.String msg)
          Writes a debug message to the standard output.
 java.lang.String getElementString(org.w3c.dom.Element el)
          Returns a simple string representation of element el.
protected  void throwNodeException(java.lang.String message, org.w3c.dom.Node nd)
          Creates and throw an XmlToolsException related to a DOM tree node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_debug

public static final boolean _debug
Tells if debug messages are Enabled or disabled.

See Also:
Constant Field Values

ELEMENT_TYPE

static final int ELEMENT_TYPE
See Also:
Constant Field Values

ATTR_TYPE

static final int ATTR_TYPE
See Also:
Constant Field Values

TEXT_TYPE

static final int TEXT_TYPE
See Also:
Constant Field Values

CDATA_TYPE

static final int CDATA_TYPE
See Also:
Constant Field Values

ENTITYREF_TYPE

static final int ENTITYREF_TYPE
See Also:
Constant Field Values

ENTITY_TYPE

static final int ENTITY_TYPE
See Also:
Constant Field Values

PROCINSTR_TYPE

static final int PROCINSTR_TYPE
See Also:
Constant Field Values

COMMENT_TYPE

static final int COMMENT_TYPE
See Also:
Constant Field Values

DOCUMENT_TYPE

static final int DOCUMENT_TYPE
See Also:
Constant Field Values

DOCTYPE_TYPE

static final int DOCTYPE_TYPE
See Also:
Constant Field Values

DOCFRAG_TYPE

static final int DOCFRAG_TYPE
See Also:
Constant Field Values

NOTATION_TYPE

static final int NOTATION_TYPE
See Also:
Constant Field Values

tagArray

public static final java.lang.String tagArray
See Also:
Constant Field Values

tagObject

public static final java.lang.String tagObject
See Also:
Constant Field Values

tagSuperclass

public static final java.lang.String tagSuperclass
See Also:
Constant Field Values

tagNull

public static final java.lang.String tagNull
See Also:
Constant Field Values

tagInt

public static final java.lang.String tagInt
See Also:
Constant Field Values

tagFloat

public static final java.lang.String tagFloat
See Also:
Constant Field Values

tagDouble

public static final java.lang.String tagDouble
See Also:
Constant Field Values

tagLong

public static final java.lang.String tagLong
See Also:
Constant Field Values

tagByte

public static final java.lang.String tagByte
See Also:
Constant Field Values

tagShort

public static final java.lang.String tagShort
See Also:
Constant Field Values

tagChar

public static final java.lang.String tagChar
See Also:
Constant Field Values

tagBoolean

public static final java.lang.String tagBoolean
See Also:
Constant Field Values

tagMapEntry

public static final java.lang.String tagMapEntry
See Also:
Constant Field Values

tagEndDefaultData

public static final java.lang.String tagEndDefaultData
See Also:
Constant Field Values

tagSUIDEntry

public static final java.lang.String tagSUIDEntry
See Also:
Constant Field Values

tagMeta

public static final java.lang.String tagMeta
See Also:
Constant Field Values

attrClassName

public static final java.lang.String attrClassName
See Also:
Constant Field Values

attrArrayLength

public static final java.lang.String attrArrayLength
See Also:
Constant Field Values

attrObjectArchive

public static final java.lang.String attrObjectArchive
See Also:
Constant Field Values

attrFullJavaClassName

public static final java.lang.String attrFullJavaClassName
See Also:
Constant Field Values

attrClassNameAsTagName

public static final java.lang.String attrClassNameAsTagName
See Also:
Constant Field Values

attrFullClassNameAsAttribute

public static final java.lang.String attrFullClassNameAsAttribute
See Also:
Constant Field Values

attrObjectID

public static final java.lang.String attrObjectID
See Also:
Constant Field Values

attrObjectREF

public static final java.lang.String attrObjectREF
See Also:
Constant Field Values

attrField

public static final java.lang.String attrField
See Also:
Constant Field Values

attrValue

public static final java.lang.String attrValue
See Also:
Constant Field Values

attrDescr

public static final java.lang.String attrDescr
See Also:
Constant Field Values

attrBalanced

public static final java.lang.String attrBalanced
See Also:
Constant Field Values

attrSUID

public static final java.lang.String attrSUID
See Also:
Constant Field Values

metaNameSpace

public static final java.lang.String metaNameSpace
See Also:
Constant Field Values
Constructor Detail

BaseXmlTools

protected BaseXmlTools()
Default constructor.

Method Detail

throwNodeException

protected void throwNodeException(java.lang.String message,
                                  org.w3c.dom.Node nd)
                           throws XmlToolsException
Creates and throw an XmlToolsException related to a DOM tree node.

Parameters:
message - Message error for the exception.
nd - Node where the exception took origin.
Throws:
XmlToolsException

getElementString

public java.lang.String getElementString(org.w3c.dom.Element el)
Returns a simple string representation of element el.

The Element.toString() method generate the XML representation of the element with all child elements included, this method will report the parent tag only.

Usefull for error messages or debug messages.

Parameters:
el - DOM Element to represent as String.
Returns:
The String representation.

debug

public static void debug(java.lang.String msg)
Writes a debug message to the standard output.

Use the _debug flags to enable or disable the debug messages.



Universita' di Modena e Reggio Emilia