public class FramingHeaderPolicy extends Object
Modifier and Type | Field and Description |
---|---|
static int |
OFH_POLICY_OVERRIDE_SCHEMA_FRAMING_HEADER
Override schema framing header specification.
|
static int |
OFH_POLICY_USE_BIG_ENDIAN
Use big endian for template-specified framing header.
|
static int |
OFH_POLICY_USE_LITTLE_ENDIAN
Use little endian for template-specified framing header.
|
static int |
OFH_POLICY_USE_SCHEMA_ENDIANESS
Use template-specified endianess.
|
static FramingHeaderPolicy |
UseBigEndian
Override standard endianess with big endian.
|
static FramingHeaderPolicy |
UseLittleEndian
Override standard endianess with little endian.
|
static FramingHeaderPolicy |
UseSchemaByStandard
Default policy.
|
static FramingHeaderPolicy |
UseSchemaEndianess
Override standard endianess with the schema-specified one.
|
Constructor and Description |
---|
FramingHeaderPolicy(FramingHeaderPolicy src)
Makes a copy of the policy.
|
FramingHeaderPolicy(FramingHeaderSpecification specification,
int flags)
Constructs new instance of the policy.
|
Modifier and Type | Method and Description |
---|---|
static FramingHeaderPolicy |
getCustomPolicy(FramingHeaderSpecification specification)
Override standard or schema-specified framing header with the custom one.
|
int |
getFlags()
The policy flags.
|
FramingHeaderSpecification |
getSpecification()
Custom specification.
|
public static final int OFH_POLICY_USE_SCHEMA_ENDIANESS
The default endianess for SBE framing header is Big Endian. But in particular cases the framing header should use the endianess specified in the template itself (usually it is Little Endian). The flag should be used in such cases.
Note: The flag ignored if the OFH_POLICY_OVERRIDE_SCHEMA_FRAMING_HEADER
is used. Alos, it can not be used with OFH_POLICY_USE_LITTLE_ENDIAN
or OFH_POLICY_USE_BIG_ENDIAN
flags.
public static final int OFH_POLICY_USE_LITTLE_ENDIAN
When the flag is set the framing header specification restored from the template will be forced to use the little endian to encode.
The flag ignored if the OFH_POLICY_OVERRIDE_SCHEMA_FRAMING_HEADER
is used. Also, it can not be used with OFH_POLICY_USE_SCHEMA_ENDIANESS
or OFH_POLICY_USE_BIG_ENDIAN
flags.
public static final int OFH_POLICY_USE_BIG_ENDIAN
When the flag is set the framing header specification restored from the template will be forced to use the big endian to encode.
The flag ignored if the OFH_POLICY_OVERRIDE_SCHEMA_FRAMING_HEADER
is used. Also, it can not be used with OFH_POLICY_USE_SCHEMA_ENDIANESS
or OFH_POLICY_USE_LITTLE_ENDIAN
flags
.
public static final int OFH_POLICY_OVERRIDE_SCHEMA_FRAMING_HEADER
When the flag is set the custom framing header specification completely overrides definition of the framing header appeared in the template.
Using of the flag cancels OFH_POLICY_USE_SCHEMA_ENDIANESS
, OFH_POLICY_USE_BIG_ENDIAN
and OFH_POLICY_USE_LITTLE_ENDIAN
flags
public static final FramingHeaderPolicy UseSchemaByStandard
Use framing header specification from the template, or generate it by SBE 1.0 standard, and apply big endian encoding for it.
public static final FramingHeaderPolicy UseSchemaEndianess
Use framing header specification from the template and apply the schema endianess to it.
public static final FramingHeaderPolicy UseLittleEndian
Use framing header specification from the template and apply little-endian encoding to it.
public static final FramingHeaderPolicy UseBigEndian
Use framing header specification from the template and apply big-endian encoding to it.
public FramingHeaderPolicy(FramingHeaderSpecification specification, int flags)
specification
- framing header specification.flags
- combination of OFH_POLICY_* constants.public FramingHeaderPolicy(FramingHeaderPolicy src)
The constructor copies data from the src
object. The specification is not cloned and is shared between original object and the new one.
src
- object to copy data from.public FramingHeaderSpecification getSpecification()
public int getFlags()
public static FramingHeaderPolicy getCustomPolicy(FramingHeaderSpecification specification)
Makes a policy instance that requires to use the custom framing header specification instead of the specification restored from the SBE template or created by standard considerations.
If the specification
parameter can be null
. In this case the encoder and decoder will not decode or encode the framing header.
specification
- custom framing heade specification.Copyright © 2005–2024 Onix Solutions. All rights reserved.