Commit 8a82b7b7 authored by R.W.Majeed's avatar R.W.Majeed

non-public classes hidden with package visibility, improved class names, javadoc

parent 1d47143a
......@@ -14,7 +14,7 @@ import org.w3c.dom.Node;
* @author R.W.Majeed
*
*/
public class FactClassAnnotator {
class FactClassAnnotator {
private Map<String, String> conceptMap;
private List<WildcardRule> wildcardRules;
......
......@@ -22,7 +22,7 @@ import de.sekmi.histream.export.config.ExportException;
* @author R.W.Majeed
*
*/
public class FragmentExporter extends VisitFragmentParser {
class FragmentExporter extends VisitFragmentParser {
TableParser patientParser;
TableParser visitParser;
......
......@@ -19,7 +19,7 @@ import de.sekmi.histream.ext.Patient;
import de.sekmi.histream.ext.Visit;
import de.sekmi.histream.io.GroupedXMLWriter;
public abstract class VisitFragmentParser extends GroupedXMLWriter {
abstract class VisitFragmentParser extends GroupedXMLWriter {
private XMLOutputFactory factory;
private Document doc;
private DocumentFragment currentPatient;
......
package de.sekmi.histream.export.config;
import java.io.InputStream;
import javax.xml.bind.JAXB;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.transform.Source;
/**
* Export descriptor. Usually, this is specified
* by an XML document and parsed via {@link #parse(Source)}
* or using JAXB.
*
* @author R.W.Majeed
*
*/
@XmlRootElement(name="export")
@XmlAccessorType(XmlAccessType.NONE)
public class ExportDescriptor {
......@@ -30,4 +42,23 @@ public class ExportDescriptor {
public AbstractTable getVisitTable() {
return visit;
}
/**
* Parse an XML document containing the
* export descriptor data.
*
* @param source XML source
* @return export descriptor instance
*/
public static ExportDescriptor parse(Source source){
return JAXB.unmarshal(source, ExportDescriptor.class);
}
/**
* Parse an XML document containing the
* export descriptor data.
* @param xml XML input stream
* @return export descriptor instance
*/
public static ExportDescriptor parse(InputStream xml){
return JAXB.unmarshal(xml, ExportDescriptor.class);
}
}
......@@ -7,14 +7,14 @@ import java.nio.file.Path;
import de.sekmi.histream.export.ExportWriter;
import de.sekmi.histream.export.TableWriter;
public class CSVExport implements ExportWriter{
public class CSVWriter implements ExportWriter{
private char fieldSeparator;
private Charset charset;
private Path directory;
private String filenameExtension;
public CSVExport(Path directory, char fieldSeparator){
public CSVWriter(Path directory, char fieldSeparator){
this.charset = Charset.forName("UTF-8");
this.directory = directory;
this.fieldSeparator = fieldSeparator;
......
......@@ -11,13 +11,13 @@ import java.nio.file.StandardOpenOption;
import de.sekmi.histream.export.TableWriter;
class Table implements TableWriter{
private final CSVExport export;
private final CSVWriter export;
private PrintWriter out;
/**
* @param csvWriter
* @throws IOException
*/
Table(CSVExport csvWriter, String filename) throws IOException {
Table(CSVWriter csvWriter, String filename) throws IOException {
export = csvWriter;
Path file = export.getDirectory().resolve(filename);
OutputStream os = Files.newOutputStream(file, StandardOpenOption.CREATE_NEW, StandardOpenOption.WRITE);
......
/**
* Encounter/visit based table export functionality for HIStream.
* <p>
* To export data tables, create an instance of
* {@link de.sekmi.histream.export.config.ExportDescriptor}
* and pass it to a {@link de.sekmi.histream.export.TableExport}
* object.
* </p>
* <p>
* CSV tables can be used via {@link de.sekmi.histream.export.csv.CSVWriter}.
* </p>
*/
package de.sekmi.histream.export;
\ No newline at end of file
package de.sekmi.histream.export.config;
package de.sekmi.histream.export;
import java.io.InputStream;
import javax.xml.parsers.DocumentBuilder;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment