public class LoaderOptions
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
allowDuplicateKeys |
private boolean |
allowRecursiveKeys |
private int |
codePointLimit |
private boolean |
enumCaseSensitive |
private int |
maxAliasesForCollections |
private int |
nestingDepthLimit |
private boolean |
processComments |
private boolean |
wrappedToRootException |
Constructor and Description |
---|
LoaderOptions() |
Modifier and Type | Method and Description |
---|---|
boolean |
getAllowRecursiveKeys() |
int |
getCodePointLimit() |
int |
getMaxAliasesForCollections() |
int |
getNestingDepthLimit() |
boolean |
isAllowDuplicateKeys() |
boolean |
isEnumCaseSensitive() |
boolean |
isProcessComments() |
boolean |
isWrappedToRootException() |
void |
setAllowDuplicateKeys(boolean allowDuplicateKeys)
Allow/Reject duplicate map keys in the YAML file.
|
void |
setAllowRecursiveKeys(boolean allowRecursiveKeys)
Allow recursive keys for mappings.
|
void |
setCodePointLimit(int codePointLimit)
The max amount of code points in the input YAML document.
|
void |
setEnumCaseSensitive(boolean enumCaseSensitive)
Disables or enables case sensitivity during construct enum constant from string value Default
is false.
|
void |
setMaxAliasesForCollections(int maxAliasesForCollections)
Restrict the amount of aliases for collections (sequences and mappings) to avoid
https://en.wikipedia.org/wiki/Billion_laughs_attack
|
void |
setNestingDepthLimit(int nestingDepthLimit)
Set max depth of nested collections.
|
LoaderOptions |
setProcessComments(boolean processComments)
Set the comment processing.
|
void |
setWrappedToRootException(boolean wrappedToRootException)
Wrap runtime exception to YAMLException during parsing or leave them as they are
Default is to leave original exceptions
|
private boolean allowDuplicateKeys
private boolean wrappedToRootException
private int maxAliasesForCollections
private boolean allowRecursiveKeys
private boolean processComments
private boolean enumCaseSensitive
private int nestingDepthLimit
private int codePointLimit
public final boolean isAllowDuplicateKeys()
public void setAllowDuplicateKeys(boolean allowDuplicateKeys)
allowDuplicateKeys
- false to reject duplicate mapping keyspublic final boolean isWrappedToRootException()
public void setWrappedToRootException(boolean wrappedToRootException)
wrappedToRootException
- - true to convert runtime exception to YAMLExceptionpublic final int getMaxAliasesForCollections()
public void setMaxAliasesForCollections(int maxAliasesForCollections)
maxAliasesForCollections
- set max allowed value (50 by default)public void setAllowRecursiveKeys(boolean allowRecursiveKeys)
allowRecursiveKeys
- - false to disable recursive keyspublic final boolean getAllowRecursiveKeys()
public LoaderOptions setProcessComments(boolean processComments)
processComments
- true
to process; false
to ignorepublic final boolean isProcessComments()
public final boolean isEnumCaseSensitive()
public void setEnumCaseSensitive(boolean enumCaseSensitive)
enumCaseSensitive
- - true to set enum case sensitive, false the reversepublic final int getNestingDepthLimit()
public void setNestingDepthLimit(int nestingDepthLimit)
nestingDepthLimit
- - depth to be accepted (50 by default)public final int getCodePointLimit()
public void setCodePointLimit(int codePointLimit)
codePointLimit
- - the max allowed size of the YAML data