public class DecoderSettings extends Object
| Constructor and Description |
|---|
DecoderSettings() |
| Modifier and Type | Method and Description |
|---|---|
static DecoderSettings |
createFullControlSettings()
Settings with all checks enabled.
|
boolean |
enableNarrowingOnRead()
Checks if the narrowed value validated on write.
|
boolean |
enableNarrowingOnWrite()
Checks if the value narrowing enabled on write.
|
boolean |
enableNullDataReturn()
Checks if the null value can be returned by field value getter.
|
Class<?>[] |
getCustomCompositeClasses()
Custom composite classes.
|
ClassLoader |
getParentLoader()
Parent loader for decoder.
|
DecoderSettings |
makeCopy()
Makes copy of the settings.
|
DecoderSettings |
setCustomCompositeClasses(Class<?>[] customCompositeClasses)
Set custom composite classes.
|
DecoderSettings |
setEnableNarrowingOnRead(boolean enableNarrowingOnRead) |
DecoderSettings |
setEnableNarrowingOnWrite(boolean enableNarrowingOnWrite)
Sets if the value narrowing enabled on write.
|
DecoderSettings |
setEnableNullDataReturn(boolean enableNullDataReturn)
Sets option that controls checking of the null data before return.
|
DecoderSettings |
setParentLoader(ClassLoader parentLoader)
Sets parent loader for decoder.
|
DecoderSettings |
setValidateNarrowingOnRead(boolean validateNarrowingOnRead)
Set narrowing validation on read.
|
DecoderSettings |
setValidateNarrowingOnWrite(boolean validateNarrowingOnWrite)
Set narrowing validation on write.
|
DecoderSettings |
setValidateValueRanges(boolean validateValueRanges)
Controls raising of exceptions when wrong data occurs.
|
boolean |
validateNarrowingOnRead() |
boolean |
validateNarrowingOnWrite()
Checks if the narrowed value validated on write.
|
boolean |
validateValueRanges()
Controls raising of exception when wrong data occurs.
|
public boolean validateValueRanges()
true the decoder raises WrongValueException exception when wrong data appear on the wire.
If the option is false (default behavior) the data can be read and returned viw accessors.public DecoderSettings setValidateValueRanges(boolean validateValueRanges)
validateValueRanges - true if exception should be raised.public boolean enableNullDataReturn()
true getters like to the IFieldSet.getInt(int) can return value that represents empty (or null)
data. That is default behaviour of the decoder.
If the option is false the NullValueException will be raised by getters. To prevent exceptions
the content must be checked using 'tryGet' accessors like to the IFieldSet.tryGetInt(int, AtomicInteger) before access.public DecoderSettings setEnableNullDataReturn(boolean enableNullDataReturn)
enableNullDataReturn() description for details.enableNullDataReturn - Value of the option.public ClassLoader getParentLoader()
null, it denotes default system class loader.public DecoderSettings setParentLoader(ClassLoader parentLoader)
parentLoader - Parent class loader to use by decoder.public Class<?>[] getCustomCompositeClasses()
public DecoderSettings setCustomCompositeClasses(Class<?>[] customCompositeClasses)
customCompositeClasses - Custom composite classes.public DecoderSettings makeCopy()
public static DecoderSettings createFullControlSettings()
public boolean enableNarrowingOnWrite()
public DecoderSettings setEnableNarrowingOnWrite(boolean enableNarrowingOnWrite)
enableNarrowingOnWrite - Boolean value.DecoderSettings.public boolean validateNarrowingOnWrite()
public DecoderSettings setValidateNarrowingOnWrite(boolean validateNarrowingOnWrite)
validateNarrowingOnWrite - true to enable the validation, false otherwise.DecoderSettings.public boolean enableNarrowingOnRead()
true when the validation enabled, false otherwise.public DecoderSettings setEnableNarrowingOnRead(boolean enableNarrowingOnRead)
public boolean validateNarrowingOnRead()
public DecoderSettings setValidateNarrowingOnRead(boolean validateNarrowingOnRead)
validateNarrowingOnRead - true to enable the validation, false otherwise.DecoderSettings.Copyright © 2005–2025 Onix Solutions. All rights reserved.