Class XmlExportTransformer
java.lang.Object
net.sf.jailer.database.Session.AbstractResultSetReader
net.sf.jailer.xml.XmlExportTransformer
- All Implemented Interfaces:
Session.ResultSetReader
A
Session.ResultSetReader that writes the read rows into an XML file.- Author:
- Ralf Wisser
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassHolds XML mapping information. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic longCounts the exported entities.static longCounts the exported LOBs. -
Constructor Summary
ConstructorsConstructorDescriptionXmlExportTransformer(OutputStream out, String commentHeader, EntityGraph entityGraph, Set<Table> totalProgress, Set<Table> cyclicAggregatedTables, String rootTag, String datePattern, String timestampPattern, Session session, ScriptFormat scriptFormat, Charset charset, ExecutionContext executionContext) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Flushes the export-reader.voidCloses the XML document.getTableMapping(Table table) Gets the xml mapping for a table.voidreadCurrentRow(ResultSet resultSet) Reads result-set and writes into export-script.voidSets the table to read from.voidsetTableIsSubject(boolean tableIsSubject) Methods inherited from class net.sf.jailer.database.Session.AbstractResultSetReader
getCellContentConverter, getMetaData, init
-
Field Details
-
numberOfExportedEntities
public static long numberOfExportedEntitiesCounts the exported entities. (GUI support) -
numberOfExportedLOBs
public static long numberOfExportedLOBsCounts the exported LOBs. (GUI support)
-
-
Constructor Details
-
XmlExportTransformer
public XmlExportTransformer(OutputStream out, String commentHeader, EntityGraph entityGraph, Set<Table> totalProgress, Set<Table> cyclicAggregatedTables, String rootTag, String datePattern, String timestampPattern, Session session, ScriptFormat scriptFormat, Charset charset, ExecutionContext executionContext) throws TransformerConfigurationException, SAXException, SQLException Constructor.- Parameters:
out- to write the xml intocommentHeader- comment at top of documententityGraph- the entity graphtotalProgress- set of all tables for which entities exist in entityGraphrootTag- root tag namedatePattern- pattern for datestimestampPattern- pattern for time-stampsscriptFormat-- Throws:
SQLExceptionTransformerConfigurationExceptionSAXException
-
-
Method Details
-
readCurrentRow
Reads result-set and writes into export-script.- Parameters:
resultSet- the result-set- Throws:
SQLException
-
setTable
Sets the table to read from. -
setTableIsSubject
public void setTableIsSubject(boolean tableIsSubject) - Parameters:
tableIsSubject-trueiff table is subject
-
endDocument
-
close
public void close()Flushes the export-reader.- Specified by:
closein interfaceSession.ResultSetReader- Overrides:
closein classSession.AbstractResultSetReader
-
getTableMapping
public XmlExportTransformer.TableMapping getTableMapping(Table table) throws SAXException, IOException Gets the xml mapping for a table.- Parameters:
table- the table- Returns:
- xml mapping for table
- Throws:
SAXExceptionIOException
-