public class MEXTransformer
extends java.lang.Object
The transformation occurs in two distinct, required phases (passes):
The transformer uses a recursive descent parser for curly brace blocks.
| Constructor and Description |
|---|
MEXTransformer(java.lang.String _source)
Constructs a new MEXTransformer instance with the given source string.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCursor() |
java.lang.StringBuilder |
getResult() |
java.lang.String |
getSource()
Fallback evaluator used in the final pass to catch any curly expressions that were not replaced by previous evaluators.
|
java.lang.String |
getVar(java.lang.String name)
Retrieves the value of a variable from the context.
|
int |
getVarCount()
Returns the number of variables currently stored in the internal map.
|
void |
setCursor(int $4) |
void |
setResult(java.lang.StringBuilder $5) |
void |
setSource(java.lang.String $3) |
MEXTransformer |
setVar(java.lang.String name,
java.lang.String value)
Sets a variable in the transformer's context.
|
java.lang.CharSequence |
transform()
Executes the full two-pass transformation (Pass 1: Definitions, Pass 2: Expansion).
|
java.lang.CharSequence |
transform(MEXTransformerEvaluatorI[] evals)
Executes the two core transformation passes, followed by a custom evaluation pass.
|
java.lang.CharSequence |
transform(MEXTransformerEvaluatorI[] evals,
boolean lastPass)
Executes the two core transformation passes, followed by an optional custom evaluation pass.
|
public MEXTransformer(java.lang.String _source)
_source - The string containing expressions to be transformed.public java.lang.CharSequence transform()
public java.lang.CharSequence transform(MEXTransformerEvaluatorI[] evals)
evals - An array of custom evaluators to run after Phase 2.public java.lang.CharSequence transform(MEXTransformerEvaluatorI[] evals, boolean lastPass)
evals - An array of custom evaluators to run after Phase 2.lastPass - If true, the LeftOverUnevaluatedFailEvaluator is appended to evals
to ensure all remaining curly blocks signal an error.public int getVarCount()
public MEXTransformer setVar(java.lang.String name, java.lang.String value)
value is null, the variable is removed.name - The name of the variable.value - The value to set for the variable. If null, the variable is removed.public java.lang.String getVar(java.lang.String name)
name - The name of the variable to retrieve.null if the variable is not set.public java.lang.String getSource()
IllegalArgumentException.public void setSource(java.lang.String $3)
public int getCursor()
public void setCursor(int $4)
public java.lang.StringBuilder getResult()
public void setResult(java.lang.StringBuilder $5)
Copyright © 2000-2026 OAshi S.à r.l. All Rights Reserved.