Qizx/Open v0.4

net.xfra.qizxopen.dm
Class XMLEventReceiverBase

java.lang.Object
  |
  +--net.xfra.qizxopen.dm.XMLEventReceiverBase
All Implemented Interfaces:
XMLEventReceiver
Direct Known Subclasses:
EventDrivenBuilder, SAXEventReceiver, XMLSerializer

public abstract class XMLEventReceiverBase
extends java.lang.Object
implements XMLEventReceiver

An abstract receiver of SAX-like events.

Manages namespaces. Used as a base for serialization and SAX output.


Constructor Summary
XMLEventReceiverBase()
           
 
Method Summary
 void attribute(QName name, java.lang.String value)
          Adds an attribute on the current element.
 void definePrefixHints(NSPrefixMapping prefixes)
          Optional: defines a preferred prefix/namespace mapping for serialization.
 void endDocument()
          Ends a document.
 void endElement(QName name)
          Ends an element.
 boolean maxVolumeReached()
           
 void namespace(java.lang.String prefix, java.lang.String uri)
          Adds a namespace node on the current element.
 void reset()
          Resets the state prior to use startDocument() or startElement().
 java.lang.String resolvePrefix(java.lang.String prefix)
          Resolves a prefix to an URI in the context of the current node.
 void setMaxVolume(int volume)
           
 void setTrace(boolean value)
           
 void startDocument()
          Starts a document.
 void startElement(QName name)
          Starts an element.
 void terminate()
          Terminates a document or simple subtree.
 void traverse(Node node, boolean inScopeNS)
          Traverse and generate a subtree.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.xfra.qizxopen.dm.XMLEventReceiver
atom, comment, pi, text
 

Constructor Detail

XMLEventReceiverBase

public XMLEventReceiverBase()
Method Detail

definePrefixHints

public void definePrefixHints(NSPrefixMapping prefixes)
Description copied from interface: XMLEventReceiver
Optional: defines a preferred prefix/namespace mapping for serialization. This table is used when no mapping is in scope in the current context.

Specified by:
definePrefixHints in interface XMLEventReceiver

setTrace

public void setTrace(boolean value)

setMaxVolume

public void setMaxVolume(int volume)

maxVolumeReached

public boolean maxVolumeReached()

reset

public void reset()
Description copied from interface: XMLEventReceiver
Resets the state prior to use startDocument() or startElement().

Specified by:
reset in interface XMLEventReceiver

terminate

public void terminate()
               throws DataModelException
Description copied from interface: XMLEventReceiver
Terminates a document or simple subtree. May perform consistency checks.

Specified by:
terminate in interface XMLEventReceiver
DataModelException

startDocument

public void startDocument()
                   throws DataModelException
Description copied from interface: XMLEventReceiver
Starts a document.

It is not called in the case only a fragment is generated.

Specified by:
startDocument in interface XMLEventReceiver
DataModelException

endDocument

public void endDocument()
                 throws DataModelException
Description copied from interface: XMLEventReceiver
Ends a document. Must be balanced by a matching startDocument().

Specified by:
endDocument in interface XMLEventReceiver
DataModelException

startElement

public void startElement(QName name)
                  throws DataModelException
Description copied from interface: XMLEventReceiver
Starts an element. Must be balanced by a matching endElement().

Specified by:
startElement in interface XMLEventReceiver
DataModelException

namespace

public void namespace(java.lang.String prefix,
                      java.lang.String uri)
               throws DataModelException
Description copied from interface: XMLEventReceiver
Adds a namespace node on the current element. Must follow startElement and precede any child. May be interleaved with attribute().

Specified by:
namespace in interface XMLEventReceiver
DataModelException

attribute

public void attribute(QName name,
                      java.lang.String value)
               throws DataModelException
Description copied from interface: XMLEventReceiver
Adds an attribute on the current element. Must follow startElement and precede any child. May be interleaved with namespace().

Specified by:
attribute in interface XMLEventReceiver
DataModelException

endElement

public void endElement(QName name)
                throws DataModelException
Description copied from interface: XMLEventReceiver
Ends an element. Discards prefix/namespace mappings possibly defined by the element.

Specified by:
endElement in interface XMLEventReceiver
DataModelException

resolvePrefix

public java.lang.String resolvePrefix(java.lang.String prefix)
Description copied from interface: XMLEventReceiver
Resolves a prefix to an URI in the context of the current node.

Specified by:
resolvePrefix in interface XMLEventReceiver
Returns:
null if the prefix cannot be resolved.

traverse

public void traverse(Node node,
                     boolean inScopeNS)
              throws DataModelException
Traverse and generate a subtree. TODO optimize for FONIDoc

Specified by:
traverse in interface XMLEventReceiver
Parameters:
inScopeNS - if true, copy all in-scope namespace nodes (not only those defined in the node itself).
DataModelException

 Copyright Xavier FRANC 2003-2004