Class SimpleContext
java.lang.Object
org.qubership.atp.macros.core.processor.AbstractContext<SimpleContext>
org.qubership.atp.macros.core.processor.SimpleContext
-
Field Summary
FieldsFields inherited from class org.qubership.atp.macros.core.processor.AbstractContext
contextMap, contextParameters, parent, strategy -
Constructor Summary
ConstructorsConstructorDescriptionSimpleContext(SimpleContext parent, MacrosParser.MacrosStartContext macro, Macros macros, Evaluator evaluator) -
Method Summary
Modifier and TypeMethodDescriptionprotected SimpleContextcreateChildContext(MacrosParser.MacrosStartContext ctx, Macros macros, Evaluator evaluator) Invoked when macro denoted by current context contains another macro as argument.protected SimpleContextprotected Stringprotected voidArgs are filled up now.protected voidnotifyMacroStarts(MacrosParser.MacrosStartContext macro, Macros macros, Evaluator evaluator) Initializes with macro.protected voidprotected voidInvoked only on initialized context (in the macro).protected voidInvoked only on initialized context (in the macro).protected voidInvoked only on initialized context (in the macro).protected voidInvoked only on initialized context (in the macro).protected voidInvoked only on initialized context (in the macro).protected voidInvoked only on initialized context (in the macro).protected voidprotected voidInvoked only on uninitialized context (outside the macro).protected voidInvoked only on uninitialized context (outside the macro).protected voidprotected voidprotected voidInvoked only on uninitialized context (outside the macro).protected voidreduce(MacrosParser.MacrosEndContext ctx, SimpleContext child) Invoked on parent to notify that child (nested macro) is fully processed and should be aggregated with parent.reset()protected void
-
Field Details
-
args
-
reducedChild
-
text
-
macro
-
evaluator
-
-
Constructor Details
-
SimpleContext
public SimpleContext() -
SimpleContext
public SimpleContext(@Nonnull SimpleContext parent, @Nonnull MacrosParser.MacrosStartContext macro, @Nonnull Macros macros, @Nonnull Evaluator evaluator)
-
-
Method Details
-
notifyMacroStarts
protected void notifyMacroStarts(@Nonnull MacrosParser.MacrosStartContext macro, @Nonnull Macros macros, @Nonnull Evaluator evaluator) Description copied from class:AbstractContextInitializes with macro. Should clear args in case it was uninitialized previously and reused for next sibling now.- Specified by:
notifyMacroStartsin classAbstractContext<SimpleContext>
-
getArgument
-
pushArguments
Description copied from class:AbstractContextInvoked 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.- Specified by:
pushArgumentsin classAbstractContext<SimpleContext>- Parameters:
args- - the part of an arguments text.
-
pushArguments
Description copied from class:AbstractContextInvoked only on initialized context (in the macro).- Specified by:
pushArgumentsin classAbstractContext<SimpleContext>- Parameters:
args- - the part of an arguments text.
-
pushArguments
Description copied from class:AbstractContextInvoked only on initialized context (in the macro).- Specified by:
pushArgumentsin classAbstractContext<SimpleContext>- Parameters:
args- - the part of an arguments text.
-
pushArguments
Description copied from class:AbstractContextInvoked only on initialized context (in the macro).- Specified by:
pushArgumentsin classAbstractContext<SimpleContext>- Parameters:
args- - the part of an arguments text.
-
pushArguments
-
pushArguments
Description copied from class:AbstractContextInvoked only on initialized context (in the macro).- Specified by:
pushArgumentsin classAbstractContext<SimpleContext>- Parameters:
args- - the part of an arguments text.
-
pushArguments
Description copied from class:AbstractContextInvoked 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.- Specified by:
pushArgumentsin classAbstractContext<SimpleContext>- Parameters:
args- - the part of an arguments text.
-
notifyMacroEnds
Description copied from class:AbstractContextArgs are filled up now. Result of evaluation should be pushed into state text.- Specified by:
notifyMacroEndsin classAbstractContext<SimpleContext>
-
createRootContext
-
pushText
Description copied from class:AbstractContextInvoked 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.- Specified by:
pushTextin classAbstractContext<SimpleContext>- Parameters:
text- - the part of an arguments text.
-
pushText
Description copied from class:AbstractContextInvoked only on uninitialized context (outside the macro).- Specified by:
pushTextin classAbstractContext<SimpleContext>- Parameters:
text- - the part of an arguments text.
-
pushText
- Specified by:
pushTextin classAbstractContext<SimpleContext>
-
pushText
- Specified by:
pushTextin classAbstractContext<SimpleContext>
-
pushText
- Specified by:
pushTextin classAbstractContext<SimpleContext>
-
pushText
Description copied from class:AbstractContextInvoked 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.- Specified by:
pushTextin classAbstractContext<SimpleContext>- Parameters:
text- - the part of an arguments text.
-
createChildContext
@Nonnull protected SimpleContext createChildContext(@Nonnull MacrosParser.MacrosStartContext ctx, @Nonnull Macros macros, @Nonnull Evaluator evaluator) Description copied from class:AbstractContextInvoked when macro denoted by current context contains another macro as argument. So child context will be bound to the nested macro.- Specified by:
createChildContextin classAbstractContext<SimpleContext>
-
reduce
Description copied from class:AbstractContextInvoked on parent to notify that child (nested macro) is fully processed and should be aggregated with parent.- Specified by:
reducein classAbstractContext<SimpleContext>- Parameters:
child- - child context which will be dropped by processor.
-
getResultOnEvaluationEnd
- Specified by:
getResultOnEvaluationEndin classAbstractContext<SimpleContext>
-
resetMacro
protected void resetMacro() -
reset
- Specified by:
resetin classAbstractContext<SimpleContext>
-