Class KvnGenerator
java.lang.Object
org.orekit.files.ccsds.utils.generation.AbstractGenerator
org.orekit.files.ccsds.utils.generation.KvnGenerator
- All Implemented Interfaces:
AutoCloseable,Generator
Generator for Key-Value Notation CCSDS messages.
- Since:
- 11.0
- Author:
- Luc Maisonobe
-
Constructor Summary
ConstructorsConstructorDescriptionKvnGenerator(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
Modifier and TypeMethodDescriptionvoidendMessage(String root) End CCSDS message.voidenterSection(String name) Enter into a new section.Exit last section.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, writeUnitsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.orekit.files.ccsds.utils.generation.Generator
writeEntry
-
Constructor Details
-
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:
-
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:
-
-
Method Details
-
getFormat
Get the generated file format.- Returns:
- generated file format
-
startMessage
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
End CCSDS message.- Parameters:
root- root element for XML files
-
writeComments
Write comment lines.- Parameters:
comments- comments to write- Throws:
IOException- if an I/O error occurs.
-
writeEntry
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
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
Exit last section.- Specified by:
exitSectionin interfaceGenerator- Overrides:
exitSectionin classAbstractGenerator- Returns:
- section name
- Throws:
IOException- if an I/O error occurs.
-