public abstract class ModifierSpec extends Object implements BaseSpec
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
checkValue |
protected OpMode |
opMode |
protected MatchablePathElement |
pathElement |
protected static TraversalBuilder |
TRAVERSAL_BUILDER |
| Modifier | Constructor and Description |
|---|---|
protected |
ModifierSpec(String rawJsonKey,
OpMode opMode)
Builds LHS pathElement and validates to specification
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
apply(String inputKey,
Optional<Object> inputOptional,
WalkedPath walkedPath,
Map<String,Object> output,
Map<String,Object> context)
This is the main recursive method of the Shiftr/Templatr/Cardinality parallel "spec" and "input" tree walk.
|
protected abstract void |
applyElement(String key,
Optional<Object> inputOptional,
MatchedElement thisLevel,
WalkedPath walkedPath,
Map<String,Object> context)
Templatr specific override that is used in BaseSpec#apply(...)
The name is changed for easy identification during debugging
|
MatchablePathElement |
getPathElement()
Gimme the LHS path element
|
protected static void |
setData(Object parent,
MatchedElement matchedElement,
Object value,
OpMode opMode)
Static utility method for facilitating writes on input object
|
protected static final TraversalBuilder TRAVERSAL_BUILDER
protected final OpMode opMode
protected final MatchablePathElement pathElement
protected final boolean checkValue
public MatchablePathElement getPathElement()
BaseSpecgetPathElement in interface BaseSpecpublic boolean apply(String inputKey, Optional<Object> inputOptional, WalkedPath walkedPath, Map<String,Object> output, Map<String,Object> context)
BaseSpecprotected abstract void applyElement(String key, Optional<Object> inputOptional, MatchedElement thisLevel, WalkedPath walkedPath, Map<String,Object> context)
protected static void setData(Object parent, MatchedElement matchedElement, Object value, OpMode opMode)
parent - the source objectmatchedElement - the current spec (leaf) element that was matched with inputvalue - to writeopMode - to determine if write is applicableCopyright © 2023. All rights reserved.