org.apache.jackrabbit.commons.xml
Class DocumentViewExporter

java.lang.Object
  extended by org.apache.jackrabbit.commons.xml.Exporter
      extended by org.apache.jackrabbit.commons.xml.DocumentViewExporter

public class DocumentViewExporter
extends Exporter

Document view exporter.

Since:
Jackrabbit JCR Commons 1.5

Field Summary
 
Fields inherited from class org.apache.jackrabbit.commons.xml.Exporter
helper
 
Constructor Summary
DocumentViewExporter(Session session, ContentHandler handler, boolean recurse, boolean binary)
          Creates a document view exporter.
 
Method Summary
protected  void exportNode(String uri, String local, Node node)
          Exports the given node either as XML characters (if it's an xml:text node) or as an XML element with properties mapped to XML attributes.
protected  void exportProperty(String uri, String local, int type, Value[] values)
          Does nothing.
protected  void exportProperty(String uri, String local, Value value)
          Maps the given single-valued property to an XML attribute.
 
Methods inherited from class org.apache.jackrabbit.commons.xml.Exporter
addAttribute, addNamespace, characters, endElement, export, exportNodes, exportProperties, getXMLName, startElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentViewExporter

public DocumentViewExporter(Session session,
                            ContentHandler handler,
                            boolean recurse,
                            boolean binary)
Creates a document view exporter.

Parameters:
session - current session
handler - SAX event handler for the export
recurse - whether to recursively export the whole subtree
binary - whether to export binary values
Method Detail

exportNode

protected void exportNode(String uri,
                          String local,
                          Node node)
                   throws RepositoryException,
                          SAXException
Exports the given node either as XML characters (if it's an xml:text node) or as an XML element with properties mapped to XML attributes.

Specified by:
exportNode in class Exporter
Parameters:
uri - node namespace
local - node name
node - node
Throws:
RepositoryException - if a repository error occurs
SAXException - if a SAX error occurs

exportProperty

protected void exportProperty(String uri,
                              String local,
                              Value value)
                       throws RepositoryException
Maps the given single-valued property to an XML attribute.

Specified by:
exportProperty in class Exporter
Parameters:
uri - property namespace
local - property name
value - property value
Throws:
RepositoryException - if a repository error occurs

exportProperty

protected void exportProperty(String uri,
                              String local,
                              int type,
                              Value[] values)
Does nothing. Multi-valued properties are skipped for the time being until a way of properly handling/detecting multi-valued properties on re-import is found. Skipping multi-valued properties entirely is legal according to "6.4.2.5 Multi-value Properties" of the JSR 170 specification.

Specified by:
exportProperty in class Exporter
Parameters:
uri - property namespace
local - property name
type - property type
values - property values
See Also:
https://issues.apache.org/jira/browse/JCR-325


Copyright © 2011-2013 Adobe Systems Incorporated. All Rights Reserved.