Package org.yaml.snakeyaml.constructor
Class SafeConstructor
- java.lang.Object
-
- org.yaml.snakeyaml.constructor.BaseConstructor
-
- org.yaml.snakeyaml.constructor.SafeConstructor
-
- Direct Known Subclasses:
Constructor
public class SafeConstructor extends BaseConstructor
Construct standard Java classes
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSafeConstructor.ConstructUndefinedclassSafeConstructor.ConstructYamlBinaryclassSafeConstructor.ConstructYamlBoolclassSafeConstructor.ConstructYamlFloatclassSafeConstructor.ConstructYamlIntclassSafeConstructor.ConstructYamlMapclassSafeConstructor.ConstructYamlNullclassSafeConstructor.ConstructYamlOmapclassSafeConstructor.ConstructYamlPairsclassSafeConstructor.ConstructYamlSeqclassSafeConstructor.ConstructYamlSetclassSafeConstructor.ConstructYamlStrstatic classSafeConstructor.ConstructYamlTimestamp
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Map<java.lang.String,java.lang.Boolean>BOOL_VALUESprivate static int[][]RADIX_MAXprivate static java.util.regex.PatternTIMESTAMP_REGEXPstatic SafeConstructor.ConstructUndefinedundefinedConstructorprivate static java.util.regex.PatternYMD_REGEXP-
Fields inherited from class org.yaml.snakeyaml.constructor.BaseConstructor
composer, constructedObjects, loadingConfig, NOT_INSTANTIATED_OBJECT, rootTag, typeDefinitions, typeTags, yamlClassConstructors, yamlConstructors, yamlMultiConstructors
-
-
Constructor Summary
Constructors Constructor Description SafeConstructor()Deprecated.use optionsSafeConstructor(LoaderOptions loadingConfig)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconstructMapping2ndStep(MappingNode node, java.util.Map<java.lang.Object,java.lang.Object> mapping)Fill provided Map with constructed dataprotected voidconstructSet2ndStep(MappingNode node, java.util.Set<java.lang.Object> set)protected static java.lang.NumbercreateLongOrBigInteger(java.lang.String number, int radix)private java.lang.NumbercreateNumber(int sign, java.lang.String number, int radix)protected voidflattenMapping(MappingNode node)protected voidflattenMapping(MappingNode node, boolean forceStringKeys)private static intmaxLen(int max, int radix)private static intmaxLen(long max, int radix)private java.util.List<NodeTuple>mergeNode(MappingNode node, boolean isPreffered, java.util.Map<java.lang.Object,java.lang.Integer> key2index, java.util.List<NodeTuple> values, boolean forceStringKeys)Does merge for supplied mapping node.protected voidprocessDuplicateKeys(MappingNode node)protected voidprocessDuplicateKeys(MappingNode node, boolean forceStringKeys)-
Methods inherited from class org.yaml.snakeyaml.constructor.BaseConstructor
addTypeDescription, checkData, constructArray, constructArrayStep2, constructDocument, constructMapping, constructObject, constructObjectNoCheck, constructScalar, constructSequence, constructSequenceStep2, constructSet, constructSet, createArray, createDefaultList, createDefaultMap, createDefaultSet, finalizeConstruction, getConstructor, getData, getPropertyUtils, getSingleData, isAllowDuplicateKeys, isEnumCaseSensitive, isExplicitPropertyUtils, isWrappedToRootException, newInstance, newInstance, newInstance, newList, newMap, newSet, postponeMapFilling, postponeSetFilling, setAllowDuplicateKeys, setComposer, setEnumCaseSensitive, setPropertyUtils, setWrappedToRootException
-
-
-
-
Field Detail
-
undefinedConstructor
public static final SafeConstructor.ConstructUndefined undefinedConstructor
-
BOOL_VALUES
private static final java.util.Map<java.lang.String,java.lang.Boolean> BOOL_VALUES
-
RADIX_MAX
private static final int[][] RADIX_MAX
-
TIMESTAMP_REGEXP
private static final java.util.regex.Pattern TIMESTAMP_REGEXP
-
YMD_REGEXP
private static final java.util.regex.Pattern YMD_REGEXP
-
-
Constructor Detail
-
SafeConstructor
@Deprecated public SafeConstructor()
Deprecated.use options
-
SafeConstructor
public SafeConstructor(LoaderOptions loadingConfig)
-
-
Method Detail
-
flattenMapping
protected void flattenMapping(MappingNode node)
-
flattenMapping
protected void flattenMapping(MappingNode node, boolean forceStringKeys)
-
processDuplicateKeys
protected void processDuplicateKeys(MappingNode node)
-
processDuplicateKeys
protected void processDuplicateKeys(MappingNode node, boolean forceStringKeys)
-
mergeNode
private java.util.List<NodeTuple> mergeNode(MappingNode node, boolean isPreffered, java.util.Map<java.lang.Object,java.lang.Integer> key2index, java.util.List<NodeTuple> values, boolean forceStringKeys)
Does merge for supplied mapping node.- Parameters:
node- where to mergeisPreffered- true if keys of node should take precedence over others...key2index- maps already merged keys to index from valuesvalues- collects merged NodeTuple- Returns:
- list of the merged NodeTuple (to be set as value for the MappingNode)
-
constructMapping2ndStep
protected void constructMapping2ndStep(MappingNode node, java.util.Map<java.lang.Object,java.lang.Object> mapping)
Description copied from class:BaseConstructorFill provided Map with constructed data- Overrides:
constructMapping2ndStepin classBaseConstructor- Parameters:
node- - sourcemapping- - map to fill
-
constructSet2ndStep
protected void constructSet2ndStep(MappingNode node, java.util.Set<java.lang.Object> set)
- Overrides:
constructSet2ndStepin classBaseConstructor
-
maxLen
private static int maxLen(int max, int radix)
-
maxLen
private static int maxLen(long max, int radix)
-
createNumber
private java.lang.Number createNumber(int sign, java.lang.String number, int radix)
-
createLongOrBigInteger
protected static java.lang.Number createLongOrBigInteger(java.lang.String number, int radix)
-
-