-
public interface Processor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
define(Identified macro)
default void
defineGlobal(Identified macro)
MacroRegister
getRegister()
Get the macro register of this processor.default boolean
isDefined(java.lang.String id)
ScriptMacro
newScriptMacro(java.lang.String id, java.lang.String scriptType, java.lang.String input, java.lang.String[] params)
Create a new user defined script.UserDefinedMacro
newUserDefinedMacro(java.lang.String id, java.lang.String input, java.lang.String[] params)
Create a new user defined macro.java.lang.String
process(Input in)
default void
separators(java.lang.String openMacro, java.lang.String closeMacro)
-
-
-
Method Detail
-
getRegister
MacroRegister getRegister()
Get the macro register of this processor. SeeMacroRegister
- Returns:
- the register
-
newUserDefinedMacro
UserDefinedMacro newUserDefinedMacro(java.lang.String id, java.lang.String input, java.lang.String[] params) throws BadSyntax
Create a new user defined macro. The implementation of this method calls the constructor of the matching implementation of the user defined macro. The existence of this method loosens the coupling of the user of the API and the actual implementation. The code using the implementation may need only to initiate the engine that implements this interface, but does not need to access directly the UserDefinedMacro or other interface implementations.NOTE: The invocation of this method creates a new object but it DOES NOT register the created user defined macro in the macro registry. The sole purpose of this method is to decouple the API usage and the implementation.
- Parameters:
id
- the identifier (name) of the macroinput
- the content of the macroparams
- the parameter names of the macro- Returns:
- the new user defined macro
- Throws:
BadSyntax
- in case the parameter names contain each other
-
newScriptMacro
ScriptMacro newScriptMacro(java.lang.String id, java.lang.String scriptType, java.lang.String input, java.lang.String[] params) throws BadSyntax
Create a new user defined script. Read the important comments fornewUserDefinedMacro(String, String, String[])
- Parameters:
id
- seenewUserDefinedMacro(String, String, String[])
scriptType
- seenewUserDefinedMacro(String, String, String[])
input
- seenewUserDefinedMacro(String, String, String[])
params
- seenewUserDefinedMacro(String, String, String[])
- Returns:
- see
newUserDefinedMacro(String, String, String[])
- Throws:
BadSyntax
- seenewUserDefinedMacro(String, String, String[])
-
isDefined
default boolean isDefined(java.lang.String id)
-
defineGlobal
default void defineGlobal(Identified macro)
-
define
default void define(Identified macro)
-
-