Class JPropPathSplitter
- java.lang.Object
-
- com.fasterxml.jackson.dataformat.javaprop.util.JPropPathSplitter
-
- Direct Known Subclasses:
JPropPathSplitter.CharPathOnlySplitter,JPropPathSplitter.FullSplitter,JPropPathSplitter.IndexOnlySplitter,JPropPathSplitter.NonSplitting,JPropPathSplitter.StringPathOnlySplitter
public abstract class JPropPathSplitter extends java.lang.ObjectHelper class used for splitting a flattened property key into nested/structured path that can be used to traverse and/or define hierarchic structure.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJPropPathSplitter.CharPathOnlySplitterSimple variant where we only have path separator, and optional "segment is index iff value is integer number"static classJPropPathSplitter.FullSplitterInstance that supports both path separator and index markers (and possibly also "simple" indexes)static classJPropPathSplitter.IndexOnlySplitterSpecial variant that does not use path separator, but does allow index indicator, at the end of path.static classJPropPathSplitter.NonSplitting"No-op" implementation that does no splitting and simply adds entries as is.static classJPropPathSplitter.StringPathOnlySplitterSimple variant where we only have path separator, and optional "segment is index iff value is integer number"
-
Field Summary
Fields Modifier and Type Field Description protected boolean_useSimpleIndex
-
Constructor Summary
Constructors Modifier Constructor Description protectedJPropPathSplitter(boolean useSimpleIndex)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected JPropNode_addSegment(JPropNode parent, java.lang.String segment)protected int_asInt(java.lang.String segment)protected JPropNode_lastSegment(JPropNode parent, java.lang.String path, int start, int end)static JPropPathSplittercreate(JavaPropsSchema schema)private static JPropPathSplitterpathOnlySplitter(JavaPropsSchema schema)abstract JPropNodesplitAndAdd(JPropNode parent, java.lang.String key, java.lang.String value)Main access method for splitting key into one or more segments and using segmentation to add the String value as a node in its proper location.
-
-
-
Method Detail
-
create
public static JPropPathSplitter create(JavaPropsSchema schema)
-
pathOnlySplitter
private static JPropPathSplitter pathOnlySplitter(JavaPropsSchema schema)
-
splitAndAdd
public abstract JPropNode splitAndAdd(JPropNode parent, java.lang.String key, java.lang.String value)
Main access method for splitting key into one or more segments and using segmentation to add the String value as a node in its proper location.- Returns:
- Newly added node
-
_lastSegment
protected JPropNode _lastSegment(JPropNode parent, java.lang.String path, int start, int end)
-
_asInt
protected int _asInt(java.lang.String segment)
-
-