com.atlassian.jira.action.admin.export
Class DefaultSaxEntitiesExporter

java.lang.Object
  extended by com.atlassian.jira.action.admin.export.DefaultSaxEntitiesExporter
All Implemented Interfaces:
EntitiesExporter

public class DefaultSaxEntitiesExporter
extends Object
implements EntitiesExporter


Field Summary
protected  ApplicationProperties applicationProperties
           
static int DEFAULT_BUFFER_SIZE
           
protected  org.ofbiz.core.entity.GenericDelegator delegator
           
protected static String NL
           
 
Constructor Summary
DefaultSaxEntitiesExporter(org.ofbiz.core.entity.GenericDelegator delegator, ApplicationProperties applicationProperties)
           
 
Method Summary
 long exportEntities(OutputStream outputStream, TreeSet entityNames, EntityXmlWriter entityWriter, User exportingUser)
          Exports the entities in the TreeSet to the outputStream.
protected  PrintWriter getWriter(OutputStream outputStream)
           
protected  void writeFooter(PrintWriter printWriter, com.atlassian.jira.action.admin.export.DefaultSaxEntitiesExporter.EntityCounter entityCounter)
          This closes out the XML documment.
protected  void writeHeader(PrintWriter printWriter, User exportingUser)
          This will write the start of the exported XML file out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NL

protected static final String NL

delegator

protected final org.ofbiz.core.entity.GenericDelegator delegator

applicationProperties

protected final ApplicationProperties applicationProperties

DEFAULT_BUFFER_SIZE

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

DefaultSaxEntitiesExporter

public DefaultSaxEntitiesExporter(org.ofbiz.core.entity.GenericDelegator delegator,
                                  ApplicationProperties applicationProperties)
Method Detail

exportEntities

public long exportEntities(OutputStream outputStream,
                           TreeSet entityNames,
                           EntityXmlWriter entityWriter,
                           User exportingUser)
                    throws IOException,
                           org.ofbiz.core.entity.GenericEntityException
Description copied from interface: EntitiesExporter
Exports the entities in the TreeSet to the outputStream.

Specified by:
exportEntities in interface EntitiesExporter
Parameters:
outputStream - - the stream to write to
entityNames - - the entities names to write out
entityWriter - - an XML output helper that can write generic values to XML
exportingUser - - the user performing the export operation
Returns:
the number of individual entities written
Throws:
IOException
org.ofbiz.core.entity.GenericEntityException

getWriter

protected PrintWriter getWriter(OutputStream outputStream)
                         throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

writeFooter

protected void writeFooter(PrintWriter printWriter,
                           com.atlassian.jira.action.admin.export.DefaultSaxEntitiesExporter.EntityCounter entityCounter)
This closes out the XML documment.

Parameters:
printWriter - a PrintWriter to write to
entityCounter - a count of entities written

writeHeader

protected void writeHeader(PrintWriter printWriter,
                           User exportingUser)
This will write the start of the exported XML file out. This includes the XML declaration and the top level root element

Parameters:
printWriter - a PrintWriter to write to
exportingUser - the user doing the export


Copyright © 2002-2009 Atlassian. All Rights Reserved.