org.apache.jackrabbit.core.xml
Class SysViewSAXEventGenerator

java.lang.Object
  extended byorg.apache.jackrabbit.core.xml.AbstractSAXEventGenerator
      extended byorg.apache.jackrabbit.core.xml.SysViewSAXEventGenerator

public class SysViewSAXEventGenerator
extends org.apache.jackrabbit.core.xml.AbstractSAXEventGenerator

A SysViewSAXEventGenerator instance can be used to generate SAX events representing the serialized form of an item in System View XML.


Field Summary
static String CDATA_TYPE
           
protected  ContentHandler contentHandler
          the content handler to feed the SAX events to
static String ENUMERATION_TYPE
           
protected  String jcrMixinTypes
          The jcr:mixinTypes property name (allowed for session-local prefix mappings)
protected  String jcrPrimaryType
          The jcr:primaryType property name (allowed for session-local prefix mappings)
protected  String jcrRoot
          The jcr:root node name (allowed for session-local prefix mappings)
protected  String jcrUUID
          The jcr:uuid property name (allowed for session-local prefix mappings)
protected  String jcrXMLCharacters
          The jcr:xmlCharacters property name (allowed for session-local prefix mappings)
protected  String jcrXMLText
          The jcr:xmltext node name (allowed for session-local prefix mappings)
static String NAME_ATTRIBUTE
           
static String NODE_ELEMENT
          The XML elements and attributes used in serialization
protected  boolean noRecurse
           
protected  NamespaceResolver nsResolver
          the session's namespace resolver
static String PREFIXED_NAME_ATTRIBUTE
           
static String PREFIXED_NODE_ELEMENT
           
static String PREFIXED_PROPERTY_ELEMENT
           
static String PREFIXED_TYPE_ATTRIBUTE
           
static String PREFIXED_VALUE_ELEMENT
           
static String PROPERTY_ELEMENT
           
protected  Session session
          the session to be used for resolving namespace mappings
protected  boolean skipBinary
           
protected  Node startNode
           
static String TYPE_ATTRIBUTE
           
static String VALUE_ELEMENT
           
 
Constructor Summary
SysViewSAXEventGenerator(Node node, boolean noRecurse, boolean skipBinary, ContentHandler contentHandler)
          Constructor
 
Method Summary
protected  void endNamespaceDeclarations()
           
protected  void entering(Node node, int level)
          
protected  void entering(Property prop, int level)
          
protected  void enteringProperties(Node node, int level)
          
protected  void leaving(Node node, int level)
          
protected  void leaving(Property prop, int level)
          
protected  void leavingProperties(Node node, int level)
          
protected  void process(Node node, int level)
           
protected  void process(Property prop, int level)
           
 void serialize()
          Serializes the hierarchy of nodes and properties.
protected  void startNamespaceDeclarations()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NODE_ELEMENT

public static final String NODE_ELEMENT
The XML elements and attributes used in serialization

See Also:
Constant Field Values

PREFIXED_NODE_ELEMENT

public static final String PREFIXED_NODE_ELEMENT
See Also:
Constant Field Values

PROPERTY_ELEMENT

public static final String PROPERTY_ELEMENT
See Also:
Constant Field Values

PREFIXED_PROPERTY_ELEMENT

public static final String PREFIXED_PROPERTY_ELEMENT
See Also:
Constant Field Values

VALUE_ELEMENT

public static final String VALUE_ELEMENT
See Also:
Constant Field Values

PREFIXED_VALUE_ELEMENT

public static final String PREFIXED_VALUE_ELEMENT
See Also:
Constant Field Values

NAME_ATTRIBUTE

public static final String NAME_ATTRIBUTE
See Also:
Constant Field Values

PREFIXED_NAME_ATTRIBUTE

public static final String PREFIXED_NAME_ATTRIBUTE
See Also:
Constant Field Values

TYPE_ATTRIBUTE

public static final String TYPE_ATTRIBUTE
See Also:
Constant Field Values

PREFIXED_TYPE_ATTRIBUTE

public static final String PREFIXED_TYPE_ATTRIBUTE
See Also:
Constant Field Values

CDATA_TYPE

public static final String CDATA_TYPE
See Also:
Constant Field Values

ENUMERATION_TYPE

public static final String ENUMERATION_TYPE
See Also:
Constant Field Values

session

protected final Session session
the session to be used for resolving namespace mappings


nsResolver

protected final NamespaceResolver nsResolver
the session's namespace resolver


contentHandler

protected final ContentHandler contentHandler
the content handler to feed the SAX events to


startNode

protected final Node startNode

skipBinary

protected final boolean skipBinary

noRecurse

protected final boolean noRecurse

jcrPrimaryType

protected final String jcrPrimaryType
The jcr:primaryType property name (allowed for session-local prefix mappings)


jcrMixinTypes

protected final String jcrMixinTypes
The jcr:mixinTypes property name (allowed for session-local prefix mappings)


jcrUUID

protected final String jcrUUID
The jcr:uuid property name (allowed for session-local prefix mappings)


jcrRoot

protected final String jcrRoot
The jcr:root node name (allowed for session-local prefix mappings)


jcrXMLText

protected final String jcrXMLText
The jcr:xmltext node name (allowed for session-local prefix mappings)


jcrXMLCharacters

protected final String jcrXMLCharacters
The jcr:xmlCharacters property name (allowed for session-local prefix mappings)

Constructor Detail

SysViewSAXEventGenerator

public SysViewSAXEventGenerator(Node node,
                                boolean noRecurse,
                                boolean skipBinary,
                                ContentHandler contentHandler)
                         throws RepositoryException
Constructor

Parameters:
node - the node state which should be serialized
noRecurse - if true, only node and its properties will be serialized; otherwise the entire hierarchy starting with node will be serialized.
skipBinary - flag governing whether binary properties are to be serialized.
contentHandler - the content handler to feed the SAX events to
Throws:
RepositoryException - if an error occurs
Method Detail

entering

protected void entering(Node node,
                        int level)
                 throws RepositoryException,
                        SAXException

Parameters:
node -
level -
Throws:
SAXException
RepositoryException

enteringProperties

protected void enteringProperties(Node node,
                                  int level)
                           throws RepositoryException,
                                  SAXException

Parameters:
node -
level -
Throws:
RepositoryException
SAXException

leavingProperties

protected void leavingProperties(Node node,
                                 int level)
                          throws RepositoryException,
                                 SAXException

Parameters:
node -
level -
Throws:
SAXException
RepositoryException

leaving

protected void leaving(Node node,
                       int level)
                throws RepositoryException,
                       SAXException

Parameters:
node -
level -
Throws:
RepositoryException
SAXException

entering

protected void entering(Property prop,
                        int level)
                 throws RepositoryException,
                        SAXException

Parameters:
prop -
level -
Throws:
SAXException
RepositoryException

leaving

protected void leaving(Property prop,
                       int level)
                throws RepositoryException,
                       SAXException

Parameters:
prop -
level -
Throws:
SAXException
RepositoryException

serialize

public void serialize()
               throws RepositoryException,
                      SAXException
Serializes the hierarchy of nodes and properties.

Throws:
RepositoryException - if an error occurs while traversing the hierarchy
SAXException - if an error occured while feeding the events to the content handler

startNamespaceDeclarations

protected void startNamespaceDeclarations()
                                   throws RepositoryException,
                                          SAXException
Throws:
RepositoryException
SAXException

endNamespaceDeclarations

protected void endNamespaceDeclarations()
                                 throws RepositoryException,
                                        SAXException
Throws:
RepositoryException
SAXException

process

protected void process(Node node,
                       int level)
                throws RepositoryException,
                       SAXException
Parameters:
node -
level -
Throws:
RepositoryException
SAXException

process

protected void process(Property prop,
                       int level)
                throws RepositoryException,
                       SAXException
Parameters:
prop -
level -
Throws:
RepositoryException
SAXException


Copyright © 2004-2006 The Apache Software Foundation. All Rights Reserved.