org.xbis.eventstore
Class EventStore

java.lang.Object
  extended byorg.xbis.eventstore.EventStore

public class EventStore
extends java.lang.Object

XML parse event store. This builds an in-memory record of the events generated by parsing a document, allowing the events to be replayed (possibly more than once) later.

Version:
1.0
Author:
Dennis M. Sosnoski

Nested Class Summary
 class EventStore.StoreReader
          Event store reader used to retrieve information from store.
 
Field Summary
static short CDSECT
           
static short COMMENT
           
static short DOCDECL
           
static short END_DOCUMENT
           
static short END_TAG
           
static short ENTITY_REF
           
static short IGNORABLE_WHITESPACE
           
static int INITIAL_CHAR_COUNT
           
static int INITIAL_EVENT_COUNT
           
static int INITIAL_NAMESPACE_COUNT
           
static int INITIAL_QNAME_COUNT
           
static int INITIAL_STRING_COUNT
           
static short PROCESSING_INSTRUCTION
           
static short START_DOCUMENT
           
static short START_NAMESPACE
           
static short START_TAG
           
static short TEXT
           
 
Constructor Summary
EventStore()
          Default constructor.
 
Method Summary
 NameImpl addQName(BasicNamespace ns, java.lang.String name)
          Create qname, adding it to store.
 void appendAttribute(BasicNamespace ns, java.lang.String name, java.lang.String value)
          Append attribute data to store.
 void appendChars(char[] buff, int offset, int length)
          Append characters to store.
 void appendElementStart(BasicNamespace ns, java.lang.String name, int acnt)
          Append element start tag event to store.
 void appendEvent(short value)
          Append value to event data store.
 int appendNs(BasicNamespace ns)
          Append namespace to store.
 int appendString(java.lang.String text)
          Append string to store.
 EventStore.StoreReader createReader()
          Create reader.
 void reset()
          Reset state information used during the serialization process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

START_DOCUMENT

public static final short START_DOCUMENT
See Also:
Constant Field Values

END_DOCUMENT

public static final short END_DOCUMENT
See Also:
Constant Field Values

START_TAG

public static final short START_TAG
See Also:
Constant Field Values

END_TAG

public static final short END_TAG
See Also:
Constant Field Values

TEXT

public static final short TEXT
See Also:
Constant Field Values

CDSECT

public static final short CDSECT
See Also:
Constant Field Values

ENTITY_REF

public static final short ENTITY_REF
See Also:
Constant Field Values

IGNORABLE_WHITESPACE

public static final short IGNORABLE_WHITESPACE
See Also:
Constant Field Values

PROCESSING_INSTRUCTION

public static final short PROCESSING_INSTRUCTION
See Also:
Constant Field Values

COMMENT

public static final short COMMENT
See Also:
Constant Field Values

DOCDECL

public static final short DOCDECL
See Also:
Constant Field Values

START_NAMESPACE

public static final short START_NAMESPACE
See Also:
Constant Field Values

INITIAL_EVENT_COUNT

public static final int INITIAL_EVENT_COUNT
See Also:
Constant Field Values

INITIAL_NAMESPACE_COUNT

public static final int INITIAL_NAMESPACE_COUNT
See Also:
Constant Field Values

INITIAL_QNAME_COUNT

public static final int INITIAL_QNAME_COUNT
See Also:
Constant Field Values

INITIAL_CHAR_COUNT

public static final int INITIAL_CHAR_COUNT
See Also:
Constant Field Values

INITIAL_STRING_COUNT

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

EventStore

public EventStore()
Default constructor.

Method Detail

reset

public void reset()
Reset state information used during the serialization process. This reinitializes the serialization state so that an instance of this class can be reused to serialize multiple independent documents.


appendEvent

public void appendEvent(short value)
Append value to event data store.

Parameters:
value - event data value

appendChars

public void appendChars(char[] buff,
                        int offset,
                        int length)
Append characters to store.

Parameters:
buff - array supplying character data
offset - starting offset in array
length - number of characters

appendString

public int appendString(java.lang.String text)
Append string to store.

Parameters:
text - string to be appended
Returns:
index number of namespace

addQName

public NameImpl addQName(BasicNamespace ns,
                         java.lang.String name)
Create qname, adding it to store.

Parameters:
ns - namespace for name
name - local name

appendNs

public int appendNs(BasicNamespace ns)
Append namespace to store.

Parameters:
ns - namespace to be appended

appendElementStart

public void appendElementStart(BasicNamespace ns,
                               java.lang.String name,
                               int acnt)
Append element start tag event to store. Appends the event type followed by the actual element name handle information, adding the element to the names table if necessary.

Parameters:
ns - element namespace information
name - local name for element
acnt - number of attributes on element

appendAttribute

public void appendAttribute(BasicNamespace ns,
                            java.lang.String name,
                            java.lang.String value)
Append attribute data to store. Appends the attribute name handle information followed by the length of the data to the event store, then appends the attribute value to the string store.

Parameters:
ns - element namespace information
name - local name for element
value - text of attribute value

createReader

public EventStore.StoreReader createReader()
Create reader.

Returns:
reader for event store data


Company Web Site

XML Binary Information Set Home