Class AbstractContext<T extends AbstractContext>
java.lang.Object
org.qubership.atp.macros.core.processor.AbstractContext<T>
- Direct Known Subclasses:
SimpleContext
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates root.AbstractContext(T parent, MacrosParser.MacrosStartContext macro, Macros macros, Evaluator evaluator) Creates child. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract TcreateChildContext(MacrosParser.MacrosStartContext ctx, Macros macros, Evaluator evaluator) Invoked when macro denoted by current context contains another macro as argument.abstract Stringprotected abstract voidArgs are filled up now.protected abstract voidnotifyMacroStarts(MacrosParser.MacrosStartContext macro, Macros macros, Evaluator evaluator) Initializes with macro.protected abstract voidInvoked only on initialized context (in the macro).protected abstract voidInvoked only on initialized context (in the macro).protected abstract voidInvoked only on initialized context (in the macro).protected abstract voidInvoked only on initialized context (in the macro).protected abstract voidInvoked only on initialized context (in the macro).protected abstract voidInvoked only on initialized context (in the macro).protected abstract voidprotected abstract voidInvoked only on uninitialized context (outside the macro).protected abstract voidInvoked only on uninitialized context (outside the macro).protected abstract voidprotected abstract voidprotected abstract voidInvoked only on uninitialized context (outside the macro).protected abstract voidreduce(MacrosParser.MacrosEndContext ctx, T child) Invoked on parent to notify that child (nested macro) is fully processed and should be aggregated with parent.abstract Treset()
-
Field Details
-
parent
-
contextMap
-
contextParameters
-
strategy
protected org.qubership.atp.macros.core.processor.MacrosVisitorState strategy
-
-
Constructor Details
-
Method Details
-
notifyMacroStarts
protected abstract void notifyMacroStarts(@Nonnull MacrosParser.MacrosStartContext macro, @Nonnull Macros macros, @Nonnull Evaluator evaluator) Initializes with macro. Should clear args in case it was uninitialized previously and reused for next sibling now. -
pushArguments
Invoked only on initialized context (in the macro). Will be invoked when user has defined a macro which does not exist. May be interpreted as text by default.- Parameters:
args- - the part of an arguments text.
-
pushArguments
Invoked only on initialized context (in the macro).- Parameters:
args- - the part of an arguments text.
-
pushArguments
Invoked only on initialized context (in the macro).- Parameters:
args- - the part of an arguments text.
-
pushArguments
Invoked only on initialized context (in the macro).- Parameters:
args- - the part of an arguments text.
-
pushArguments
Invoked only on initialized context (in the macro).- Parameters:
args- - the part of an arguments text.
-
pushArguments
Invoked only on initialized context (in the macro). Will be invoked when user has defined a macro which does not exist. May be interpreted as text by default.- Parameters:
args- - the part of an arguments text.
-
notifyMacroEnds
Args are filled up now. Result of evaluation should be pushed into state text. -
pushText
Invoked only on uninitialized context (outside the macro). Will be invoked when user has defined a macro which does not exist. May be interpreted as text by default.- Parameters:
text- - the part of an arguments text.
-
pushText
Invoked only on uninitialized context (outside the macro).- Parameters:
text- - the part of an arguments text.
-
pushText
-
pushText
-
pushText
-
pushText
Invoked only on uninitialized context (outside the macro). Will be invoked when user has defined a macro which does not exist. May be interpreted as text by default.- Parameters:
text- - the part of an arguments text.
-
createChildContext
@Nonnull protected abstract T createChildContext(@Nonnull MacrosParser.MacrosStartContext ctx, @Nonnull Macros macros, Evaluator evaluator) Invoked when macro denoted by current context contains another macro as argument. So child context will be bound to the nested macro. -
reduce
Invoked on parent to notify that child (nested macro) is fully processed and should be aggregated with parent.- Parameters:
child- - child context which will be dropped by processor.
-
reset
-
getResultOnEvaluationEnd
-