Moved all data objects to Serializable and some generics bits.
This commit is contained in:
parent
1b3e65fa83
commit
3bf185ad48
73 changed files with 228 additions and 181 deletions
|
|
@ -24,6 +24,7 @@ package net.forwardfire.vasc.export.generic;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -66,7 +67,7 @@ abstract public class AbstractVascEntryExportWriter implements VascEntryExportWr
|
|||
|
||||
int dataSize = entry.getVascFrontendController().getVascEntryState().getEntryDataList().size();
|
||||
for (int dataIndex=0;dataIndex<dataSize;dataIndex++) {
|
||||
Object o = entry.getVascFrontendController().getVascEntryState().getEntryDataList().get(dataIndex);
|
||||
Serializable o = entry.getVascFrontendController().getVascEntryState().getEntryDataList().get(dataIndex);
|
||||
doExportRowStart(o);
|
||||
try {
|
||||
doExportRowFields(o);
|
||||
|
|
@ -96,10 +97,10 @@ abstract public class AbstractVascEntryExportWriter implements VascEntryExportWr
|
|||
abstract protected void doExportStart() throws IOException;
|
||||
abstract protected void doExportEnd() throws IOException;
|
||||
|
||||
abstract protected void doExportRowStart(Object row) throws IOException;
|
||||
abstract protected void doExportRowEnd(Object row,boolean isLast) throws IOException;
|
||||
abstract protected void doExportRowStart(Serializable row) throws IOException;
|
||||
abstract protected void doExportRowEnd(Serializable row,boolean isLast) throws IOException;
|
||||
|
||||
protected void doExportRowFields(Object row) throws IOException,VascBackendException {
|
||||
protected void doExportRowFields(Serializable row) throws IOException,VascBackendException {
|
||||
// todo: rm me and use data selector
|
||||
List<VascEntryField> fieldList = new ArrayList<VascEntryField>(getVascEntry().getVascEntryFields());
|
||||
int fields = fieldList.size();
|
||||
|
|
@ -109,5 +110,5 @@ abstract public class AbstractVascEntryExportWriter implements VascEntryExportWr
|
|||
}
|
||||
}
|
||||
|
||||
abstract protected void doExportRowField(Object row,VascEntryField field,boolean isLast) throws IOException,VascBackendException;
|
||||
abstract protected void doExportRowField(Serializable row,VascEntryField field,boolean isLast) throws IOException,VascBackendException;
|
||||
}
|
||||
|
|
@ -24,6 +24,7 @@ package net.forwardfire.vasc.export.generic;
|
|||
|
||||
import java.io.OutputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Serializable;
|
||||
|
||||
import net.forwardfire.vasc.backend.VascBackendException;
|
||||
import net.forwardfire.vasc.core.VascEntryField;
|
||||
|
|
@ -122,17 +123,17 @@ public class VascEntryExportWriterCsv extends AbstractVascEntryExportWriter {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void doExportRowStart(Object row) {
|
||||
protected void doExportRowStart(Serializable row) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doExportRowEnd(Object row,boolean isLast) {
|
||||
protected void doExportRowEnd(Serializable row,boolean isLast) {
|
||||
p.write(lineEnd.toCharType());
|
||||
p.flush();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doExportRowField(Object o, VascEntryField c,boolean isLast) throws VascBackendException {
|
||||
protected void doExportRowField(Serializable o, VascEntryField c,boolean isLast) throws VascBackendException {
|
||||
p.write(quoteChar.toCharType());
|
||||
p.write(c.getVascEntryFieldValue().getDisplayValue(c.getBackendName(), o));
|
||||
p.write(quoteChar.toCharType());
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ package net.forwardfire.vasc.export.generic;
|
|||
|
||||
import java.io.OutputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Serializable;
|
||||
|
||||
import net.forwardfire.vasc.backend.VascBackendException;
|
||||
import net.forwardfire.vasc.core.VascEntryField;
|
||||
|
|
@ -63,18 +64,18 @@ public class VascEntryExportWriterXml extends AbstractVascEntryExportWriter {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void doExportRowStart(Object row) {
|
||||
protected void doExportRowStart(Serializable row) {
|
||||
p.write("\t<row>\n");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doExportRowEnd(Object row,boolean isLast) {
|
||||
protected void doExportRowEnd(Serializable row,boolean isLast) {
|
||||
p.write("\t</row>\n");
|
||||
p.flush();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doExportRowField(Object o, VascEntryField c,boolean isLast) throws VascBackendException {
|
||||
protected void doExportRowField(Serializable o, VascEntryField c,boolean isLast) throws VascBackendException {
|
||||
if (xmlTree) {
|
||||
p.write("\t\t<"+c.getId()+"><![CDATA[");
|
||||
p.write(""+c.getVascEntryFieldValue().getDisplayValue(c.getBackendName(), o));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue