Class StringDataEncoding

java.lang.Object
org.yamcs.xtce.DataEncoding
org.yamcs.xtce.StringDataEncoding
All Implemented Interfaces:
Serializable

public class StringDataEncoding extends DataEncoding
For common encodings of string data.

String data is encoded in a buffer. The size of the buffer may be fixed or variable. The size of the string may be variable inside the buffer or may take the whole buffer.

Upon decoding a packet, the resulting raw value will be the string extracted from the buffer but the parameter is considered to occupy the whole buffer (meaning that the next parameter will come in the packet after the end of the buffer not after the end of the string)

The distinction between the string and the buffer containing the string has been made in Yamcs 5.5 in order to comply better with the XTCE 1.2.

See Also:
  • Constructor Details

  • Method Details

    • toBuilder

      public StringDataEncoding.Builder toBuilder()
      Specified by:
      toBuilder in class DataEncoding
    • setSizeType

      public void setSizeType(StringDataEncoding.SizeType sizeType)
    • getSizeType

      public StringDataEncoding.SizeType getSizeType()
    • getSizeInBytesOfSizeTag

      public int getSizeInBytesOfSizeTag()
    • getSizeInBitsOfSizeTag

      public int getSizeInBitsOfSizeTag()
    • getTerminationChar

      public byte getTerminationChar()
    • setTerminationChar

      public void setTerminationChar(byte tc)
    • getDynamicBufferSize

      public DynamicIntegerValue getDynamicBufferSize()
    • getMaxSizeInBytes

      public int getMaxSizeInBytes()
    • setMaxSizeInBytes

      public void setMaxSizeInBytes(int maxSizeInBytes)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • parseString

      public Object parseString(String stringValue)
      Description copied from class: DataEncoding
      parses the string into a java object of the correct type Has to match the DataEncodingDecoder (so probably it should be moved there somehow: TODO)
      Specified by:
      parseString in class DataEncoding
    • getEncoding

      public String getEncoding()
    • setEncoding

      public void setEncoding(String encoding)
    • copy

      public StringDataEncoding copy()
      Description copied from class: DataEncoding
      Create a shallow copy of the data encoding
      Specified by:
      copy in class DataEncoding
      Returns: