Class CdmMessageWriter

    • Constructor Detail

      • CdmMessageWriter

        public CdmMessageWriter​(String root,
                                String formatVersionKey,
                                double defaultVersion,
                                ContextBinding context)
        Constructor used to create a new NDM writer configured with the necessary parameters to successfully fill in all required fields that aren't part of a standard object.

        If creation date and originator are not present in header, built-in defaults will be used

        Parameters:
        root - root element for XML files
        formatVersionKey - key for format version
        defaultVersion - default format version
        context - context binding (may be reset for each segment)
    • Method Detail

      • setContext

        public void setContext​(ContextBinding context)
        Reset context binding.
        Parameters:
        context - context binding to use
      • getContext

        public ContextBinding getContext()
        Get the current context.
        Returns:
        current context
      • getTimeConverter

        public TimeConverter getTimeConverter()
        Get the current time converter.
        Returns:
        current time converter
      • getDefaultVersion

        public double getDefaultVersion()
        Get the default format version.
        Returns:
        default format version
      • writeRelativeMetadataContent

        public abstract void writeRelativeMetadataContent​(Generator generator,
                                                          double formatVersion,
                                                          CdmRelativeMetadata relativeMetadata)
                                                   throws IOException
        Write RelativeMetadata part only once after header.
        Parameters:
        generator - generator to use for producing output
        formatVersion - format version to use
        relativeMetadata - relative metadata to write
        Throws:
        IOException - if any buffer writing operations fails
      • writeSegmentContent

        public abstract void writeSegmentContent​(Generator generator,
                                                 double formatVersion,
                                                 Segment<CdmMetadata,​CdmData> segment)
                                          throws IOException
        Write one segment content (without XML wrapping).
        Parameters:
        generator - generator to use for producing output
        formatVersion - format version to use
        segment - segment to write
        Throws:
        IOException - if any buffer writing operations fails