Class AttributePathParser
java.lang.Object
dev.hogwai.dynamodb.simplified.internal.AttributePathParser
Parses nested attribute paths like
address.city and tags[0].name.
This is a shared utility extracted from the expression builder classes
(FilterExpression, ProjectionExpression, UpdateExpression),
which all contained identical parsing logic in their addNestedName() methods.
Only the parsing is unified here; the reconstruction (generating #n0/{:v0}
placeholders) differs per expression type and stays in each class.
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<PathSegment> Parses a dot/bracket path into segments.static StringrebuildNestedPath(String path, UnaryOperator<String> nameResolver) Reconstructs a nested attribute path using a name resolver function.
-
Method Details
-
parse
Parses a dot/bracket path into segments.Example:
"tags[0].name"->[("tags", "[0]"), ("name", null)]- Parameters:
path- the dotted attribute path- Returns:
- ordered list of path segments
-
rebuildNestedPath
Reconstructs a nested attribute path using a name resolver function.Each path segment is resolved via the name resolver, and index suffixes (e.g.,
[0]) are appended when present. Segments are joined with dots.Example:
"tags[0].name"with resolvers -> "#n0"->"#n0[0].\#p0"- Parameters:
path- the dotted attribute pathnameResolver- function that resolves a segment name to a placeholder- Returns:
- the reconstructed path string with resolved placeholders
-