Package org.yamcs.xtce
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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStringDataEncoding.Builderstatic classStringDataEncoding.SizeType
-
Field Summary
-
Fields inherited from class org.yamcs.xtce.DataEncoding
fromBinaryTransformAlgorithm, sizeInBits, toBinaryTransformAlgorithm
-
-
Constructor Summary
Constructors Constructor Description StringDataEncoding(StringDataEncoding.Builder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringDataEncodingcopy()Create a shallow copy of the data encodingDynamicIntegerValuegetDynamicBufferSize()StringgetEncoding()intgetMaxSizeInBytes()intgetSizeInBitsOfSizeTag()intgetSizeInBytesOfSizeTag()StringDataEncoding.SizeTypegetSizeType()bytegetTerminationChar()ObjectparseString(String stringValue)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)voidsetEncoding(String encoding)voidsetSizeType(StringDataEncoding.SizeType sizeType)voidsetTerminationChar(byte tc)StringDataEncoding.BuildertoBuilder()StringtoString()-
Methods inherited from class org.yamcs.xtce.DataEncoding
getByteOrder, getDependentParameters, getFromBinaryTransformAlgorithm, getSizeInBits, getToBinaryTransformAlgorithm, setFromBinaryTransformAlgorithm, setSizeInBits, setToBinaryTransformAlgorithm
-
-
-
-
Constructor Detail
-
StringDataEncoding
public StringDataEncoding(StringDataEncoding.Builder builder)
-
-
Method Detail
-
toBuilder
public StringDataEncoding.Builder toBuilder()
- Specified by:
toBuilderin classDataEncoding
-
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()
-
parseString
public Object parseString(String stringValue)
Description copied from class:DataEncodingparses 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:
parseStringin classDataEncoding
-
getEncoding
public String getEncoding()
-
setEncoding
public void setEncoding(String encoding)
-
copy
public StringDataEncoding copy()
Description copied from class:DataEncodingCreate a shallow copy of the data encoding- Specified by:
copyin classDataEncoding- Returns:
-
-