Package dap4.servlet
Class DapSerializer
- java.lang.Object
-
- dap4.servlet.DapSerializer
-
public class DapSerializer extends Object
Given a DSP, serialize possibly constrained data.
-
-
Field Summary
Fields Modifier and Type Field Description protected CDMWrapcdmwrapprotected dap4.core.ce.CEConstraintceprotected dap4.core.util.ChecksumModechecksummodeprotected Map<dap4.core.dmr.DapVariable,Long>checksumsprotected ByteOrderorderprotected OutputStreamstreamprotected SerialWriterwriter
-
Constructor Summary
Constructors Constructor Description DapSerializer()DapSerializer(CDMWrap c4, dap4.core.ce.CEConstraint constraint, OutputStream stream, ByteOrder order, dap4.core.util.ChecksumMode mode)Primary constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<dap4.core.dmr.DapVariable,Long>getChecksums()voidwrite(dap4.core.dmr.DapDataset dmr)protected voidwriteAtomicVariable(CDMData data, SerialWriter dst)Write out an atomic variable.protected voidwriteRecord(CDMData record, SerialWriter dst)Write out a single Record instance.protected voidwriteSequence(CDMData data, SerialWriter dst)Write out a single or array sequence instanceprotected voidwriteSequence1(CDMData instance, SerialWriter dst)Write out a single Sequence of records (Eventually use any filter in the DapVariable)protected voidwriteStructure(CDMData data, SerialWriter dst)Write out a scalar or array structure instanceprotected voidwriteStructure1(CDMData instance, SerialWriter dst)Write out a single structure instanceprotected voidwriteVariable(CDMData data, SerialWriter dst)
-
-
-
Field Detail
-
stream
protected OutputStream stream
-
writer
protected SerialWriter writer
-
cdmwrap
protected CDMWrap cdmwrap
-
ce
protected dap4.core.ce.CEConstraint ce
-
order
protected ByteOrder order
-
checksummode
protected dap4.core.util.ChecksumMode checksummode
-
-
Constructor Detail
-
DapSerializer
public DapSerializer()
-
DapSerializer
public DapSerializer(CDMWrap c4, dap4.core.ce.CEConstraint constraint, OutputStream stream, ByteOrder order, dap4.core.util.ChecksumMode mode) throws IOException
Primary constructor- Parameters:
c4- The DSP to writeconstraint- Any applicable constraintstream- Write to this streamorder- The byte order to use- Throws:
IOException
-
-
Method Detail
-
write
public void write(dap4.core.dmr.DapDataset dmr) throws IOException- Throws:
IOException
-
writeVariable
protected void writeVariable(CDMData data, SerialWriter dst) throws IOException
- Parameters:
data- - cursor referencing what to writedst- - where to write- Throws:
IOException
-
writeAtomicVariable
protected void writeAtomicVariable(CDMData data, SerialWriter dst) throws IOException
Write out an atomic variable.- Parameters:
data-dst-- Throws:
dap4.core.util.DapExceptionIOException
-
writeStructure
protected void writeStructure(CDMData data, SerialWriter dst) throws IOException
Write out a scalar or array structure instance- Parameters:
data-dst- - where to write- Throws:
dap4.core.util.DapExceptionIOException
-
writeStructure1
protected void writeStructure1(CDMData instance, SerialWriter dst) throws IOException
Write out a single structure instance- Parameters:
instance-dst- - where to write- Throws:
dap4.core.util.DapExceptionIOException
-
writeSequence
protected void writeSequence(CDMData data, SerialWriter dst) throws IOException
Write out a single or array sequence instance- Parameters:
data-dst- - where to write- Throws:
dap4.core.util.DapExceptionIOException
-
writeSequence1
protected void writeSequence1(CDMData instance, SerialWriter dst) throws IOException
Write out a single Sequence of records (Eventually use any filter in the DapVariable)- Parameters:
instance- the sequence instancedst- write target- Throws:
dap4.core.util.DapExceptionIOException
-
writeRecord
protected void writeRecord(CDMData record, SerialWriter dst) throws IOException
Write out a single Record instance.- Parameters:
record- the record data cursordst- to which to write- Throws:
dap4.core.util.DapExceptionIOException
-
-