Class KvnGenerator
- java.lang.Object
-
- org.orekit.files.ccsds.utils.generation.AbstractGenerator
-
- org.orekit.files.ccsds.utils.generation.KvnGenerator
-
- All Implemented Interfaces:
AutoCloseable,Generator
public class KvnGenerator extends AbstractGenerator
Generator for Key-Value Notation CCSDS messages.- Since:
- 11.0
- Author:
- Luc Maisonobe
-
-
Constructor Summary
Constructors Constructor Description KvnGenerator(Appendable output, int paddingWidth, String outputName, double maxRelativeOffset, int unitsColumn)Simple constructor.KvnGenerator(Appendable output, int paddingWidth, String outputName, double maxRelativeOffset, int unitsColumn, Formatter formatter)Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendMessage(String root)End CCSDS message.voidenterSection(String name)Enter into a new section.StringexitSection()Exit last section.FileFormatgetFormat()Get the generated file format.voidstartMessage(String root, String messageTypeKey, double version)Start CCSDS message.voidwriteComments(List<String> comments)Write comment lines.voidwriteEntry(String key, String value, Unit unit, boolean mandatory)Write a single key/value entry.-
Methods inherited from class org.orekit.files.ccsds.utils.generation.AbstractGenerator
close, complain, dateToCalendarString, dateToString, dateToString, doubleToString, getFormatter, getOutputName, newLine, siToCcsdsName, unitsListToString, writeEntry, writeEntry, writeEntry, writeEntry, writeEntry, writeEntry, writeEntry, writeRawData, writeRawData, writeUnits
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.orekit.files.ccsds.utils.generation.Generator
writeEntry
-
-
-
-
Constructor Detail
-
KvnGenerator
public KvnGenerator(Appendable output, int paddingWidth, String outputName, double maxRelativeOffset, int unitsColumn, Formatter formatter)
Simple constructor.- Parameters:
output- destination of generated outputpaddingWidth- padding width for aligning the '=' sign (not counting the extra blank added before the '=' sign)outputName- output name for error messagesmaxRelativeOffset- maximum offset in seconds to use relative dates (if a date is too far from reference, it will be displayed as calendar elements)unitsColumn- columns number for aligning units (if negative or zero, units are not output)formatter- to format double and dates to string- See Also:
TdmWriter.KVN_PADDING_WIDTH,AemWriter.KVN_PADDING_WIDTH,ApmWriter.KVN_PADDING_WIDTH,OpmWriter.KVN_PADDING_WIDTH,OmmWriter.KVN_PADDING_WIDTH,OemWriter.KVN_PADDING_WIDTH,OcmWriter.KVN_PADDING_WIDTH
-
KvnGenerator
public KvnGenerator(Appendable output, int paddingWidth, String outputName, double maxRelativeOffset, int unitsColumn)
Simple constructor.- Parameters:
output- destination of generated outputpaddingWidth- padding width for aligning the '=' sign (not counting the extra blank added before the '=' sign)outputName- output name for error messagesmaxRelativeOffset- maximum offset in seconds to use relative dates (if a date is too far from reference, it will be displayed as calendar elements)unitsColumn- columns number for aligning units (if negative or zero, units are not output)- See Also:
TdmWriter.KVN_PADDING_WIDTH,AemWriter.KVN_PADDING_WIDTH,ApmWriter.KVN_PADDING_WIDTH,OpmWriter.KVN_PADDING_WIDTH,OmmWriter.KVN_PADDING_WIDTH,OemWriter.KVN_PADDING_WIDTH,OcmWriter.KVN_PADDING_WIDTH
-
-
Method Detail
-
getFormat
public FileFormat getFormat()
Get the generated file format.- Returns:
- generated file format
-
startMessage
public void startMessage(String root, String messageTypeKey, double version) throws IOException
Start CCSDS message.- Parameters:
root- root element for XML filesmessageTypeKey- key for message typeversion- format version- Throws:
IOException- if an I/O error occurs.
-
endMessage
public void endMessage(String root)
End CCSDS message.- Parameters:
root- root element for XML files
-
writeComments
public void writeComments(List<String> comments) throws IOException
Write comment lines.- Parameters:
comments- comments to write- Throws:
IOException- if an I/O error occurs.
-
writeEntry
public void writeEntry(String key, String value, Unit unit, boolean mandatory) throws IOException
Write a single key/value entry.- Parameters:
key- the keyword to writevalue- the value to writeunit- output unit (may be null)mandatory- if true, null values triggers exception, otherwise they are silently ignored- Throws:
IOException- if an I/O error occurs.
-
enterSection
public void enterSection(String name) throws IOException
Enter into a new section.- Specified by:
enterSectionin interfaceGenerator- Overrides:
enterSectionin classAbstractGenerator- Parameters:
name- section name- Throws:
IOException- if an I/O error occurs.
-
exitSection
public String exitSection() throws IOException
Exit last section.- Specified by:
exitSectionin interfaceGenerator- Overrides:
exitSectionin classAbstractGenerator- Returns:
- section name
- Throws:
IOException- if an I/O error occurs.
-
-