java.lang.Object
com.tlcsdm.core.dsl.DSL
Represents the data portion of the DSL.
This class is used to configure and start the DSL Runtime.
- 从以下版本开始:
- Jan, 17th, 2017
- 作者:
- Konloch
-
字段概要
字段修饰符和类型字段说明private final Stringprivate final Stringprivate final HashMap<String, DSLDefinedCommand> private final Stringprivate final DSLRuntimeprivate final Stringprivate final booleanprivate final Stringprivate final Stringprivate final HashMap<String, List<DSLRuntimeCommand>> private final char -
构造器概要
构造器构造器说明DSL(char setValueDelimiter, char variableDelimiter, char bracketDelimiterStart, char bracketDelimiterEnd, char subscriptDelimiterStart, char subscriptDelimiterEnd, char commentDelimiter) Constructs a new DSL instance with strict mode disabled by default.DSL(char setValueDelimiter, char variableDelimiter, char bracketDelimiterStart, char bracketDelimiterEnd, char subscriptDelimiterStart, char subscriptDelimiterEnd, char commentDelimiter, boolean strictMode) Constructs a new DSL instance. -
方法概要
修饰符和类型方法说明addFunc(String name, FunctionRunnable functionRunnable) Add a new function handler.Define a subscript.addVar(String name, VariableRunnable variableRunnable) Add a new variable handler.clear()Clear all the user defined commands and subscripts.Returns the bracket delimiter endReturns the bracket delimiter startReturns the command mapReturns the comment delimiterThe DLSRuntime associated with this DSL.Returns the set value delimiterReturns the subscript delimiter endReturns the subscript delimiter startThe subscript mapcharReturns the variable delimiterbooleanReturns the strict mode flagParse any File and execute / load the script.Parse any String ArrayList and execute / load the script.removeFunc(String name) Remove a function handler.Remove a subscript.Remove a variable handler.Runs a subscript associated with a String name.
-
字段详细资料
-
setValueDelimiter
-
variableDelimiter
private final char variableDelimiter -
bracketDelimiterStart
-
bracketDelimiterEnd
-
subscriptDelimiterStart
-
subscriptDelimiterEnd
-
commentDelimiter
-
strictMode
private final boolean strictMode -
commands
-
subscripts
-
runtime
-
-
构造器详细资料
-
DSL
public DSL(char setValueDelimiter, char variableDelimiter, char bracketDelimiterStart, char bracketDelimiterEnd, char subscriptDelimiterStart, char subscriptDelimiterEnd, char commentDelimiter) Constructs a new DSL instance with strict mode disabled by default.- 参数:
setValueDelimiter- any character to represent the variable value delimitervariableDelimiter- any character to represent the variable delimiterbracketDelimiterStart- any character to represent the bracket delimiter startbracketDelimiterEnd- any character to represent the bracket delimiter endsubscriptDelimiterStart- any character to represent the subscript delimiter startsubscriptDelimiterEnd- any character to represent the subscript delimiter endcommentDelimiter- any character to represent the comment delimiter
-
DSL
public DSL(char setValueDelimiter, char variableDelimiter, char bracketDelimiterStart, char bracketDelimiterEnd, char subscriptDelimiterStart, char subscriptDelimiterEnd, char commentDelimiter, boolean strictMode) Constructs a new DSL instance.- 参数:
setValueDelimiter- any character to represent the variable value delimitervariableDelimiter- any character to represent the variable delimiterbracketDelimiterStart- any character to represent the bracket delimiter startbracketDelimiterEnd- any character to represent the bracket delimiter endsubscriptDelimiterStart- any character to represent the subscript delimiter startsubscriptDelimiterEnd- any character to represent the subscript delimiter endcommentDelimiter- any character to represent the comment delimiterstrictMode- true for strict mode to be enabled
-
-
方法详细资料
-
clear
Clear all the user defined commands and subscripts. It also removes all runtime data.- 返回:
- this instance for method chaining
-
parse
Parse any File and execute / load the script.- 参数:
file- any file- 返回:
- this instance for method chaining
- 抛出:
IOException- if an I/O error occurs reading from the stream
-
parse
Parse any String ArrayList and execute / load the script.- 参数:
fileContents- any String ArrayList- 返回:
- this instance for method chaining
-
addVar
Add a new variable handler.- 参数:
name- any String as the variable namevariableRunnable- any VariableRunnable to be called when the variable set value gets called- 返回:
- this instance for method chaining
-
removeVar
Remove a variable handler.- 参数:
name- any String as the variable name- 返回:
- this instance for method chaining
-
addFunc
Add a new function handler.- 参数:
name- any String as the function namefunctionRunnable- any FunctionRunnable to be called when the function gets called- 返回:
- this instance for method chaining
-
removeFunc
Remove a function handler.- 参数:
name- any String as the function name- 返回:
- this instance for method chaining
-
addSub
Define a subscript.- 参数:
name- any String as the subscript name- 返回:
- this instance for method chaining
-
removeSub
Remove a subscript.- 参数:
name- any String as the subscript name- 返回:
- this instance for method chaining
-
run
Runs a subscript associated with a String name. Throws a Runtime Exception if the Subscript doesn't exist.- 参数:
name- any String as the subscript name- 返回:
- this instance for method chaining
-
getSetValueDelimiter
Returns the set value delimiter- 返回:
- the set value delimiter as a String
-
getBracketDelimiterStart
Returns the bracket delimiter start- 返回:
- the bracket delimiter start as a String
-
getBracketDelimiterEnd
Returns the bracket delimiter end- 返回:
- the bracket delimiter end as a String
-
getSubscriptDelimiterStart
Returns the subscript delimiter start- 返回:
- the subscript delimiter start as a String
-
getSubscriptDelimiterEnd
Returns the subscript delimiter end- 返回:
- the subscript delimiter end as a String
-
getVariableDelimiter
public char getVariableDelimiter()Returns the variable delimiter- 返回:
- the variable delimiter as a String
-
getCommentDelimiter
Returns the comment delimiter- 返回:
- the comment delimiter as a String
-
isStrictMode
public boolean isStrictMode()Returns the strict mode flag- 返回:
- if true strict mode will be enabled during runtime parsing
-
getCommands
Returns the command map- 返回:
- the command map as a HashMap
-
getSubscripts
The subscript map- 返回:
- the subscript map as a HashMap
-
getRuntime
The DLSRuntime associated with this DSL.- 返回:
- the DSLRuntime for this DSL instance
-