Class TDMParser

  • All Implemented Interfaces:
    ContentHandler, DTDHandler, EntityResolver, ErrorHandler

    public class TDMParser
    extends DefaultHandler
    Class for CCSDS Tracking Data Message parsers.

    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).

    Since:
    9.0
    Author:
    Maxime Journot
    • Constructor Detail

      • TDMParser

        public TDMParser()
        Simple constructor.

        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)

    • Method Detail

      • withFileFormat

        public TDMParser withFileFormat​(TDMParser.TDMFileFormat newFileFormat)
        Set file format.
        Parameters:
        newFileFormat - The format of the file: KEYVALUE or XML
        Returns:
        a new instance, with file format set to newFileFormat
        See Also:
        getFileFormat()
      • withMissionReferenceDate

        public TDMParser withMissionReferenceDate​(AbsoluteDate newMissionReferenceDate)
        Set initial date.
        Parameters:
        newMissionReferenceDate - mission reference date to use while parsing
        Returns:
        a new instance, with mission reference date replaced
        See Also:
        getMissionReferenceDate()
      • withConventions

        public TDMParser withConventions​(IERSConventions newConventions)
        Set IERS conventions.
        Parameters:
        newConventions - IERS conventions to use while parsing
        Returns:
        a new instance, with IERS conventions replaced
        See Also:
        getConventions()
      • withSimpleEOP

        public TDMParser withSimpleEOP​(boolean newSimpleEOP)
        Set EOP interpolation method.
        Parameters:
        newSimpleEOP - if true, tidal effects are ignored when interpolating EOP
        Returns:
        a new instance, with EOP interpolation method replaced
        See Also:
        isSimpleEOP()
      • isSimpleEOP

        public boolean isSimpleEOP()
        Get EOP interpolation method.
        Returns:
        true if tidal effects are ignored when interpolating EOP
        See Also:
        withSimpleEOP(boolean)
      • parse

        public TDMFile parse​(String fileName)
        Parse a CCSDS Tracking Data Message.
        Parameters:
        fileName - name of the file containing the message
        Returns:
        parsed file content in a TDMFile object
      • parse

        public TDMFile parse​(InputStream stream)
        Parse a CCSDS Tracking Data Message.
        Parameters:
        stream - stream containing message
        Returns:
        parsed file content in a TDMFile object
      • parse

        public TDMFile parse​(InputStream stream,
                             String fileName)
        Parse a CCSDS Tracking Data Message.
        Parameters:
        stream - stream containing message
        fileName - name of the file containing the message (for error messages)
        Returns:
        parsed file content in a TDMFile object
      • parseKeyValue

        public TDMFile parseKeyValue​(InputStream stream,
                                     String fileName)
        Parse a CCSDS Tracking Data Message with KEYVALUE format.
        Parameters:
        stream - stream containing message
        fileName - name of the file containing the message (for error messages)
        Returns:
        parsed file content in a TDMFile object
      • parseXml

        public TDMFile parseXml​(InputStream stream,
                                String fileName)
        Parse a CCSDS Tracking Data Message with XML format.
        Parameters:
        stream - stream containing message
        fileName - name of the file containing the message (for error messages)
        Returns:
        parsed file content in a TDMFile object