public class TDMParser extends DefaultHandler
This base class is immutable, and hence thread safe. When parts must be
changed, such as reference date for Mission Elapsed Time or Mission Relative
Time time systems, or the gravitational coefficient or the IERS conventions,
the various withXxx
methods must be called, which create a new
immutable instance with the new parameters. This is a combination of the builder design
pattern and a fluent
interface.
This class allow the handling of both "keyvalue" and "xml" TDM file formats.
Format can be inferred if file names ends respectively with ".txt" or ".xml".
Otherwise it must be explicitely set using withFileFormat(TDMFileFormat)
ParseInfo subclass regroups common parsing functions; and specific handlers were added for both file formats.
References:
- CCSDS 503.0-B-1 recommended standard ("Tracking Data Message", Blue Book, Issue 1, November 2007).
- CCSDS 505.0-B-1 recommended standard ("XML Specification for Navigation Data Message", Blue Book, Issue 1, December 2010).
Modifier and Type | Class and Description |
---|---|
static class |
TDMParser.TDMFileFormat
Enumerate for the format.
|
Constructor and Description |
---|
TDMParser()
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
IERSConventions |
getConventions()
Get IERS conventions.
|
TDMParser.TDMFileFormat |
getFileFormat()
Get file format.
|
AbsoluteDate |
getMissionReferenceDate()
Get initial date.
|
boolean |
isSimpleEOP()
Get EOP interpolation method.
|
TDMFile |
parse(InputStream stream)
Parse a CCSDS Tracking Data Message.
|
TDMFile |
parse(InputStream stream,
String fileName)
Parse a CCSDS Tracking Data Message.
|
TDMFile |
parse(String fileName)
Parse a CCSDS Tracking Data Message.
|
TDMFile |
parseKeyValue(InputStream stream,
String fileName)
Parse a CCSDS Tracking Data Message with KEYVALUE format.
|
TDMFile |
parseXml(InputStream stream,
String fileName)
Parse a CCSDS Tracking Data Message with XML format.
|
TDMParser |
withConventions(IERSConventions newConventions)
Set IERS conventions.
|
TDMParser |
withFileFormat(TDMParser.TDMFileFormat newFileFormat)
Set file format.
|
TDMParser |
withMissionReferenceDate(AbsoluteDate newMissionReferenceDate)
Set initial date.
|
TDMParser |
withSimpleEOP(boolean newSimpleEOP)
Set EOP interpolation method.
|
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
public TDMParser()
This class is immutable, and hence thread safe. When parts
must be changed, such fiel format or reference date for Mission Elapsed Time or
Mission Relative Time time systems, or the IERS conventions,
the various withXxx
methods must be called,
which create a new immutable instance with the new parameters. This
is a combination of the
builder design
pattern and a
fluent
interface.
The initial date for Mission Elapsed Time and Mission Relative Time time systems is not set here.
If such time systems are used, it must be initialized before parsing by calling withMissionReferenceDate(AbsoluteDate)
.
The IERS conventions to use is not set here. If it is needed in order to
parse some reference frames or UT1 time scale, it must be initialized before
parsing by calling withConventions(IERSConventions)
.
The TDM file format to use is not set here. It may be automatically inferred while parsing
if the name of the file to parse ends with ".txt" or ".xml".
Otherwise it must be initialized before parsing by calling withFileFormat(TDMFileFormat)
public TDMParser withFileFormat(TDMParser.TDMFileFormat newFileFormat)
newFileFormat
- The format of the file: KEYVALUE or XMLgetFileFormat()
public TDMParser.TDMFileFormat getFileFormat()
withFileFormat(TDMFileFormat)
public TDMParser withMissionReferenceDate(AbsoluteDate newMissionReferenceDate)
newMissionReferenceDate
- mission reference date to use while parsinggetMissionReferenceDate()
public AbsoluteDate getMissionReferenceDate()
withMissionReferenceDate(AbsoluteDate)
public TDMParser withConventions(IERSConventions newConventions)
newConventions
- IERS conventions to use while parsinggetConventions()
public IERSConventions getConventions()
withConventions(IERSConventions)
public TDMParser withSimpleEOP(boolean newSimpleEOP)
newSimpleEOP
- if true, tidal effects are ignored when interpolating EOPisSimpleEOP()
public boolean isSimpleEOP()
withSimpleEOP(boolean)
public TDMFile parse(String fileName) throws OrekitException
fileName
- name of the file containing the messageOrekitException
- if Tracking Date Message cannot be parsed or if file cannot be foundpublic TDMFile parse(InputStream stream) throws OrekitException
stream
- stream containing messageOrekitException
- if Tracking Date Message cannot be parsedpublic TDMFile parse(InputStream stream, String fileName) throws OrekitException
stream
- stream containing messagefileName
- name of the file containing the message (for error messages)OrekitException
- if Tracking Date Message cannot be parsed or format is unknownpublic TDMFile parseKeyValue(InputStream stream, String fileName) throws OrekitException
stream
- stream containing messagefileName
- name of the file containing the message (for error messages)OrekitException
- if Tracking Date Message cannot be parsedpublic TDMFile parseXml(InputStream stream, String fileName) throws OrekitException
stream
- stream containing messagefileName
- name of the file containing the message (for error messages)OrekitException
- if Tracking Date Message cannot be parsedCopyright © 2002-2017 CS Systèmes d'information. All rights reserved.