ozone core API

org.ozoneDB.core.xml
Class HashtableContentHandler

java.lang.Object
  |
  +--org.ozoneDB.core.xml.XML2ObjectContentHandler
        |
        +--org.ozoneDB.core.xml.HashtableContentHandler
All Implemented Interfaces:
Consts, org.xml.sax.ContentHandler

public class HashtableContentHandler
extends XML2ObjectContentHandler

This class handles a special part of the XML and transform it into an Hashtable.

Version:
$Revision: 1.1 $
Author:
SMB

Field Summary
protected  java.util.Stack hashEndStack
           
(package private) static int KEYMODE
           
private  int memberStartStackSize
           
private  int mode
          Mode contains the special mode (NOMODE/KEYMODE/VALUEMODE/NEXTMODE).
(package private) static int NEXTMODE
           
(package private) static int NOMODE
           
(package private) static int VALUEMODE
           
 
Fields inherited from class org.ozoneDB.core.xml.XML2ObjectContentHandler
CH, debug, delegate, locator, objCache, stack
 
Fields inherited from interface org.ozoneDB.core.xml.Consts
ATTR_ID, ATTR_NAME, ATTR_PROXY_TYPE, ATTR_REF, ATTR_TYPE, ATTR_XLINK_HREF_LOCAL, ATTR_XLINK_HREF_RAW, ATTR_XLINK_NAMESPACE, ATTR_XLINK_TYPE_LOCAL, ATTR_XLINK_TYPE_RAW, ATTR_XLINK_TYPE_VALUE, REMOTE_ID, TAG_MEMBER, TAG_OBJ, TAG_SUPERCLASS, TAG_VALUE, TAG_VALUEARRAY, TAG_VALUEOBJ
 
Constructor Summary
HashtableContentHandler()
           
HashtableContentHandler(org.xml.sax.Locator locator, java.util.Hashtable hash)
           
 
Method Summary
 java.util.Stack getStack()
          This method returns the stack.
protected  void memberEndElement()
          This methode handles the memberEndElement.
protected  void memberStartElement(org.xml.sax.Attributes atts)
          The method memberStartElement set the mode on KEYMODE, VALUEMODE or NEXTMODE if the member has the attribute name with the value "key", "value" or "next".
protected  void valueArrayEndElement()
          The method valueArrayEndElement refers to handleValueArrayEndElement if mode is on KEYMODE or VALUEMODE.
protected  void valueArrayStartElement(org.xml.sax.Attributes atts)
          The method valueArrayStartElement refers to handleValueArrayStartElement if mode is on KEYMODE or VALUEMODE.
protected  void valueEndElement()
          The method valueEndElement refers to handleValueEndElement if mode is on KEYMODE or VALUEMODE.
protected  void valueObjEndElement()
          The method valueObjEndElement refers to handleValueObjEndElement if mode is on KEYMODE or VALUEMODE.
protected  void valueObjStartElement(org.xml.sax.Attributes atts)
          The method valueObjStartElement refers to handleValueObjStartElement if mode is on KEYMODE or VALUEMODE.
 void values(char[] ch, int start, int end)
          The method values refers to handleValues if mode is on KEYMODE or VALUEMODE.
protected  void valueStartElement(org.xml.sax.Attributes atts)
          The method valueStartElement refers to handleValueStartElement if mode is on KEYMODE or VALUEMODE.
 
Methods inherited from class org.ozoneDB.core.xml.XML2ObjectContentHandler
castValue, characters, endDocument, endElement, endPrefixMapping, handleMemberEndElement, handleMemberStartElement, handleObjEndElement, handleObjStartElement, handleOzoneProxyMember, handleSuperclassEndElement, handleSuperclassStartElement, handleValueArrayEndElement, handleValueArrayStartElement, handleValueEndElement, handleValueObjEndElement, handleValueObjStartElement, handleValues, handleValueStartElement, ignorableWhitespace, objEndElement, objStartElement, processingInstruction, setDocumentLocator, showStack, skippedEntity, startDocument, startElement, startPrefixMapping, superclassEndElement, superclassStartElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hashEndStack

protected java.util.Stack hashEndStack

memberStartStackSize

private int memberStartStackSize

mode

private int mode
Mode contains the special mode (NOMODE/KEYMODE/VALUEMODE/NEXTMODE).


NOMODE

static final int NOMODE
See Also:
Constant Field Values

KEYMODE

static final int KEYMODE
See Also:
Constant Field Values

VALUEMODE

static final int VALUEMODE
See Also:
Constant Field Values

NEXTMODE

static final int NEXTMODE
See Also:
Constant Field Values
Constructor Detail

HashtableContentHandler

public HashtableContentHandler()

HashtableContentHandler

public HashtableContentHandler(org.xml.sax.Locator locator,
                               java.util.Hashtable hash)
Parameters:
locator -
hash -
Method Detail

memberStartElement

protected void memberStartElement(org.xml.sax.Attributes atts)
The method memberStartElement set the mode on KEYMODE, VALUEMODE or NEXTMODE if the member has the attribute name with the value "key", "value" or "next". And only if mode is on KEYMODE or VALUEMODE it refers to handleMemberStartElement.

Overrides:
memberStartElement in class XML2ObjectContentHandler
Parameters:
atts - (the attributes)

memberEndElement

protected void memberEndElement()
This methode handles the memberEndElement.

Overrides:
memberEndElement in class XML2ObjectContentHandler

valueStartElement

protected void valueStartElement(org.xml.sax.Attributes atts)
The method valueStartElement refers to handleValueStartElement if mode is on KEYMODE or VALUEMODE.

Overrides:
valueStartElement in class XML2ObjectContentHandler
Parameters:
atts - (the attributes)

valueEndElement

protected void valueEndElement()
The method valueEndElement refers to handleValueEndElement if mode is on KEYMODE or VALUEMODE.

Overrides:
valueEndElement in class XML2ObjectContentHandler

values

public void values(char[] ch,
                   int start,
                   int end)
The method values refers to handleValues if mode is on KEYMODE or VALUEMODE.

Overrides:
values in class XML2ObjectContentHandler
Parameters:
ch - (char-array)
start - (start of the array)
end - (end of the array)

valueObjStartElement

protected void valueObjStartElement(org.xml.sax.Attributes atts)
The method valueObjStartElement refers to handleValueObjStartElement if mode is on KEYMODE or VALUEMODE.

Overrides:
valueObjStartElement in class XML2ObjectContentHandler
Parameters:
atts - (the attributes)

valueObjEndElement

protected void valueObjEndElement()
The method valueObjEndElement refers to handleValueObjEndElement if mode is on KEYMODE or VALUEMODE.

Overrides:
valueObjEndElement in class XML2ObjectContentHandler

valueArrayStartElement

protected void valueArrayStartElement(org.xml.sax.Attributes atts)
The method valueArrayStartElement refers to handleValueArrayStartElement if mode is on KEYMODE or VALUEMODE.

Overrides:
valueArrayStartElement in class XML2ObjectContentHandler
Parameters:
atts - (the attributes)

valueArrayEndElement

protected void valueArrayEndElement()
The method valueArrayEndElement refers to handleValueArrayEndElement if mode is on KEYMODE or VALUEMODE.

Overrides:
valueArrayEndElement in class XML2ObjectContentHandler

getStack

public java.util.Stack getStack()
This method returns the stack.

Returns:
Stack

ozone core API

Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.