Commit 3c74bfb8 authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

Started work on writing NDM composite files.

parent 3f89c012
......@@ -322,7 +322,8 @@ public enum OrekitMessages implements Localizable {
UNINITIALIZED_VALUE_FOR_KEY("value for key {0} has not been initialized"),
UNKNOWN_UNIT("unknown unit {0}"),
INCOMPATIBLE_UNITS("units {0} and {1} are not compatible"),
MISSING_VELOCITY("missing velocity data");
MISSING_VELOCITY("missing velocity data"),
ATTEMPT_TO_GENERATE_MALFORMED_FILE("attempt to generate file {0} with a formatting error");
// CHECKSTYLE: resume JavadocVariable check
......
......@@ -23,6 +23,8 @@ import org.orekit.files.ccsds.ndm.adm.apm.ApmParser;
import org.orekit.files.ccsds.ndm.odm.oem.OemParser;
import org.orekit.files.ccsds.ndm.odm.omm.OmmParser;
import org.orekit.files.ccsds.ndm.odm.opm.OpmParser;
import org.orekit.files.ccsds.ndm.tdm.RangeUnits;
import org.orekit.files.ccsds.ndm.tdm.RangeUnitsConverter;
import org.orekit.time.AbsoluteDate;
import org.orekit.utils.IERSConventions;
......@@ -45,19 +47,25 @@ public abstract class AbstractBuilder<T extends AbstractBuilder<T>> {
/** Spin axis in spacecraft body frame. */
private final Vector3D spinAxis;
/** Converter for {@link RangeUnits#RU Range Units}. */
private final RangeUnitsConverter rangeUnitsConverter;
/**
* Complete constructor.
* @param conventions IERS Conventions
* @param dataContext used to retrieve frames, time scales, etc.
* @param missionReferenceDate reference date for Mission Elapsed Time or Mission Relative Time time systems
* @param spinAxis spin axis in spacecraft body frame
* @param rangeUnitsConverter converter for {@link RangeUnits#RU Range Units}
*/
protected AbstractBuilder(final IERSConventions conventions, final DataContext dataContext,
final AbsoluteDate missionReferenceDate, final Vector3D spinAxis) {
final AbsoluteDate missionReferenceDate, final Vector3D spinAxis,
final RangeUnitsConverter rangeUnitsConverter) {
this.conventions = conventions;
this.dataContext = dataContext;
this.missionReferenceDate = missionReferenceDate;
this.spinAxis = spinAxis;
this.rangeUnitsConverter = rangeUnitsConverter;
}
/** Build an instance.
......@@ -65,17 +73,20 @@ public abstract class AbstractBuilder<T extends AbstractBuilder<T>> {
* @param newDataContext used to retrieve frames, time scales, etc.
* @param newMissionReferenceDate reference date for Mission Elapsed Time or Mission Relative Time time systems
* @param newSpinAxis spin axis in spacecraft body frame
* @param newRangeUnitsConverter converter for {@link RangeUnits#RU Range Units}
* @return new instance
*/
protected abstract T create(IERSConventions newConventions, DataContext newDataContext,
AbsoluteDate newMissionReferenceDate, Vector3D newSpinAxis);
AbsoluteDate newMissionReferenceDate, Vector3D newSpinAxis,
RangeUnitsConverter newRangeUnitsConverter);
/** Set up IERS conventions.
* @param newConventions IERS Conventions
* @return a new builder with updated configuration (the instance is not changed)
*/
public T withConventions(final IERSConventions newConventions) {
return create(newConventions, getDataContext(), getMissionReferenceDate(), getSpinAxis());
return create(newConventions, getDataContext(), getMissionReferenceDate(),
getSpinAxis(), getRangeUnitsConverter());
}
/** Get the IERS conventions.
......@@ -90,7 +101,8 @@ public abstract class AbstractBuilder<T extends AbstractBuilder<T>> {
* @return a new builder with updated configuration (the instance is not changed)
*/
public T withDataContext(final DataContext newDataContext) {
return create(getConventions(), newDataContext, getMissionReferenceDate(), getSpinAxis());
return create(getConventions(), newDataContext, getMissionReferenceDate(),
getSpinAxis(), getRangeUnitsConverter());
}
/** Get the data context.
......@@ -111,7 +123,8 @@ public abstract class AbstractBuilder<T extends AbstractBuilder<T>> {
* @return a new builder with updated configuration (the instance is not changed)
*/
public T withMissionReferenceDate(final AbsoluteDate newMissionReferenceDate) {
return create(getConventions(), getDataContext(), newMissionReferenceDate, getSpinAxis());
return create(getConventions(), getDataContext(), newMissionReferenceDate,
getSpinAxis(), getRangeUnitsConverter());
}
/** Get the mission reference date or Mission Elapsed Time or Mission Relative Time time systems.
......@@ -129,7 +142,8 @@ public abstract class AbstractBuilder<T extends AbstractBuilder<T>> {
* @return a new builder with updated configuration (the instance is not changed)
*/
public T withSpinAxis(final Vector3D newSpinAxis) {
return create(getConventions(), getDataContext(), getMissionReferenceDate(), newSpinAxis);
return create(getConventions(), getDataContext(), getMissionReferenceDate(),
newSpinAxis, getRangeUnitsConverter());
}
/**
......@@ -140,4 +154,20 @@ public abstract class AbstractBuilder<T extends AbstractBuilder<T>> {
return spinAxis;
}
/** Set up the converter for {@link RangeUnits#RU Range Units}.
* @param newRangeUnitsConverter converter for {@link RangeUnits#RU Range Units}
* @return a new builder with updated configuration (the instance is not changed)
*/
public T withRangeUnitsConverter(final RangeUnitsConverter newRangeUnitsConverter) {
return create(getConventions(), getDataContext(), getMissionReferenceDate(),
getSpinAxis(), rangeUnitsConverter);
}
/** Get the converter for {@link RangeUnits#RU Range Units}.
* @return converter for {@link RangeUnits#RU Range Units}
*/
public RangeUnitsConverter getRangeUnitsConverter() {
return rangeUnitsConverter;
}
}
/* Copyright 2002-2021 CS GROUP
* Licensed to CS GROUP (CS) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* CS licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.orekit.files.ccsds.ndm;
import java.io.IOException;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitMessages;
import org.orekit.files.ccsds.ndm.adm.aem.AemFile;
import org.orekit.files.ccsds.ndm.adm.apm.ApmFile;
import org.orekit.files.ccsds.ndm.odm.ocm.OcmFile;
import org.orekit.files.ccsds.ndm.odm.oem.OemFile;
import org.orekit.files.ccsds.ndm.odm.omm.OmmFile;
import org.orekit.files.ccsds.ndm.odm.opm.OpmFile;
import org.orekit.files.ccsds.ndm.tdm.TdmFile;
import org.orekit.files.ccsds.utils.generation.Generator;
/**
* Writer for CCSDS Navigation Data Message.
*
* @author Luc Maisonobe
* @since 11.0
*/
public class NdmWriter {
/** Builder for the constituents writers. */
private final WriterBuilder builder;
/** Number of constituents written. */
private int count;
/** Simple constructor.
* <p>
* Calling this constructor directly is not recommended. Users should rather use
* {@link org.orekit.files.ccsds.ndm.WriterBuilder#buildNdmWriter()
* WriterBuilder.buildNdmWriter()}.
* </p>
* @param builder builder for the constituents parsers
*/
public NdmWriter(final WriterBuilder builder) {
this.builder = builder;
this.count = 0;
}
/** Write a comment line.
* <p>
* Comments allows comments only before constituents, so attempting to
* add comments after the first constituent has been written will
* produce an exception.
* </p>
* @param generator generator to use for producing output
* @param comment comment line to write
* @throws IOException if the stream cannot write to stream
*/
public void writeComment(final Generator generator, final String comment) throws IOException {
// check we can still write comments
if (count > 0) {
throw new OrekitException(OrekitMessages.ATTEMPT_TO_GENERATE_MALFORMED_FILE, generator.getOutputName());
}
generator.writeEntry(NdmStructureKey.COMMENT.name(), comment, null, false);
}
/** Write a TDM constituent.
* @param generator generator to use for producing output
* @param tdmConstituent TDM constituent
*/
public void writeTdmConstituent(final Generator generator, final TdmFile tdmConstituent) throws IOException {
builder.buildTdmWriter().writeMessage(generator, tdmConstituent);
}
/** Write an OPM constituent.
* @param generator generator to use for producing output
* @param opmConstituent OPM constituent
*/
public void writeOpmConstituent(final Generator generator, final OpmFile opmConstituent) throws IOException {
builder.buildOpmWriter().writeMessage(generator, opmConstituent);
}
/** Write an OMM constituent.
* @param generator generator to use for producing output
* @param ommConstituent OMM constituent
*/
public void writeOmmConstituent(final Generator generator, final OmmFile ommConstituent) throws IOException {
builder.buildOmmWriter().writeMessage(generator, ommConstituent);
}
/** Write an OEM constituent.
* @param generator generator to use for producing output
* @param oemConstituent TDM constituent
*/
public void writeOemConstituent(final Generator generator, final OemFile oemConstituent) throws IOException {
builder.buildOemWriter().writeMessage(generator, oemConstituent);
}
/** Write an OCM constituent.
* @param generator generator to use for producing output
* @param ocmConstituent OCM constituent
*/
public void writeOcmConstituent(final Generator generator, final OcmFile ocmConstituent) throws IOException {
builder.buildOcmWriter().writeMessage(generator, ocmConstituent);
}
/** Write an APM constituent.
* @param generator generator to use for producing output
* @param apmConstituent APM constituent
*/
public void writeApmConstituent(final Generator generator, final ApmFile apmConstituent) throws IOException {
builder.buildApmWriter().writeMessage(generator, apmConstituent);
}
/** Write an AEM constituent.
* @param generator generator to use for producing output
* @param aemConstituent AEM constituent
*/
public void writeAemConstituent(final Generator generator, final AemFile aemConstituent) throws IOException {
builder.buildAemWriter().writeMessage(generator, aemConstituent);
}
}
......@@ -59,9 +59,6 @@ public class ParserBuilder extends AbstractBuilder<ParserBuilder> {
/** Behavior adopted for units that have been parsed from a CCSDS message. */
private final ParsedUnitsBehavior parsedUnitsBehavior;
/** Converter for {@link RangeUnits#RU Range Units}. */
private final RangeUnitsConverter rangeUnitsConverter;
/**
* Simple constructor.
* <p>
......@@ -102,8 +99,8 @@ public class ParserBuilder extends AbstractBuilder<ParserBuilder> {
* @param dataContext data context used to retrieve frames, time scales, etc.
*/
public ParserBuilder(final DataContext dataContext) {
this(IERSConventions.IERS_2010, dataContext, null, null, true, Double.NaN,
Double.NaN, 1, ParsedUnitsBehavior.CONVERT_COMPATIBLE, new IdentityConverter());
this(IERSConventions.IERS_2010, dataContext, null, null, new IdentityConverter(),
true, Double.NaN, Double.NaN, 1, ParsedUnitsBehavior.CONVERT_COMPATIBLE);
}
/** Complete constructor.
......@@ -120,26 +117,25 @@ public class ParserBuilder extends AbstractBuilder<ParserBuilder> {
*/
private ParserBuilder(final IERSConventions conventions, final DataContext dataContext,
final AbsoluteDate missionReferenceDate, final Vector3D spinAxis,
final RangeUnitsConverter rangeUnitsConverter,
final boolean simpleEOP, final double mu, final double defaultMass,
final int defaultInterpolationDegree,
final ParsedUnitsBehavior parsedUnitsBehavior,
final RangeUnitsConverter rangeUnitsConverter) {
super(conventions, dataContext, missionReferenceDate, spinAxis);
final ParsedUnitsBehavior parsedUnitsBehavior) {
super(conventions, dataContext, missionReferenceDate, spinAxis, rangeUnitsConverter);
this.simpleEOP = simpleEOP;
this.mu = mu;
this.defaultMass = defaultMass;
this.defaultInterpolationDegree = defaultInterpolationDegree;
this.parsedUnitsBehavior = parsedUnitsBehavior;
this.rangeUnitsConverter = rangeUnitsConverter;
}
/** {@inheritDoc} */
@Override
protected ParserBuilder create(final IERSConventions newConventions, final DataContext newDataContext,
final AbsoluteDate newMissionReferenceDate, final Vector3D spinAxis) {
return new ParserBuilder(newConventions, newDataContext, newMissionReferenceDate, spinAxis,
simpleEOP, mu, defaultMass, defaultInterpolationDegree,
parsedUnitsBehavior, rangeUnitsConverter);
final AbsoluteDate newMissionReferenceDate,
final Vector3D newSpinAxis, final RangeUnitsConverter newRangeUnitsConverter) {
return new ParserBuilder(newConventions, newDataContext, newMissionReferenceDate, newSpinAxis, newRangeUnitsConverter,
simpleEOP, mu, defaultMass, defaultInterpolationDegree, parsedUnitsBehavior);
}
/** Set up flag for ignoring tidal effects when interpolating EOP.
......@@ -147,11 +143,10 @@ public class ParserBuilder extends AbstractBuilder<ParserBuilder> {
* @return a new builder with updated configuration (the instance is not changed)
*/
public ParserBuilder withSimpleEOP(final boolean newSimpleEOP) {
return new ParserBuilder(getConventions(), getDataContext(),
getMissionReferenceDate(), getSpinAxis(),
return new ParserBuilder(getConventions(), getDataContext(), getMissionReferenceDate(),
getSpinAxis(), getRangeUnitsConverter(),
newSimpleEOP, getMu(), getDefaultMass(),
getDefaultInterpolationDegree(), getParsedUnitsBehavior(),
getRangeUnitsConverter());
getDefaultInterpolationDegree(), getParsedUnitsBehavior());
}
/** Check if tidal effects are ignored when interpolating EOP.
......@@ -166,11 +161,10 @@ public class ParserBuilder extends AbstractBuilder<ParserBuilder> {
* @return a new builder with updated configuration (the instance is not changed)
*/
public ParserBuilder withMu(final double newMu) {
return new ParserBuilder(getConventions(), getDataContext(),
getMissionReferenceDate(), getSpinAxis(),
return new ParserBuilder(getConventions(), getDataContext(), getMissionReferenceDate(),
getSpinAxis(), getRangeUnitsConverter(),
isSimpleEOP(), newMu, getDefaultMass(),
getDefaultInterpolationDegree(), getParsedUnitsBehavior(),
getRangeUnitsConverter());
getDefaultInterpolationDegree(), getParsedUnitsBehavior());
}
/** Get the gravitational coefficient.
......@@ -188,11 +182,10 @@ public class ParserBuilder extends AbstractBuilder<ParserBuilder> {
* @return a new builder with updated configuration (the instance is not changed)
*/
public ParserBuilder withDefaultMass(final double newDefaultMass) {
return new ParserBuilder(getConventions(), getDataContext(),
getMissionReferenceDate(), getSpinAxis(),
return new ParserBuilder(getConventions(), getDataContext(), getMissionReferenceDate(),
getSpinAxis(), getRangeUnitsConverter(),
isSimpleEOP(), getMu(), newDefaultMass,
getDefaultInterpolationDegree(), getParsedUnitsBehavior(),
getRangeUnitsConverter());
getDefaultInterpolationDegree(), getParsedUnitsBehavior());
}
/** Get the default mass.
......@@ -211,11 +204,10 @@ public class ParserBuilder extends AbstractBuilder<ParserBuilder> {
* @return a new builder with updated configuration (the instance is not changed)
*/
public ParserBuilder withDefaultInterpolationDegree(final int newDefaultInterpolationDegree) {
return new ParserBuilder(getConventions(), getDataContext(),
getMissionReferenceDate(), getSpinAxis(),
return new ParserBuilder(getConventions(), getDataContext(), getMissionReferenceDate(),
getSpinAxis(), getRangeUnitsConverter(),
isSimpleEOP(), getMu(), getDefaultMass(),
newDefaultInterpolationDegree, getParsedUnitsBehavior(),
getRangeUnitsConverter());
newDefaultInterpolationDegree, getParsedUnitsBehavior());
}
/** Get the default interpolation degree.
......@@ -230,11 +222,10 @@ public class ParserBuilder extends AbstractBuilder<ParserBuilder> {
* @return a new builder with updated configuration (the instance is not changed)
*/
public ParserBuilder withParsedUnitsBehavior(final ParsedUnitsBehavior newParsedUnitsBehavior) {
return new ParserBuilder(getConventions(), getDataContext(),
getMissionReferenceDate(), getSpinAxis(),
return new ParserBuilder(getConventions(), getDataContext(), getMissionReferenceDate(),
getSpinAxis(), getRangeUnitsConverter(),
isSimpleEOP(), getMu(), getDefaultMass(),
getDefaultInterpolationDegree(), newParsedUnitsBehavior,
getRangeUnitsConverter());
getDefaultInterpolationDegree(), newParsedUnitsBehavior);
}
/** Get the behavior to adopt for handling parsed units.
......@@ -244,25 +235,6 @@ public class ParserBuilder extends AbstractBuilder<ParserBuilder> {
return parsedUnitsBehavior;
}
/** Set up the converter for {@link RangeUnits#RU Range Units}.
* @param newRangeUnitsConverter converter for {@link RangeUnits#RU Range Units}
* @return a new builder with updated configuration (the instance is not changed)
*/
public ParserBuilder withRangeUnitsConverter(final RangeUnitsConverter newRangeUnitsConverter) {
return new ParserBuilder(getConventions(), getDataContext(),
getMissionReferenceDate(), getSpinAxis(),
isSimpleEOP(), getMu(), getDefaultMass(),
getDefaultInterpolationDegree(), getParsedUnitsBehavior(),
newRangeUnitsConverter);
}
/** Get the converter for {@link RangeUnits#RU Range Units}.
* @return converter for {@link RangeUnits#RU Range Units}
*/
public RangeUnitsConverter getRangeUnitsConverter() {
return rangeUnitsConverter;
}
/** Build a parser for {@link org.orekit.files.ccsds.ndm.NdmFile Navigation Data Messages}.
* @return a new parser
*/
......
......@@ -25,6 +25,7 @@ import org.orekit.files.ccsds.ndm.odm.ocm.OcmWriter;
import org.orekit.files.ccsds.ndm.odm.oem.OemWriter;
import org.orekit.files.ccsds.ndm.odm.omm.OmmWriter;
import org.orekit.files.ccsds.ndm.odm.opm.OpmWriter;
import org.orekit.files.ccsds.ndm.tdm.IdentityConverter;
import org.orekit.files.ccsds.ndm.tdm.RangeUnits;
import org.orekit.files.ccsds.ndm.tdm.RangeUnitsConverter;
import org.orekit.files.ccsds.ndm.tdm.TdmWriter;
......@@ -51,6 +52,7 @@ public class WriterBuilder extends AbstractBuilder<WriterBuilder> {
* <li>{@link #getConventions() IERS conventions} set to {@link IERSConventions#IERS_2010}</li>
* <li>{@link #getDataContext() data context} set to {@link DataContext#getDefault() default context}</li>
* <li>{@link #getMissionReferenceDate() mission reference date} set to {@code null}</li>
* <li>{@link #getRangeUnitsConverter() converter for range units} set to {@link IdentityConverter}</li>
* </ul>
* </p>
*/
......@@ -66,12 +68,13 @@ public class WriterBuilder extends AbstractBuilder<WriterBuilder> {
* <ul>
* <li>{@link #getConventions() IERS conventions} set to {@link IERSConventions#IERS_2010}</li>
* <li>{@link #getMissionReferenceDate() mission reference date} set to {@code null}</li>
* <li>{@link #getRangeUnitsConverter() converter for range units} set to {@link IdentityConverter}</li>
* </ul>
* </p>
* @param dataContext data context used to retrieve frames, time scales, etc.
*/
public WriterBuilder(final DataContext dataContext) {
this(IERSConventions.IERS_2010, dataContext, null, null);
this(IERSConventions.IERS_2010, dataContext, null, null, new IdentityConverter());
}
/** Complete constructor.
......@@ -79,17 +82,28 @@ public class WriterBuilder extends AbstractBuilder<WriterBuilder> {
* @param dataContext used to retrieve frames, time scales, etc.
* @param missionReferenceDate reference date for Mission Elapsed Time or Mission Relative Time time systems
* @param spinAxis spin axis in spacecraft body frame
* @param rangeUnitsConverter converter for {@link RangeUnits#RU Range Units}
*/
private WriterBuilder(final IERSConventions conventions, final DataContext dataContext,
final AbsoluteDate missionReferenceDate, final Vector3D spinAxis) {
super(conventions, dataContext, missionReferenceDate, spinAxis);
final AbsoluteDate missionReferenceDate, final Vector3D spinAxis,
final RangeUnitsConverter rangeUnitsConverter) {
super(conventions, dataContext, missionReferenceDate, spinAxis, rangeUnitsConverter);
}
/** {@inheritDoc} */
@Override
protected WriterBuilder create(final IERSConventions newConventions, final DataContext newDataContext,
final AbsoluteDate newMissionReferenceDate, final Vector3D newSpinAxis) {
return new WriterBuilder(newConventions, newDataContext, newMissionReferenceDate, newSpinAxis);
final AbsoluteDate newMissionReferenceDate,
final Vector3D newSpinAxis, final RangeUnitsConverter newRangeUnitsConverter) {
return new WriterBuilder(newConventions, newDataContext, newMissionReferenceDate,
newSpinAxis, newRangeUnitsConverter);
}
/** Build a writer for {@link org.orekit.files.ccsds.ndm.NdmFile Navigation Data Messages}.
* @return a new writer
*/
public NdmWriter buildNdmWriter() {
return new NdmWriter(this);
}
/** Build a writer for {@link org.orekit.files.ccsds.ndm.odm.opm.OpmFile Orbit Parameters Messages}.
......@@ -135,12 +149,10 @@ public class WriterBuilder extends AbstractBuilder<WriterBuilder> {
}
/** Build a writer for {@link org.orekit.files.ccsds.ndm.tdm.TdmFile Tracking Data Messages}.
* @param converter converter for {@link RangeUnits#RU Range Units} (may be null if there
* are no range observations in {@link RangeUnits#RU Range Units})
* @return a new writer
*/
public TdmWriter buildTdmWriter(final RangeUnitsConverter converter) {
return new TdmWriter(getConventions(), getDataContext(), converter);
public TdmWriter buildTdmWriter() {
return new TdmWriter(getConventions(), getDataContext(), getRangeUnitsConverter());
}
}
......@@ -59,7 +59,7 @@ import org.orekit.utils.units.Unit;
* or in the metadata section at the start of an AEM attitude segment.
* </p>
*
* <p> The AEM header for the whole AEM file is set when calling {@link #writeHeader(Generator, Header)},
* <p> The AEM header for the whole AEM file is set when calling {@link #writeMessageHeader(Generator, Header)},
* the entries are defined in table 4-2 of the ADM standard.
*
* <table>
......
......@@ -100,7 +100,7 @@ public class StreamingAemWriter {
* {@inheritDoc}
*
* <p> Sets the {@link AemMetadataKey#START_TIME} and {@link AemMetadataKey#STOP_TIME} in this
* segment's metadata if not already set by the user. Then calls {@link AemWriter#writeHeader(Generator, Header)
* segment's metadata if not already set by the user. Then calls {@link AemWriter#writeMessageHeader(Generator, Header)
* writeHeader} if it is the first segment) and {@link AemWriter#writeMetadata(Generator, AemMetadata)} to start the segment.
*/
@Override
......
......@@ -104,7 +104,7 @@ public class StreamingOemWriter {
* {@inheritDoc}
*
* <p> Sets the {@link OemMetadataKey#START_TIME} and {@link OemMetadataKey#STOP_TIME} in this
* segment's metadata if not already set by the user. Then calls {@link OemWriter#writeHeader(Generator,
* segment's metadata if not already set by the user. Then calls {@link OemWriter#writeMessageHeader(Generator,
* Header) writeHeader} if it is the first segment) and {@link OemWriter#writeMetadata(Generator, OemMetadata)}
* to start the segment.
*/
......
......@@ -93,7 +93,12 @@ public abstract class AbstractGenerator implements Generator {
/** {@inheritDoc} */
@Override
public void close() throws IOException {
// nothing to do
// get out from all sections properly
while (!sections.isEmpty()) {
exitSection();
}
}
/** {@inheritDoc} */
......
......@@ -89,7 +89,7 @@ public class KvnGenerator extends AbstractGenerator {
/** {@inheritDoc} */
@Override
public void endMessage(final String root) throws IOException {
public void endMessage(final String root) {
// nothing to do
}
......
......@@ -71,12 +71,14 @@ public class XmlGenerator extends AbstractGenerator {
* @param outputName output name for error messages
* @param writeUnits if true, units must be written
* @see #DEFAULT_INDENT
* @throws IOException if an I/O error occurs.
*/
public XmlGenerator(final Appendable output, final int indentation,
final String outputName, final boolean writeUnits) {
final String outputName, final boolean writeUnits) throws IOException {
super(output, outputName, writeUnits);
this.indentation = indentation;
this.level = 0;
writeRawData(String.format(AccurateFormatter.STANDARDIZED_LOCALE, PROLOG));
}
/** {@inheritDoc} */
......@@ -88,7 +90,6 @@ public class XmlGenerator extends AbstractGenerator {
/** {@inheritDoc} */
@Override
public void startMessage(final String root, final String messageTypeKey, final double version) throws IOException {
writeRawData(String.format(AccurateFormatter.STANDARDIZED_LOCALE, PROLOG));
indent();
writeRawData(String.format(AccurateFormatter.STANDARDIZED_LOCALE, ROOT_START,
root, messageTypeKey, version));
......
......@@ -728,3 +728,6 @@ INCOMPATIBLE_UNITS = <MISSING TRANSLATION>
# missing velocity data
MISSING_VELOCITY = <MISSING TRANSLATION>
# attempt to generate file {0} with a formatting error
ATTEMPT_TO_GENERATE_MALFORMED_FILE = <MISSING TRANSLATION>
......@@ -728,3 +728,6 @@ INCOMPATIBLE_UNITS = <MISSING TRANSLATION>
# missing velocity data
MISSING_VELOCITY = <MISSING TRANSLATION>
# attempt to generate file {0} with a formatting error
ATTEMPT_TO_GENERATE_MALFORMED_FILE = <MISSING TRANSLATION>
......@@ -728,3 +728,6 @@ INCOMPATIBLE_UNITS = <MISSING TRANSLATION>
# missing velocity data
MISSING_VELOCITY = <MISSING TRANSLATION>