- java.lang.Object
-
- org.refcodes.serial.SequenceSection
-
- org.refcodes.serial.DynamicTypeSection
-
- All Implemented Interfaces:
Serializable
,org.refcodes.mixin.AliasAccessor
,org.refcodes.mixin.EncodingAccessor<Charset>
,org.refcodes.mixin.LengthAccessor
,org.refcodes.mixin.PayloadAccessor<Sequence>
,org.refcodes.mixin.PayloadAccessor.PayloadBuilder<Sequence,PayloadTransmission<Sequence>>
,org.refcodes.mixin.PayloadAccessor.PayloadMutator<Sequence>
,org.refcodes.mixin.PayloadAccessor.PayloadProperty<Sequence>
,org.refcodes.numerical.EndianessAccessor
,DynamicTypeTransmission
,LengthWidthAccessor
,PayloadSection<Sequence>
,PayloadTransmission<Sequence>
,Section
,Section.SectionMixin
,Transmission
,Transmission.TransmissionMixin
public class DynamicTypeSection extends SequenceSection implements Section, LengthWidthAccessor, org.refcodes.numerical.EndianessAccessor, org.refcodes.mixin.EncodingAccessor<Charset>, DynamicTypeTransmission
TheDynamicTypeSection
represents aSection
which's internal raw data is created from provided types at runtime and which's internal raw data is used to create provided types at runtime. Therefore internally it just consists of aSequence
which is created if necessary from a provided type or from which a provided type is instantiated if necessary.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.AliasAccessor
org.refcodes.mixin.AliasAccessor.AliasBuilder<B extends org.refcodes.mixin.AliasAccessor.AliasBuilder<B>>, org.refcodes.mixin.AliasAccessor.AliasMutator, org.refcodes.mixin.AliasAccessor.AliasProperty
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.EncodingAccessor
org.refcodes.mixin.EncodingAccessor.EncodingBuilder<E extends Object,B extends org.refcodes.mixin.EncodingAccessor.EncodingBuilder<E,B>>, org.refcodes.mixin.EncodingAccessor.EncodingMutator<E extends Object>, org.refcodes.mixin.EncodingAccessor.EncodingProperty<E extends Object>
-
Nested classes/interfaces inherited from interface org.refcodes.numerical.EndianessAccessor
org.refcodes.numerical.EndianessAccessor.EndianessBuilder<B extends org.refcodes.numerical.EndianessAccessor.EndianessBuilder<B>>, org.refcodes.numerical.EndianessAccessor.EndianessMutator, org.refcodes.numerical.EndianessAccessor.EndianessProperty
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.LengthAccessor
org.refcodes.mixin.LengthAccessor.LengthBuilder<B extends org.refcodes.mixin.LengthAccessor.LengthBuilder<B>>, org.refcodes.mixin.LengthAccessor.LengthMutator, org.refcodes.mixin.LengthAccessor.LengthProperty
-
Nested classes/interfaces inherited from interface org.refcodes.serial.LengthWidthAccessor
LengthWidthAccessor.LengthWidthBuilder<B extends LengthWidthAccessor.LengthWidthBuilder<B>>, LengthWidthAccessor.LengthWidthMutator, LengthWidthAccessor.LengthWidthProperty
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.PayloadAccessor
org.refcodes.mixin.PayloadAccessor.PayloadBuilder<P extends Object,B extends org.refcodes.mixin.PayloadAccessor.PayloadBuilder<P,B>>, org.refcodes.mixin.PayloadAccessor.PayloadMutator<P extends Object>, org.refcodes.mixin.PayloadAccessor.PayloadProperty<P extends Object>
-
Nested classes/interfaces inherited from interface org.refcodes.serial.Section
Section.SectionMixin
-
Nested classes/interfaces inherited from interface org.refcodes.serial.Transmission
Transmission.TransmissionMixin
-
-
Field Summary
-
Fields inherited from class org.refcodes.serial.SequenceSection
_alias, _sequence
-
-
Constructor Summary
Constructors Constructor Description DynamicTypeSection()
Constructs theDynamicTypeSection
with the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH
,TransmissionMetrics.DEFAULT_ENDIANESS
as well asTransmissionMetrics.DEFAULT_ENCODING
).DynamicTypeSection(int aLengthWidth, org.refcodes.numerical.Endianess aEndianess)
Constructs theDynamicTypeSection
with the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING
.DynamicTypeSection(int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset)
Constructs theDynamicTypeSection
with the given properties.DynamicTypeSection(String aAlias)
Constructs theDynamicTypeSection
with the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH
,TransmissionMetrics.DEFAULT_ENDIANESS
as well asTransmissionMetrics.DEFAULT_ENCODING
).DynamicTypeSection(String aAlias, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess)
Constructs theDynamicTypeSection
with the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING
.DynamicTypeSection(String aAlias, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset)
Constructs theDynamicTypeSection
with the given properties.DynamicTypeSection(String aAlias, Charset aCharset)
Constructs theDynamicTypeSection
with the givenCharSection
, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTH
and theTransmissionMetrics.DEFAULT_ENDIANESS
.DynamicTypeSection(String aAlias, TransmissionMetrics aTransmissionMetrics)
Constructs theDynamicTypeSection
with the given properties.DynamicTypeSection(String aAlias, T aValue)
Constructs theDynamicTypeSection
with the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH
,TransmissionMetrics.DEFAULT_ENDIANESS
as well asTransmissionMetrics.DEFAULT_ENCODING
).DynamicTypeSection(String aAlias, T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess)
Constructs theDynamicTypeSection
with the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING
.DynamicTypeSection(String aAlias, T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, String... aAttributes)
Constructs theDynamicTypeSection
with the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING
.DynamicTypeSection(String aAlias, T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset)
Constructs theDynamicTypeSection
with the given properties.DynamicTypeSection(String aAlias, T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset, String... aAttributes)
Constructs theDynamicTypeSection
with the given properties.DynamicTypeSection(String aAlias, T aValue, String... aAttributes)
Constructs theDynamicTypeSection
with the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH
,TransmissionMetrics.DEFAULT_ENDIANESS
as well asTransmissionMetrics.DEFAULT_ENCODING
).DynamicTypeSection(String aAlias, T aValue, Charset aCharset)
Constructs theDynamicTypeSection
with the givenCharSection
, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTH
and theTransmissionMetrics.DEFAULT_ENDIANESS
.DynamicTypeSection(String aAlias, T aValue, Charset aCharset, String... aAttributes)
Constructs theDynamicTypeSection
with the givenCharSection
, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTH
and theTransmissionMetrics.DEFAULT_ENDIANESS
.DynamicTypeSection(String aAlias, T aValue, TransmissionMetrics aTransmissionMetrics)
Constructs theDynamicTypeSection
with the given properties.DynamicTypeSection(String aAlias, T aValue, TransmissionMetrics aTransmissionMetrics, String... aAttributes)
Constructs theDynamicTypeSection
with the given properties.DynamicTypeSection(Charset aCharset)
Constructs theDynamicTypeSection
with the givenCharSection
, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTH
and theTransmissionMetrics.DEFAULT_ENDIANESS
.DynamicTypeSection(TransmissionMetrics aTransmissionMetrics)
Constructs theDynamicTypeSection
with the given properties.DynamicTypeSection(T aValue)
Constructs theDynamicTypeSection
with the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH
,TransmissionMetrics.DEFAULT_ENDIANESS
as well asTransmissionMetrics.DEFAULT_ENCODING
).DynamicTypeSection(T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess)
Constructs theDynamicTypeSection
with the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING
.DynamicTypeSection(T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, String... aAttributes)
Constructs theDynamicTypeSection
with the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING
.DynamicTypeSection(T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset)
Constructs theDynamicTypeSection
with the given properties.DynamicTypeSection(T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset, String... aAttributes)
Constructs theDynamicTypeSection
with the given properties.DynamicTypeSection(T aValue, String... aAttributes)
Constructs theDynamicTypeSection
with the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH
,TransmissionMetrics.DEFAULT_ENDIANESS
as well asTransmissionMetrics.DEFAULT_ENCODING
).DynamicTypeSection(T aValue, Charset aCharset)
Constructs theDynamicTypeSection
with the givenCharSection
, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTH
and theTransmissionMetrics.DEFAULT_ENDIANESS
.DynamicTypeSection(T aValue, Charset aCharset, String... aAttributes)
Constructs theDynamicTypeSection
with the givenCharSection
, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTH
and theTransmissionMetrics.DEFAULT_ENDIANESS
.DynamicTypeSection(T aValue, TransmissionMetrics aTransmissionMetrics)
Constructs theDynamicTypeSection
with the given properties.DynamicTypeSection(T aValue, TransmissionMetrics aTransmissionMetrics, String... aAttributes)
Constructs theDynamicTypeSection
with the given properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> void
fromType(T aValue)
Constructs theDynamicTypeSection
'sSequence
from the given type's instance .<T> void
fromType(T aValue, String... aAttributes)
Constructs an instance for the given type T. .Charset
getEncoding()
org.refcodes.numerical.Endianess
getEndianess()
int
getLengthWidth()
Retrieves the length width (in bytes) from the length width (in bytes) property.Schema
toSchema()
Retrieves theSchema
representing theTransmission
.org.refcodes.struct.SimpleTypeMap
toSimpleTypeMap()
Returns theSimpleTypeMap
representation of thisTransmission
.<T> T
toType(Class<T> aType)
Constructs an instance for the given type T.<T> T
toType(Class<T> aType, String... aAttributes)
Constructs an instance for the given type T. .-
Methods inherited from class org.refcodes.serial.SequenceSection
fromTransmission, getAlias, getLength, getPayload, setPayload, toSequence, withPayload
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.refcodes.serial.Section
fromTransmission, fromTransmission, fromTransmission, fromTransmission, receiveFrom, receiveFrom
-
Methods inherited from interface org.refcodes.serial.Section.SectionMixin
receiveFrom
-
Methods inherited from interface org.refcodes.serial.Transmission
getLength, toSequence, transmitTo, transmitTo
-
Methods inherited from interface org.refcodes.serial.Transmission.TransmissionMixin
transmitTo
-
-
-
-
Constructor Detail
-
DynamicTypeSection
public DynamicTypeSection()
Constructs theDynamicTypeSection
with the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH
,TransmissionMetrics.DEFAULT_ENDIANESS
as well asTransmissionMetrics.DEFAULT_ENCODING
).
-
DynamicTypeSection
public DynamicTypeSection(Charset aCharset)
Constructs theDynamicTypeSection
with the givenCharSection
, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTH
and theTransmissionMetrics.DEFAULT_ENDIANESS
.
-
DynamicTypeSection
public DynamicTypeSection(int aLengthWidth, org.refcodes.numerical.Endianess aEndianess)
Constructs theDynamicTypeSection
with the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING
.- Parameters:
aLengthWidth
- The width (in bytes) to be used for length values.aEndianess
- TheEndianess
to be used for (length) values.
-
DynamicTypeSection
public DynamicTypeSection(int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset)
Constructs theDynamicTypeSection
with the given properties.
-
DynamicTypeSection
public DynamicTypeSection(String aAlias)
Constructs theDynamicTypeSection
with the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH
,TransmissionMetrics.DEFAULT_ENDIANESS
as well asTransmissionMetrics.DEFAULT_ENCODING
).- Parameters:
aAlias
- The alias which identifies the content of this segment.
-
DynamicTypeSection
public DynamicTypeSection(String aAlias, Charset aCharset)
Constructs theDynamicTypeSection
with the givenCharSection
, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTH
and theTransmissionMetrics.DEFAULT_ENDIANESS
.
-
DynamicTypeSection
public DynamicTypeSection(String aAlias, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess)
Constructs theDynamicTypeSection
with the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING
.- Parameters:
aAlias
- The alias which identifies the content of this segment.aLengthWidth
- The width (in bytes) to be used for length values.aEndianess
- TheEndianess
to be used for (length) values.
-
DynamicTypeSection
public DynamicTypeSection(String aAlias, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset)
Constructs theDynamicTypeSection
with the given properties.
-
DynamicTypeSection
public DynamicTypeSection(String aAlias, T aValue)
Constructs theDynamicTypeSection
with the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH
,TransmissionMetrics.DEFAULT_ENDIANESS
as well asTransmissionMetrics.DEFAULT_ENCODING
). It is pre-initialized with the given value as offromType(Object)
.- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aAlias
- The alias which identifies the content of this segment.aValue
- The data structure's value.
-
DynamicTypeSection
public DynamicTypeSection(String aAlias, T aValue, Charset aCharset)
Constructs theDynamicTypeSection
with the givenCharSection
, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTH
and theTransmissionMetrics.DEFAULT_ENDIANESS
. It is pre-initialized with the given value as offromType(Object)
.
-
DynamicTypeSection
public DynamicTypeSection(String aAlias, T aValue, Charset aCharset, String... aAttributes)
Constructs theDynamicTypeSection
with the givenCharSection
, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTH
and theTransmissionMetrics.DEFAULT_ENDIANESS
. It is pre-initialized with the given value as offromType(Object, String...)
.- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aAlias
- The alias which identifies the content of this segment.aValue
- The data structure's value.aCharset
- TheCharset
to be used for encoding and decodingString
instances.aAttributes
- The attributes or null if all attributes are to be processed in alphabetical order.
-
DynamicTypeSection
public DynamicTypeSection(String aAlias, T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess)
Constructs theDynamicTypeSection
with the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING
. It is pre-initialized with the given value as offromType(Object)
.- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aAlias
- The alias which identifies the content of this segment.aValue
- The data structure's value.aLengthWidth
- The width (in bytes) to be used for length values.aEndianess
- TheEndianess
to be used for (length) values.
-
DynamicTypeSection
public DynamicTypeSection(String aAlias, T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset)
Constructs theDynamicTypeSection
with the given properties. It is pre-initialized with the given value as offromType(Object)
.- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aAlias
- The alias which identifies the content of this segment.aValue
- The data structure's value.aLengthWidth
- The width (in bytes) to be used for length values.aEndianess
- TheEndianess
to be used for (length) values.aCharset
- TheCharset
to be used for encoding and decodingString
instances.
-
DynamicTypeSection
public DynamicTypeSection(String aAlias, T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset, String... aAttributes)
Constructs theDynamicTypeSection
with the given properties. It is pre-initialized with the given value as offromType(Object, String...)
.- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aAlias
- The alias which identifies the content of this segment.aValue
- The data structure's value.aLengthWidth
- The width (in bytes) to be used for length values.aEndianess
- TheEndianess
to be used for (length) values.aCharset
- TheCharset
to be used for encoding and decodingString
instances.aAttributes
- The attributes or null if all attributes are to be processed in alphabetical order.
-
DynamicTypeSection
public DynamicTypeSection(String aAlias, T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, String... aAttributes)
Constructs theDynamicTypeSection
with the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING
. It is pre-initialized with the given value as offromType(Object, String...)
.- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aAlias
- The alias which identifies the content of this segment.aValue
- The data structure's value.aLengthWidth
- The width (in bytes) to be used for length values.aEndianess
- TheEndianess
to be used for (length) values.aAttributes
- The attributes or null if all attributes are to be processed in alphabetical order.
-
DynamicTypeSection
public DynamicTypeSection(String aAlias, T aValue, String... aAttributes)
Constructs theDynamicTypeSection
with the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH
,TransmissionMetrics.DEFAULT_ENDIANESS
as well asTransmissionMetrics.DEFAULT_ENCODING
). It is pre-initialized with the given value as offromType(Object, String...)
.- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aAlias
- The alias which identifies the content of this segment.aValue
- The data structure's value.aAttributes
- The attributes or null if all attributes are to be processed in alphabetical order.
-
DynamicTypeSection
public DynamicTypeSection(String aAlias, T aValue, TransmissionMetrics aTransmissionMetrics)
Constructs theDynamicTypeSection
with the given properties. It is pre-initialized with the given value as offromType(Object)
. The configuration attributes are taken from theTransmissionMetrics
configuration object, though only those attributes are supported which are also supported by the other constructors!- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aAlias
- The alias which identifies the content of this segment.aValue
- The data structure's value.aTransmissionMetrics
- TheTransmissionMetrics
to be used for configuring this instance.
-
DynamicTypeSection
public DynamicTypeSection(String aAlias, T aValue, TransmissionMetrics aTransmissionMetrics, String... aAttributes)
Constructs theDynamicTypeSection
with the given properties. It is pre-initialized with the given value as offromType(Object, String...)
. The configuration attributes are taken from theTransmissionMetrics
configuration object, though only those attributes are supported which are also supported by the other constructors!- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aAlias
- The alias which identifies the content of this segment.aValue
- The data structure's value.aTransmissionMetrics
- TheTransmissionMetrics
to be used for configuring this instance.aAttributes
- The attributes or null if all attributes are to be processed in alphabetical order.
-
DynamicTypeSection
public DynamicTypeSection(String aAlias, TransmissionMetrics aTransmissionMetrics)
Constructs theDynamicTypeSection
with the given properties. The configuration attributes are taken from theTransmissionMetrics
configuration object, though only those attributes are supported which are also supported by the other constructors!- Parameters:
aAlias
- The alias which identifies the content of this segment.aTransmissionMetrics
- TheTransmissionMetrics
to be used for configuring this instance.
-
DynamicTypeSection
public DynamicTypeSection(T aValue)
Constructs theDynamicTypeSection
with the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH
,TransmissionMetrics.DEFAULT_ENDIANESS
as well asTransmissionMetrics.DEFAULT_ENCODING
). It is pre-initialized with the given value as offromType(Object)
.- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aValue
- The data structure's value.
-
DynamicTypeSection
public DynamicTypeSection(T aValue, Charset aCharset)
Constructs theDynamicTypeSection
with the givenCharSection
, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTH
and theTransmissionMetrics.DEFAULT_ENDIANESS
. It is pre-initialized with the given value as offromType(Object)
.
-
DynamicTypeSection
public DynamicTypeSection(T aValue, Charset aCharset, String... aAttributes)
Constructs theDynamicTypeSection
with the givenCharSection
, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTH
and theTransmissionMetrics.DEFAULT_ENDIANESS
. It is pre-initialized with the given value as offromType(Object, String...)
.
-
DynamicTypeSection
public DynamicTypeSection(T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess)
Constructs theDynamicTypeSection
with the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING
. It is pre-initialized with the given value as offromType(Object)
.- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aValue
- The data structure's value.aLengthWidth
- The width (in bytes) to be used for length values.aEndianess
- TheEndianess
to be used for (length) values.
-
DynamicTypeSection
public DynamicTypeSection(T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset)
Constructs theDynamicTypeSection
with the given properties. It is pre-initialized with the given value as offromType(Object)
.- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aValue
- The data structure's value.aLengthWidth
- The width (in bytes) to be used for length values.aEndianess
- TheEndianess
to be used for (length) values.aCharset
- TheCharset
to be used for encoding and decodingString
instances.
-
DynamicTypeSection
public DynamicTypeSection(T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset, String... aAttributes)
Constructs theDynamicTypeSection
with the given properties. It is pre-initialized with the given value as offromType(Object, String...)
.- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aValue
- The data structure's value.aLengthWidth
- The width (in bytes) to be used for length values.aEndianess
- TheEndianess
to be used for (length) values.aCharset
- TheCharset
to be used for encoding and decodingString
instances.aAttributes
- The attributes or null if all attributes are to be processed in alphabetical order.
-
DynamicTypeSection
public DynamicTypeSection(T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, String... aAttributes)
Constructs theDynamicTypeSection
with the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING
. It is pre-initialized with the given value as offromType(Object, String...)
.- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aValue
- The data structure's value.aLengthWidth
- The width (in bytes) to be used for length values.aEndianess
- TheEndianess
to be used for (length) values.aAttributes
- The attributes or null if all attributes are to be processed in alphabetical order.
-
DynamicTypeSection
public DynamicTypeSection(T aValue, String... aAttributes)
Constructs theDynamicTypeSection
with the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH
,TransmissionMetrics.DEFAULT_ENDIANESS
as well asTransmissionMetrics.DEFAULT_ENCODING
). It is pre-initialized with the given value as offromType(Object, String...)
.- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aValue
- The data structure's value.aAttributes
- The attributes or null if all attributes are to be processed in alphabetical order.
-
DynamicTypeSection
public DynamicTypeSection(T aValue, TransmissionMetrics aTransmissionMetrics)
Constructs theDynamicTypeSection
with the given properties. It is pre-initialized with the given value as offromType(Object)
. The configuration attributes are taken from theTransmissionMetrics
configuration object, though only those attributes are supported which are also supported by the other constructors!- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aValue
- The data structure's value.aTransmissionMetrics
- TheTransmissionMetrics
to be used for configuring this instance.
-
DynamicTypeSection
public DynamicTypeSection(T aValue, TransmissionMetrics aTransmissionMetrics, String... aAttributes)
Constructs theDynamicTypeSection
with the given properties. It is pre-initialized with the given value as offromType(Object, String...)
. The configuration attributes are taken from theTransmissionMetrics
configuration object, though only those attributes are supported which are also supported by the other constructors!- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aValue
- The data structure's value.aTransmissionMetrics
- TheTransmissionMetrics
to be used for configuring this instance.aAttributes
- The attributes or null if all attributes are to be processed in alphabetical order.
-
DynamicTypeSection
public DynamicTypeSection(TransmissionMetrics aTransmissionMetrics)
Constructs theDynamicTypeSection
with the given properties. The configuration attributes are taken from theTransmissionMetrics
configuration object, though only those attributes are supported which are also supported by the other constructors!- Parameters:
aTransmissionMetrics
- TheTransmissionMetrics
to be used for configuring this instance.
-
-
Method Detail
-
fromType
public <T> void fromType(T aValue)
Constructs theDynamicTypeSection
'sSequence
from the given type's instance . The attributes of the given data structure are processed all and in alphabetical order. For specifying a predefined set of attributes and their order, please invokeDynamicTypeTransmission.fromType(Object, String[])
instead!- Specified by:
fromType
in interfaceDynamicTypeTransmission
- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aValue
- The data structure's value.
-
fromType
public <T> void fromType(T aValue, String... aAttributes)
Constructs an instance for the given type T. . The attributes of the given data structure are processed using the predefined set of attributes in their according order.- Specified by:
fromType
in interfaceDynamicTypeTransmission
- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aValue
- The data structure's value.aAttributes
- The attributes or null if all attributes are to be processed in alphabetical order.
-
getEncoding
public Charset getEncoding()
- Specified by:
getEncoding
in interfaceorg.refcodes.mixin.EncodingAccessor<Charset>
-
getEndianess
public org.refcodes.numerical.Endianess getEndianess()
- Specified by:
getEndianess
in interfaceorg.refcodes.numerical.EndianessAccessor
-
getLengthWidth
public int getLengthWidth()
Retrieves the length width (in bytes) from the length width (in bytes) property.- Specified by:
getLengthWidth
in interfaceLengthWidthAccessor
- Returns:
- The length width (in bytes) stored by the length width (in bytes) property.
-
toSchema
public Schema toSchema()
Retrieves theSchema
representing theTransmission
. Retrieving aSchema
is useful when analyzing and debugging data structures such as aAllocSectionDecoratorSegment
instance to help document, learn and verify on the structure (as well as the content) of that veryAllocSectionDecoratorSegment
.- Specified by:
toSchema
in interfaceTransmission
- Overrides:
toSchema
in classSequenceSection
- Returns:
- The
Schema
representation of the implementing type for debugging and verification (or documentation) purposes.
-
toSimpleTypeMap
public org.refcodes.struct.SimpleTypeMap toSimpleTypeMap()
Returns theSimpleTypeMap
representation of thisTransmission
. In case this Transmission hasTransmission
children, then the children are queried as well and contained in the resultingSimpleTypeMap
. The aliases of the accordingTransmission
instances represent the resulting path to aTransmission
's final simple type.- Specified by:
toSimpleTypeMap
in interfaceTransmission
- Overrides:
toSimpleTypeMap
in classSequenceSection
- Returns:
- The
SimpleTypeMap
representing thisTransmission
and (if any) its children, with the according aliases forming the paths to theTransmission
's values.
-
toType
public <T> T toType(Class<T> aType) throws IllegalArgumentException
Constructs an instance for the given type T. The attributes of the given data structure are processed all and in alphabetical order. For specifying a predefined set of attributes and their order, please invokeDynamicTypeTransmission.fromType(Object, String...)
instead!- Specified by:
toType
in interfaceDynamicTypeTransmission
- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aType
- The data structure's type.- Returns:
- The according type constructed from the
DynamicTypeSection
'sSequence
. - Throws:
IllegalArgumentException
- thrown in case theDynamicTypeSection
'sSequence
does not match the provided type.
-
toType
public <T> T toType(Class<T> aType, String... aAttributes) throws IllegalArgumentException
Constructs an instance for the given type T. . The attributes of the given data structure are processed using the predefined set of attributes in their according order- Specified by:
toType
in interfaceDynamicTypeTransmission
- Type Parameters:
T
- The type of the data structure representing the body.- Parameters:
aType
- The data structure's type.aAttributes
- The attributes or null if all attributes are to be processed in alphabetical order.- Returns:
- The according type constructed from the
DynamicTypeSection
'sSequence
. - Throws:
IllegalArgumentException
- thrown in case theDynamicTypeSection
'sSequence
does not match the provided type.
-
-