Class AbstractMacroProcessor<T extends MacroContextBase>
java.lang.Object
org.qubership.atp.dataset.macros.processor.MacroProcessorBase<T>
org.qubership.atp.dataset.macros.processor.AbstractMacroProcessor<T>
- Direct Known Subclasses:
MacroProcessorImpl
public abstract class AbstractMacroProcessor<T extends MacroContextBase>
extends MacroProcessorBase<T>
-
Nested Class Summary
Nested classes/interfaces inherited from class org.qubership.atp.dataset.macros.processor.MacroProcessorBase
MacroProcessorBase.Strategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected final MacroRegistryprotected final StringBuilderprotected final TokensIteratorFields inherited from class org.qubership.atp.dataset.macros.processor.MacroProcessorBase
END, START, state -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractMacroProcessor(StringBuilder tail, MacroRegistry registry) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voiddropArguments(T context) protected abstract voidEvaluates full expression.booleanEvaluates a part of an expression.protected abstract StringgetArguments(T context) protected abstract StringgetValue()protected voidChild will be thrown away.protected booleanreevaluateRootLevel(T root) Invoked on the end of root macro processing.Methods inherited from class org.qubership.atp.dataset.macros.processor.MacroProcessorBase
assertEvaluationEnded, createChildContext, read, reduceTreeLevel, toString
-
Field Details
-
tail
-
registry
-
tokens
-
lastEvaluationResult
-
-
Constructor Details
-
AbstractMacroProcessor
-
-
Method Details
-
getValue
- Throws:
CtxEvalException
-
evaluateNext
Evaluates a part of an expression.- Returns:
- true if has next
- Throws:
CtxEvalException- if got evaluation error
-
reevaluateRootLevel
Description copied from class:MacroProcessorBaseInvoked on the end of root macro processing. Should drop text into tail and parse again. Returns true if text has changed after extra processing step.- Specified by:
reevaluateRootLevelin classMacroProcessorBase<T extends MacroContextBase>- Throws:
CtxEvalException
-
getArguments
-
getText
-
dropArguments
-
dropText
-
reduce
Description copied from class:MacroProcessorBaseChild will be thrown away. Child is evaluated - content in it's text. Parent may has an arguments, which should be reevaluated too. Sample: this.tail.append(parent.args).append(child.text).append(")"); parent.args.clear();- Specified by:
reducein classMacroProcessorBase<T extends MacroContextBase>- Throws:
CtxEvalException
-
evaluateAll
Evaluates full expression.- Returns:
- evaluated value.
- Throws:
CtxEvalException
-