- java.lang.Object
-
- javax0.jamal.engine.Processor
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MacroRegister
getRegister()
ScriptMacro
newScriptMacro(java.lang.String id, java.lang.String scriptType, java.lang.String input, java.lang.String... params)
UserDefinedMacro
newUserDefinedMacro(java.lang.String id, java.lang.String input, java.lang.String... params)
java.lang.String
process(Input in)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax0.jamal.api.Processor
define, defineGlobal, isDefined, separators
-
-
-
-
Constructor Detail
-
Processor
public Processor(java.lang.String macroOpen, java.lang.String macroClose)
Create a new Processor that can be used to process macros. It sets the separators to the specified values. These separators start and end macros and the usual strings are "{" and "}".The constructor also loads the macros that are defined either in the modules as implementations provided for the interface
Macro
or in library files listed in the META-INF directory (old way). The constructor uses theServiceLoader
to load the macros.Neither
macroOpen
normacroClose
can benull
. In case any of these parameters arenull
anIllegalArgumentException
will be thrown.- Parameters:
macroOpen
- the macro opening stringmacroClose
- the macro closing string
-
Processor
public Processor()
Complimentary constructor that creates a processor with the conventional separators: "{" and "}".Note that any string containing many characters can be used as separators. It is recommended to use different strings as opening and closing string or else it will not be possible to nest macros into each other.
-
-
Method Detail
-
newUserDefinedMacro
public UserDefinedMacro newUserDefinedMacro(java.lang.String id, java.lang.String input, java.lang.String... params) throws BadSyntax
- Specified by:
newUserDefinedMacro
in interfaceProcessor
- Throws:
BadSyntax
-
newScriptMacro
public ScriptMacro newScriptMacro(java.lang.String id, java.lang.String scriptType, java.lang.String input, java.lang.String... params)
- Specified by:
newScriptMacro
in interfaceProcessor
-
getRegister
public MacroRegister getRegister()
- Specified by:
getRegister
in interfaceProcessor
-
-