addCompileOption(String) - 类 中的方法com.jfinal.proxy.ProxyCompiler
addDirective(String, Class<? extends Directive>, boolean) - 类 中的方法com.jfinal.template.Engine
添加自定义指令
建议添加自定义指令时明确指定 keepLineBlank 变量值,其规则如下:
1:keepLineBlank 为 true 时, 该指令所在行的前后空白字符以及末尾字符 '\n' 将会被保留
一般用于具有输出值的指令,例如 #date、#para 等指令
2:keepLineBlank 为 false 时,该指令所在行的前后空白字符以及末尾字符 '\n' 将会被删除
一般用于没有输出值的指令,例如 #for、#if、#else、#end 这种性质的指令
示例:
addDirective("now", NowDirective.class, true)
addDirective(String, Class<? extends Directive>) - 类 中的方法com.jfinal.template.Engine
添加自定义指令,keepLineBlank 使用默认值
addDirective(String, DirectiveFactory, boolean) - 类 中的方法com.jfinal.template.EngineConfig
addDirective(String, Class<? extends Directive>, boolean) - 类 中的方法com.jfinal.template.EngineConfig
addDirective(String, DirectiveFactory) - 类 中的方法com.jfinal.template.EngineConfig
addDirective(String, Class<? extends Directive>) - 类 中的方法com.jfinal.template.EngineConfig
addDirective(String, Class<? extends Directive>) - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
添加自定义指令
addDirective(String, Directive) - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
已过时。
addEnum(Class<? extends Enum<?>>) - 类 中的方法com.jfinal.template.Engine
添加枚举类型,便于在模板中使用
例子:
1:定义枚举类型
public enum UserType {
ADMIN,
USER;
public String hello() {
return "hello";
}
}
2:配置
engine.addEnum(UserType.class);
3:模板中使用
### 以下的对象 u 通过 Controller 中的 setAttr("u", UserType.ADMIN) 传递
#if( u == UserType.ADMIN )
#(UserType.ADMIN)
#(UserType.ADMIN.name())
#(UserType.ADMIN.hello())
#end
addExtensionMethod(Class<?>, Object) - 类 中的静态方法com.jfinal.template.Engine
addExtensionMethod(Class<?>, Class<?>) - 类 中的静态方法com.jfinal.template.Engine
addExtensionMethod(Class<?>, Object) - 类 中的静态方法com.jfinal.template.expr.ast.MethodKit
addExtensionMethod(Class<?>, Class<?>) - 类 中的静态方法com.jfinal.template.expr.ast.MethodKit
addExtensionMethod(Class<?>, Object) - 类 中的静态方法com.jfinal.template.ext.spring.JFinalViewResolver
添加扩展方法
addExtensionMethod(Class<?>, Class<?>) - 类 中的静态方法com.jfinal.template.ext.spring.JFinalViewResolver
添加扩展方法
addFieldGetter(int, FieldGetter) - 类 中的静态方法com.jfinal.template.Engine
添加 FieldGetter 实现类到指定的位置
系统当前默认 FieldGetter 实现类及其位置如下:
GetterMethodFieldGetter ---> 调用 getter 方法取值
RealFieldGetter ---> 直接获取 public 型的 object.field 值
ModelFieldGetter ---> 调用 Model.get(String) 方法取值
RecordFieldGetter ---> 调用 Record.get(String) 方法取值
MapFieldGetter ---> 调用 Map.get(String) 方法取值
ArrayLengthGetter ---> 获取数组长度
根据以上次序,如果要插入 IsMethodFieldGetter 到 GetterMethodFieldGetter
之后的代码如下:
Engine.addFieldGetter(1, new IsMethodFieldGetter());
注:IsMethodFieldGetter 系统已经提供,只是默认没有启用。
addFieldGetter(int, FieldGetter) - 类 中的静态方法com.jfinal.template.expr.ast.FieldKit
addFieldGetterToFirst(FieldGetter) - 类 中的静态方法com.jfinal.template.Engine
addFieldGetterToFirst(FieldGetter) - 类 中的静态方法com.jfinal.template.expr.ast.FieldKit
addFieldGetterToLast(FieldGetter) - 类 中的静态方法com.jfinal.template.Engine
addFieldGetterToLast(FieldGetter) - 类 中的静态方法com.jfinal.template.expr.ast.FieldKit
addForbiddenClass(Class<?>) - 类 中的静态方法com.jfinal.template.expr.ast.MethodKit
addForbiddenMethod(String) - 类 中的静态方法com.jfinal.template.expr.ast.MethodKit
addFunction(Define) - 类 中的方法com.jfinal.template.Env
Add template function
addKeyword(String) - 类 中的方法com.jfinal.kit.JavaKeyword
addSharedFunction(String) - 类 中的方法com.jfinal.template.Engine
Add shared function by file
addSharedFunction(ISource) - 类 中的方法com.jfinal.template.Engine
Add shared function by ISource
addSharedFunction(String...) - 类 中的方法com.jfinal.template.Engine
Add shared function by files
addSharedFunction(String) - 类 中的方法com.jfinal.template.EngineConfig
Add shared function with file
addSharedFunction(String...) - 类 中的方法com.jfinal.template.EngineConfig
Add shared function with files
addSharedFunction(ISource) - 类 中的方法com.jfinal.template.EngineConfig
Add shared function by ISource
addSharedFunction(String) - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
添加 shared function 文件,可调用多次添加多个文件
addSharedFunctionByString(String) - 类 中的方法com.jfinal.template.Engine
Add shared function by string content
addSharedFunctionByString(String) - 类 中的方法com.jfinal.template.EngineConfig
Add shared function by string content
addSharedMethod(Object) - 类 中的方法com.jfinal.template.Engine
Add shared method from object
addSharedMethod(Class<?>) - 类 中的方法com.jfinal.template.Engine
Add shared method from class
addSharedMethod(Object) - 类 中的方法com.jfinal.template.EngineConfig
Add shared method from object
addSharedMethod(Class<?>) - 类 中的方法com.jfinal.template.EngineConfig
Add shared method from class
addSharedMethod(Object) - 类 中的方法com.jfinal.template.expr.ast.SharedMethodKit
addSharedMethod(Class<?>) - 类 中的方法com.jfinal.template.expr.ast.SharedMethodKit
addSharedMethod(Object) - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
添加共享方法
addSharedMethod(Class<?>) - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
添加共享方法
addSharedObject(String, Object) - 类 中的方法com.jfinal.template.Engine
Add shared object
addSharedObject(String, Object) - 类 中的方法com.jfinal.template.EngineConfig
addSharedObject(String, Object) - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
添加共享对象
addSharedStaticMethod(Class<?>) - 类 中的方法com.jfinal.template.Engine
Add shared static method of Class
addSharedStaticMethod(Class<?>) - 类 中的方法com.jfinal.template.EngineConfig
Add shared static method of Class
addSharedStaticMethod(Class<?>) - 类 中的方法com.jfinal.template.expr.ast.SharedMethodKit
addSource(ISource) - 类 中的方法com.jfinal.template.Env
添加本 Template 的 ISource,以及该 Template 使用 include 包含进来的所有 ISource
以便于在 devMode 之下判断该 Template 是否被 modified,进而 reload 该 Template
append(Prop) - 类 中的方法com.jfinal.kit.Prop
append(String, String) - 类 中的方法com.jfinal.kit.Prop
append(String) - 类 中的方法com.jfinal.kit.Prop
append(File, String) - 类 中的方法com.jfinal.kit.Prop
append(File) - 类 中的方法com.jfinal.kit.Prop
append(Prop) - 类 中的静态方法com.jfinal.kit.PropKit
append(String, String) - 类 中的静态方法com.jfinal.kit.PropKit
append(String) - 类 中的静态方法com.jfinal.kit.PropKit
append(File, String) - 类 中的静态方法com.jfinal.kit.PropKit
append(File) - 类 中的静态方法com.jfinal.kit.PropKit
append(CharSequence) - 类 中的方法com.jfinal.template.io.FastStringWriter
append(CharSequence, int, int) - 类 中的方法com.jfinal.template.io.FastStringWriter
append(char) - 类 中的方法com.jfinal.template.io.FastStringWriter
appendIfExists(String, String) - 类 中的方法com.jfinal.kit.Prop
appendIfExists(String) - 类 中的方法com.jfinal.kit.Prop
appendIfExists(File, String) - 类 中的方法com.jfinal.kit.Prop
appendIfExists(File) - 类 中的方法com.jfinal.kit.Prop
appendIfExists(String, String) - 类 中的静态方法com.jfinal.kit.PropKit
appendIfExists(String) - 类 中的静态方法com.jfinal.kit.PropKit
appendIfExists(File, String) - 类 中的静态方法com.jfinal.kit.PropKit
appendIfExists(File) - 类 中的静态方法com.jfinal.kit.PropKit
Arith - com.jfinal.template.expr.ast 中的类
Arithmetic
1:支持 byte short int long float double BigInteger BigDecimal 的 + - * / % 运算
2:支持字符串加法运算
Arith(Sym, Expr, Expr, Location) - 类 的构造器com.jfinal.template.expr.ast.Arith
Array - com.jfinal.template.expr.ast 中的类
Array
用法:
1:[1, 2, 3]
2:["a", 1, "b", 2, false, 3.14]
Array(Expr[], Location) - 类 的构造器com.jfinal.template.expr.ast.Array
Array.ArrayListExt - com.jfinal.template.expr.ast 中的类
支持 array.length 表达式
ArrayLengthGetter() - 类 的构造器com.jfinal.template.expr.ast.FieldGetters.ArrayLengthGetter
ArrayListExt(int) - 类 的构造器com.jfinal.template.expr.ast.Array.ArrayListExt
Assign - com.jfinal.template.expr.ast 中的类
Assign
支持三种赋值,其中第二种如果括号中是 ID 或 STR 则演变为第三种是对 map 赋值:
1:ID = expr
2:ID [ expr ] = expr
如果 expr 为 int 或 long 型,则是对 array 赋值
如果 expr 为 ID、STR 型,则是对 map 进行赋值
否则抛异常出来
3:ID [ ID ] = expr 或者 ID [ STR ] = expr
4:支持无限连:id = array[ i = 0 ] = array[1] = 123
Assign(String, Expr, Expr, Location) - 类 的构造器com.jfinal.template.expr.ast.Assign
数组赋值表达式
Assign(String, Expr, Location) - 类 的构造器com.jfinal.template.expr.ast.Assign
普通赋值表达式
attachment - 类 中的变量com.jfinal.template.stat.Ctrl
cache - 类 中的静态变量com.jfinal.template.expr.ast.FastFieldGetter
Call - com.jfinal.template.stat.ast 中的类
Call 调用模板函数,两种用法:
1:常规调用
#@funcName(p1, p2, ..., pn)
2:安全调用,函数被定义才调用,否则跳过
#@funcName?
Call(String, ExprList, boolean) - 类 的构造器com.jfinal.template.stat.ast.Call
call(Env, Scope, ExprList, Writer) - 类 中的方法com.jfinal.template.stat.ast.Define
真正调用模板函数
call(Stat, Env, Scope, T) - 接口 中的方法com.jfinal.template.Template.Func
CallDirective - com.jfinal.template.ext.directive 中的类
CallDirective 动态调用模板函数
模板函数的名称与参数都可以动态指定,提升模板函数调用的灵活性
例如:
#call(funcName, p1, p2, ..., pn)
其中 funcName,为函数名,p1、p2、pn 为被调用函数所使用的参数
如果希望模板函数不存在时忽略其调用,添加常量值 true 在第一个参数位置即可
例如:
#call(true, funcName, p1, p2, ..., pn)
TODO 后续优化看一下 ast.Call.java
CallDirective() - 类 的构造器com.jfinal.template.ext.directive.CallDirective
Case - com.jfinal.template.stat.ast 中的类
Case
Case(ExprList, StatList, Location) - 类 的构造器com.jfinal.template.stat.ast.Case
CaseSetter - com.jfinal.template.stat.ast 中的接口
CaseSetter
charset - 类 中的变量com.jfinal.template.io.EncoderFactory
CharTable - com.jfinal.template.stat 中的类
CharTable 空间换时间优化字符判断性能
负值参数强转 char 会自动变正值,无需判断负值数组下标
isLetter(EOF) 不会下标越界
CharWriter - com.jfinal.template.io 中的类
CharWriter
CharWriter(int) - 类 的构造器com.jfinal.template.io.CharWriter
classLoader - 类 中的静态变量com.jfinal.template.expr.ast.FastFieldGetter
classLoader - 类 中的变量com.jfinal.template.source.ClassPathSource
ClassPathSource - com.jfinal.template.source 中的类
ClassPathSource 用于从 class path 以及 jar 包之中加载模板内容
注意:
1:如果被加载的文件是 class path 中的普通文件,则该文件支持热加载
2:如果被加载的文件处于 jar 包之中,则该文件不支持热加载,jar 包之中的文件在运行时通常不会被修改
在极少数情况下如果需要对 jar 包之中的模板文件进行热加载,可以通过继承 ClassPathSource
的方式进行扩展
3:JFinal Template Engine 开启热加载需要配置 engine.setDevMode(true)
ClassPathSource(String) - 类 的构造器com.jfinal.template.source.ClassPathSource
ClassPathSource(String, String) - 类 的构造器com.jfinal.template.source.ClassPathSource
ClassPathSource(String, String, String) - 类 的构造器com.jfinal.template.source.ClassPathSource
ClassPathSourceFactory - com.jfinal.template.source 中的类
ClassPathSourceFactory 用于配置 Engine 使用 ClassPathSource 加载模板文件
配置示例:
engine.baseTemplatePath(null); // 清掉 base path
engine.setSourceFactory(new ClassPathSourceFactory());
ClassPathSourceFactory() - 类 的构造器com.jfinal.template.source.ClassPathSourceFactory
clazz - 类 中的变量com.jfinal.template.expr.ast.MethodInfo
clear() - 类 中的静态方法com.jfinal.kit.PropKit
clear() - 类 中的方法com.jfinal.kit.SyncWriteMap
clearCache() - 类 中的静态方法com.jfinal.template.expr.ast.FieldKit
clearCache() - 类 中的静态方法com.jfinal.template.expr.ast.MethodKit
close() - 类 中的方法com.jfinal.template.io.ByteWriter
close() - 类 中的方法com.jfinal.template.io.CharWriter
close() - 类 中的方法com.jfinal.template.io.FastStringWriter
com.jfinal.kit - 程序包 com.jfinal.kit
com.jfinal.proxy - 程序包 com.jfinal.proxy
com.jfinal.template - 程序包 com.jfinal.template
com.jfinal.template.expr - 程序包 com.jfinal.template.expr
com.jfinal.template.expr.ast - 程序包 com.jfinal.template.expr.ast
com.jfinal.template.ext.directive - 程序包 com.jfinal.template.ext.directive
com.jfinal.template.ext.extensionmethod - 程序包 com.jfinal.template.ext.extensionmethod
com.jfinal.template.ext.sharedmethod - 程序包 com.jfinal.template.ext.sharedmethod
com.jfinal.template.ext.spring - 程序包 com.jfinal.template.ext.spring
com.jfinal.template.io - 程序包 com.jfinal.template.io
com.jfinal.template.source - 程序包 com.jfinal.template.source
com.jfinal.template.stat - 程序包 com.jfinal.template.stat
com.jfinal.template.stat.ast - 程序包 com.jfinal.template.stat.ast
Compare - com.jfinal.template.expr.ast 中的类
Compare
1:支持 byte short int long float double BigInteger BigDecimal 的 == !
Compare(Sym, Expr, Expr, Location) - 类 的构造器com.jfinal.template.expr.ast.Compare
compile(ProxyClass) - 类 中的方法com.jfinal.proxy.ProxyCompiler
compiler - 类 中的静态变量com.jfinal.template.expr.ast.FastFieldGetter
compress(StringBuilder) - 类 中的方法com.jfinal.template.stat.Compressor
compress(StringBuilder) - 类 中的方法com.jfinal.template.stat.LineCompressor
compressLine(StringBuilder, int, int, int, StringBuilder) - 类 中的方法com.jfinal.template.stat.LineCompressor
按行压缩
只压缩文本前后的空白字符,文本内部的空白字符不压缩,极大简化压缩算法、提升压缩效率,并且压缩结果也不错
Compressor - com.jfinal.template.stat 中的类
Compressor
压缩规则:
1:为追求性能极致只压缩模板中的静态文本内容,指令输出的内容不压缩,例如 #(blog.content) 输出的内容不会被压缩
由于模板静态内容会被缓存,所以只需压缩一次,性能被最大化
2:多个连续空格字符压缩为一个空格字符
3:空格字符与 '\n' 的组合,压缩为一个 separator 字符。
Compressor() - 类 的构造器com.jfinal.template.stat.Compressor
Compressor(char) - 类 的构造器com.jfinal.template.stat.Compressor
compute(K, BiFunction<? super K, ? super V, ? extends V>) - 类 中的方法com.jfinal.kit.SyncWriteMap
computeIfAbsent(K, Function<? super K, ? extends V>) - 类 中的方法com.jfinal.kit.SyncWriteMap
computeIfPresent(K, BiFunction<? super K, ? super V, ? extends V>) - 类 中的方法com.jfinal.kit.SyncWriteMap
Const - com.jfinal.template.expr.ast 中的类
STR INT LONG FLOAT DOUBLE TRUE FALSE NULL
Const(Sym, Object) - 类 的构造器com.jfinal.template.expr.ast.Const
INT LONG FLOAT DOUBLE 常量已在 NumTok 中转换成了确切的类型,无需再次转换
contains(String) - 类 中的方法com.jfinal.kit.JavaKeyword
contains(Class<? extends FieldGetter>) - 类 中的静态方法com.jfinal.template.expr.ast.FieldKit
判断是否包含某个 FieldGetter
containsKey(String) - 类 中的方法com.jfinal.kit.Prop
containsKey(String) - 类 中的静态方法com.jfinal.kit.PropKit
Continue - com.jfinal.template.stat.ast 中的类
Continue
create() - 类 中的静态方法com.jfinal.kit.Kv
create() - 类 中的静态方法com.jfinal.kit.Okv
create(String) - 类 中的静态方法com.jfinal.template.Engine
Create engine with engine name managed by JFinal
create(String, Consumer<Engine>) - 类 中的静态方法com.jfinal.template.Engine
Create engine with engine name managed by JFinal
Example:
Engine engine = Engine.create("myEngine", e -> {
e.setDevMode(true);
e.setToClassPathSourceFactory();
});
engine.getTemplate("template.html").render(System.out);
>
createDirective() - 接口 中的方法com.jfinal.template.DirectiveFactory
createDirective() - 类 中的方法com.jfinal.template.DirectiveFactoryDefault
createIfAbsent(String, Consumer<Engine>) - 类 中的静态方法com.jfinal.template.Engine
Create engine if absent with engine name managed by JFinal
Example:
Engine engine = Engine.createIfAbsent("myEngine", e -> {
e.setDevMode(true);
e.setToClassPathSourceFactory();
});
engine.getTemplate("template.html").render(System.out);
>
createProxy(Class<?>, String) - 类 中的方法com.jfinal.template.expr.ast.FastFieldGetter
Ctrl - com.jfinal.template.stat 中的类
Ctrl
封装 AST 执行过程中的控制状态,避免使用 Scope.data 保存控制状态
从而污染用户空间数据,目前仅用于 nullSafe、break、continue、return 控制
未来可根据需求引入更多控制状态
Ctrl() - 类 的构造器com.jfinal.template.stat.Ctrl
FALSE - 类 中的静态变量com.jfinal.template.expr.ast.Const
FastFieldGetter - com.jfinal.template.expr.ast 中的类
使用 jfinal proxy 机制消除 java.lang.reflect.Method.invoke(...)
FastFieldGetter(FastFieldGetter.Proxy, Method) - 类 的构造器com.jfinal.template.expr.ast.FastFieldGetter
FastFieldGetter() - 类 的构造器com.jfinal.template.expr.ast.FastFieldGetter
仅用于配置 Engine.addFieldGetter(0, new FastFieldGetter());
FastFieldGetter.Proxy - com.jfinal.template.expr.ast 中的接口
代理接口
FastFieldKeyBuilder() - 类 的构造器com.jfinal.template.expr.ast.FieldKeyBuilder.FastFieldKeyBuilder
FastMethodKeyBuilder() - 类 的构造器com.jfinal.template.expr.ast.MethodKeyBuilder.FastMethodKeyBuilder
FastStringWriter - com.jfinal.template.io 中的类
FastStringWriter
由 JDK 中 Writer 改造而来,在其基础之上做了如下改变:
1:添加 char[] value 直接保存 char 值
2:添加 int len 记录数据长度
3:去掉 synchronized 操作
4:添加 MAX_BUFFER_SIZE,限定 value 被重用的最大长度
5:去掉了 close() 方法声明中的 throws IOException,并添加缓存回收逻辑
FastStringWriter(int) - 类 的构造器com.jfinal.template.io.FastStringWriter
FastStringWriter() - 类 的构造器com.jfinal.template.io.FastStringWriter
Field - com.jfinal.template.expr.ast 中的类
Field
field 表达式取值优先次序,以 user.name 为例
1:假如 user.getName() 存在,则优先调用
2:假如 user 具有 public name 属性,则取 user.name 属性值
3:假如 user 为 Model 子类,则调用 user.get("name")
4:假如 user 为 Record,则调用 user.get("name")
5:假如 user 为 Map,则调用 user.get("name")
Field(Expr, String, boolean, Location) - 类 的构造器com.jfinal.template.expr.ast.Field
field - 类 中的变量com.jfinal.template.expr.ast.FieldGetters.RealFieldGetter
FieldGetter - com.jfinal.template.expr.ast 中的类
FieldGetter 用于支持 target.field 表达式的取值,
以及支持用户扩展自定义的 FieldGetter 实现方式
FieldGetter() - 类 的构造器com.jfinal.template.expr.ast.FieldGetter
FieldGetters - com.jfinal.template.expr.ast 中的类
FieldGetters 封装官方默认 FieldGetter 实现
FieldGetters() - 类 的构造器com.jfinal.template.expr.ast.FieldGetters
FieldGetters.ArrayLengthGetter - com.jfinal.template.expr.ast 中的类
ArrayLengthGetter
获取数组长度: array.length
FieldGetters.GetterMethodFieldGetter - com.jfinal.template.expr.ast 中的类
GetterMethodFieldGetter
使用 getter 方法获取 target.field 表达式的值
FieldGetters.IsMethodFieldGetter - com.jfinal.template.expr.ast 中的类
IsMethodFieldGetter
使用 target.isXxx() 方法获取值,默认不启用该功能,用户可以通过如下方式启用:
Engine.addLastFieldGetter(new FieldGetters.IsMethodFieldGetter());
FieldGetters.MapFieldGetter - com.jfinal.template.expr.ast 中的类
MapFieldGetter
使用 Map.get(Object) 获取值
FieldGetters.NullFieldGetter - com.jfinal.template.expr.ast 中的类
NullFieldGetter
用于消除 FieldKit.getFieldGetter(...)
FieldGetters.RealFieldGetter - com.jfinal.template.expr.ast 中的类
RealFieldGetter
使用 target.field 获取值
FieldKey(int, long) - 类 的构造器com.jfinal.template.expr.ast.FieldKeyBuilder.FieldKey
FieldKeyBuilder - com.jfinal.template.expr.ast 中的类
FieldKeyBuilder
用于生成缓存 FieldGetter 的 key
FieldKeyBuilder() - 类 的构造器com.jfinal.template.expr.ast.FieldKeyBuilder
FieldKeyBuilder.FastFieldKeyBuilder - com.jfinal.template.expr.ast 中的类
FastFieldKeyBuilder
FieldKeyBuilder.FieldKey - com.jfinal.template.expr.ast 中的类
FieldKey
FieldKey 用于封装 targetClass、fieldName 这两部分的 hash 值,
确保不会出现 key 值碰撞
这两部分 hash 值在不同 class 与 field 的组合下出现碰撞的
概率完全可以忽略不计
备忘:
可以考虑用 ThreadLocal 重用 FieldKey 对象,但要注意放入 Map fieldGetterCache
中的 FieldKey 对象需要 clone 出来,确保线程安全。
FieldKeyBuilder.StrictFieldKeyBuilder - com.jfinal.template.expr.ast 中的类
StrictFieldKeyBuilder
FieldKit - com.jfinal.template.expr.ast 中的类
FieldKit
FieldKit() - 类 的构造器com.jfinal.template.expr.ast.FieldKit
fileName - 类 中的变量com.jfinal.template.source.ClassPathSource
fileObjects - 类 中的变量com.jfinal.proxy.ProxyCompiler.MyJavaFileManager
FileSource - com.jfinal.template.source 中的类
FileSource 用于从普通文件中加载模板内容
FileSource(String, String, String) - 类 的构造器com.jfinal.template.source.FileSource
FileSource(String, String) - 类 的构造器com.jfinal.template.source.FileSource
FileSourceFactory - com.jfinal.template.source 中的类
FileSourceFactory 用于配置 Engine 使用 FileSource 加载模板文件
注意:
FileSourceFactory 为模板引擎默认配置
FileSourceFactory() - 类 的构造器com.jfinal.template.source.FileSourceFactory
finalFileName - 类 中的变量com.jfinal.template.source.ClassPathSource
findClass(String) - 类 中的方法com.jfinal.proxy.ProxyClassLoader
firstCharToLowerCase(String) - 类 中的静态方法com.jfinal.kit.StrKit
首字母变小写
firstCharToUpperCase(String) - 类 中的静态方法com.jfinal.kit.StrKit
首字母变大写
FLOAT - 类 中的静态变量com.jfinal.template.expr.ast.Arith
FloatExt - com.jfinal.template.ext.extensionmethod 中的类
针对 java.lang.Float 的扩展方法
用法:
#if(value.toInt() == 123)
FloatExt() - 类 的构造器com.jfinal.template.ext.extensionmethod.FloatExt
FloatingDecimal - com.jfinal.template.io 中的类
FloatingDecimal(double) - 类 的构造器com.jfinal.template.io.FloatingDecimal
FloatingDecimal(float) - 类 的构造器com.jfinal.template.io.FloatingDecimal
FloatingWriter - com.jfinal.template.io 中的类
FloatingWriter
FloatingWriter() - 类 的构造器com.jfinal.template.io.FloatingWriter
flush() - 类 中的方法com.jfinal.template.io.ByteWriter
flush() - 类 中的方法com.jfinal.template.io.CharWriter
flush() - 类 中的方法com.jfinal.template.io.FastStringWriter
flush() - 类 中的方法com.jfinal.template.io.Writer
fnv1a64(String) - 类 中的静态方法com.jfinal.kit.HashKit
FNV_OFFSET_BASIS_64 - 类 中的静态变量com.jfinal.kit.HashKit
FNV_PRIME_64 - 类 中的静态变量com.jfinal.kit.HashKit
For - com.jfinal.template.stat.ast 中的类
For 循环控制,支持 List、Map、数组、Collection、Iterator、Iterable
Enumeration、null 以及任意单个对象的迭代,简单说是支持所有对象迭代
主要用法:
1:#for(item : list) #(item) #end
2:#for(item : list) #(item) #else content #end
3:#for(i=0; i<9; i++) #(item) #end
4:#for(i=0; i<9; i++) #(item) #else content #end
For(ForCtrl, StatList, Stat) - 类 的构造器com.jfinal.template.stat.ast.For
ForCtrl - com.jfinal.template.expr.ast 中的类
forCtrl : ID : expression
| exprList?
ForCtrl(Id, Expr, Location) - 类 的构造器com.jfinal.template.expr.ast.ForCtrl
ID : expr
ForCtrl(ExprList, Expr, ExprList, Location) - 类 的构造器com.jfinal.template.expr.ast.ForCtrl
exprList?
ForEntry - com.jfinal.template.stat.ast 中的类
ForEntry 包装 HashMap、LinkedHashMap 等 Map 类型的 Entry 对象
ForEntry() - 类 的构造器com.jfinal.template.stat.ast.ForEntry
ForIteratorStatus - com.jfinal.template.stat.ast 中的类
ForIteratorStatus
封装 #for( id : expr) 迭代语句状态,便于模板中获取
使用以下表达式可以模板中获取迭代状态:
for.size 被迭代集合元素数量,不支持 Iterator 与 Iterable
for.index 从 0 下始的下标
for.count 从 1 开始的计数器
for.first 是否第一个元素
for.last 是否最后一个元素
for.odd 是否第奇数个元素
for.even 是否第偶数个元素
for.outer 获取外层 for 对象,便于获取外层 for 循环状态
例如: for.outer.index
ForIteratorStatus(Object, Object, Location) - 类 的构造器com.jfinal.template.stat.ast.ForIteratorStatus
ForLoopStatus - com.jfinal.template.stat.ast 中的类
ForLoopStatus
封装 #for( init; cond; update) 循环的状态,便于模板中获取
如下表达式可从模板中获取循环状态:
for.index 从 0 下始的下标
for.count 从 1 开始的计数器
for.first 是否第一个元素
for.odd 是否第奇数个元素
for.even 是否第偶数个元素
for.outer 获取外层 for 对象,便于获取外层 for 循环状态
例如: for.outer.index
注意:比迭代型循环语句少支持两个状态取值表达式:for.size、for.last
ForLoopStatus(Object) - 类 的构造器com.jfinal.template.stat.ast.ForLoopStatus
format(LocalDateTime, String) - 类 中的静态方法com.jfinal.kit.TimeKit
按指定 pattern 将 LocalDateTime 转换成 String
例如:format(LocalDateTime.now(), "yyyy-MM-dd HH:mm:ss")
format(LocalDateTime) - 类 中的静态方法com.jfinal.kit.TimeKit
format(LocalDate, String) - 类 中的静态方法com.jfinal.kit.TimeKit
按指定 pattern 将 LocalDate 转换成 String
format(LocalTime, String) - 类 中的静态方法com.jfinal.kit.TimeKit
按指定 pattern 将 LocalTime 转换成 String
format(Date, String) - 类 中的静态方法com.jfinal.kit.TimeKit
按指定 pattern 将 Date 转换成 String
例如:format(new Date(), "yyyy-MM-dd HH:mm:ss")
format(Date) - 类 中的静态方法com.jfinal.kit.TimeKit
formats - 类 中的变量com.jfinal.template.io.Writer
funcNameExpr - 类 中的变量com.jfinal.template.ext.directive.CallDirective
functionMap - 类 中的变量com.jfinal.template.Env
generateRandomStr(int) - 类 中的静态方法com.jfinal.kit.HashKit
generateSalt(int) - 类 中的静态方法com.jfinal.kit.HashKit
md5 128bit 16bytes
sha1 160bit 20bytes
sha256 256bit 32bytes
sha384 384bit 48bytes
sha512 512bit 64bytes
generateSaltForSha256() - 类 中的静态方法com.jfinal.kit.HashKit
generateSaltForSha512() - 类 中的静态方法com.jfinal.kit.HashKit
generator - 类 中的静态变量com.jfinal.template.expr.ast.FastFieldGetter
get(String) - 类 中的方法com.jfinal.kit.Prop
get(String, String) - 类 中的方法com.jfinal.kit.Prop
get(String) - 类 中的静态方法com.jfinal.kit.PropKit
get(String, String) - 类 中的静态方法com.jfinal.kit.PropKit
get(Object, String) - 类 中的方法com.jfinal.template.expr.ast.FastFieldGetter
get(Object, String) - 类 中的方法com.jfinal.template.expr.ast.FieldGetter
获取 target.fieldName 表达式的值
get(Object, String) - 类 中的方法com.jfinal.template.expr.ast.FieldGetters.ArrayLengthGetter
get(Object, String) - 类 中的方法com.jfinal.template.expr.ast.FieldGetters.GetterMethodFieldGetter
get(Object, String) - 类 中的方法com.jfinal.template.expr.ast.FieldGetters.IsMethodFieldGetter
get(Object, String) - 类 中的方法com.jfinal.template.expr.ast.FieldGetters.MapFieldGetter
get(Object, String) - 类 中的方法com.jfinal.template.expr.ast.FieldGetters.NullFieldGetter
get(Object, String) - 类 中的方法com.jfinal.template.expr.ast.FieldGetters.RealFieldGetter
get(int) - 类 中的方法com.jfinal.template.expr.ast.RangeArray.RangeList
get(Object) - 类 中的方法com.jfinal.template.ext.spring.JFinalView.InnerSession
覆盖 HashMap 的 get
get(Object) - 类 中的方法com.jfinal.template.stat.Scope
获取变量
自内向外在作用域栈中查找变量,返回最先找到的变量
getActualExpr() - 类 中的方法com.jfinal.template.expr.ast.ExprList
持有 ExprList 的指令可以通过此方法提升 AST 执行性能
1:当 exprArray.length == 1 时返回 exprArray[0]
2:当 exprArray.length == 0 时返回 NullExpr
3:其它情况返回 ExprList 自身
意义在于,当满足前面两个条件时,避免掉了 ExprList.eval(...)
getActualStat() - 类 中的方法com.jfinal.template.stat.ast.StatList
持有 StatList 的指令可以通过此方法提升 AST 执行性能
1:当 statArray.length > 1 时返回 StatList 自身
2:当 statArray.length == 1 时返回 statArray[0]
3:其它情况返回 NullStat
意义在于,当满足前面两个条件时,避免掉了 StatList.exec(...)
getAs(Object) - 类 中的方法com.jfinal.kit.Kv
getAs(Object, T) - 类 中的方法com.jfinal.kit.Kv
getAs(Object) - 类 中的方法com.jfinal.kit.Okv
getAs(Object, T) - 类 中的方法com.jfinal.kit.Okv
getAttachment() - 类 中的方法com.jfinal.template.stat.Ctrl
getAttribute(String) - 类 中的方法com.jfinal.template.ext.spring.JFinalView.InnerSession
getAttributeNames() - 类 中的方法com.jfinal.template.ext.spring.JFinalView.InnerSession
getBaseTemplatePath() - 类 中的方法com.jfinal.template.Engine
getBaseTemplatePath() - 类 中的方法com.jfinal.template.EngineConfig
getBigDecimal(Object) - 类 中的方法com.jfinal.kit.Kv
getBigDecimal(Object) - 类 中的方法com.jfinal.kit.Okv
getBoolean(Object) - 类 中的方法com.jfinal.kit.Kv
getBoolean(Object) - 类 中的方法com.jfinal.kit.Okv
getBoolean(String) - 类 中的方法com.jfinal.kit.Prop
getBoolean(String, Boolean) - 类 中的方法com.jfinal.kit.Prop
getBoolean(String) - 类 中的静态方法com.jfinal.kit.PropKit
getBoolean(String, Boolean) - 类 中的静态方法com.jfinal.kit.PropKit
getBoolean() - 类 中的方法com.jfinal.template.expr.ast.Const
getByteCode() - 类 中的方法com.jfinal.proxy.ProxyClass
getByteCode() - 类 中的方法com.jfinal.proxy.ProxyCompiler.MyJavaFileObject
getBytes() - 接口 中的方法com.jfinal.template.io.IWritable
供 OutputStream 模式下的 ByteWrite 使用
getBytes() - 类 中的方法com.jfinal.template.stat.ast.Text
getByteWriter(OutputStream) - 类 中的方法com.jfinal.template.io.WriterBuffer
getCacheKey() - 类 中的方法com.jfinal.template.source.ClassPathSource
getCacheKey() - 类 中的方法com.jfinal.template.source.FileSource
getCacheKey() - 接口 中的方法com.jfinal.template.source.ISource
cache key used to cache, return null if do not cache the template
注意:如果不希望缓存从该 ISource 解析出来的 Template 对象
让 getCacheKey() 返回 null 值即可
getCacheKey() - 类 中的方法com.jfinal.template.source.StringSource
getCharContent(boolean) - 类 中的方法com.jfinal.proxy.ProxyCompiler.MyJavaFileObject
getChars(char[]) - 类 中的方法com.jfinal.template.io.FloatingDecimal
getChars() - 接口 中的方法com.jfinal.template.io.IWritable
供 Writer 模式下的 CharWrite 使用
getChars() - 类 中的方法com.jfinal.template.stat.ast.Text
getCharWriter(Writer) - 类 中的方法com.jfinal.template.io.WriterBuffer
getClassLoader() - 类 中的方法com.jfinal.template.source.ClassPathSource
getClassPath() - 类 中的方法com.jfinal.proxy.ProxyCompiler
兼容 tomcat 丢失 class path,否则无法编译
getClazz() - 类 中的方法com.jfinal.proxy.ProxyClass
getCompressor() - 类 中的方法com.jfinal.template.EngineConfig
getCond() - 类 中的方法com.jfinal.template.expr.ast.ForCtrl
getContent() - 类 中的方法com.jfinal.template.source.ClassPathSource
getContent() - 类 中的方法com.jfinal.template.source.FileSource
getContent() - 接口 中的方法com.jfinal.template.source.ISource
content of ISource
getContent() - 类 中的方法com.jfinal.template.source.StringSource
getContent() - 类 中的方法com.jfinal.template.stat.ParaToken
getCount() - 类 中的方法com.jfinal.template.stat.ast.ForIteratorStatus
getCount() - 类 中的方法com.jfinal.template.stat.ast.ForLoopStatus
getCreationTime() - 类 中的方法com.jfinal.template.ext.spring.JFinalView.InnerSession
getCtrl() - 类 中的方法com.jfinal.template.stat.Scope
getData() - 类 中的方法com.jfinal.template.stat.Scope
获取本层作用域 data,可能为 null 值
getDate(Object) - 类 中的方法com.jfinal.kit.Kv
getDate(Object) - 类 中的方法com.jfinal.kit.Okv
getDateFormat(String) - 类 中的方法com.jfinal.template.io.DateFormats
getDatePattern() - 类 中的方法com.jfinal.template.Engine
getDatePattern() - 类 中的方法com.jfinal.template.EngineConfig
getDateTimeFormatter(String) - 类 中的静态方法com.jfinal.kit.TimeKit
getDevMode() - 类 中的方法com.jfinal.template.Engine
getDirective(String) - 类 中的方法com.jfinal.template.EngineConfig
getDouble(Object) - 类 中的方法com.jfinal.kit.Kv
getDouble(Object) - 类 中的方法com.jfinal.kit.Okv
getDouble(String) - 类 中的方法com.jfinal.kit.Prop
getDouble(String, Double) - 类 中的方法com.jfinal.kit.Prop
getDouble(String) - 类 中的静态方法com.jfinal.kit.PropKit
getDouble(String, Double) - 类 中的静态方法com.jfinal.kit.PropKit
getDouble() - 类 中的方法com.jfinal.template.expr.ast.Const
getEncoder() - 类 中的方法com.jfinal.template.io.EncoderFactory
getEncoder() - 类 中的方法com.jfinal.template.io.JdkEncoderFactory
getEncoding() - 类 中的方法com.jfinal.template.Engine
getEncoding() - 类 中的方法com.jfinal.template.EngineConfig
getEncoding() - 类 中的方法com.jfinal.template.source.ClassPathSource
getEncoding() - 类 中的方法com.jfinal.template.source.FileSource
getEncoding() - 接口 中的方法com.jfinal.template.source.ISource
encoding of content
getEncoding() - 类 中的方法com.jfinal.template.source.StringSource
getEngine() - 类 中的静态方法com.jfinal.kit.ElKit
getEngine() - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
getEngineConfig() - 类 中的方法com.jfinal.template.Engine
getEngineConfig() - 类 中的方法com.jfinal.template.Env
getEnv() - 类 中的静态方法com.jfinal.kit.PropKit
getEnvKey() - 类 中的静态方法com.jfinal.kit.PropKit
getEven() - 类 中的方法com.jfinal.template.stat.ast.ForIteratorStatus
getEven() - 类 中的方法com.jfinal.template.stat.ast.ForLoopStatus
getExpr(int) - 类 中的方法com.jfinal.template.expr.ast.ExprList
getExpr() - 类 中的方法com.jfinal.template.expr.ast.ForCtrl
getExprArray() - 类 中的方法com.jfinal.template.expr.ast.ExprList
getFastStringWriter() - 类 中的方法com.jfinal.template.io.WriterBuffer
getFieldGetter(Object, Class<?>, String) - 类 中的静态方法com.jfinal.template.expr.ast.FieldKit
getFieldKey(Class<?>, long) - 类 中的方法com.jfinal.template.expr.ast.FieldKeyBuilder.FastFieldKeyBuilder
getFieldKey(Class<?>, long) - 类 中的方法com.jfinal.template.expr.ast.FieldKeyBuilder
getFieldKey(Class<?>, long) - 类 中的方法com.jfinal.template.expr.ast.FieldKeyBuilder.StrictFieldKeyBuilder
getFileName() - 类 中的方法com.jfinal.template.source.FileSource
getFinalFileName() - 类 中的方法com.jfinal.template.source.FileSource
getFirst() - 类 中的方法com.jfinal.template.stat.ast.ForIteratorStatus
getFirst() - 类 中的方法com.jfinal.template.stat.ast.ForLoopStatus
getFirstExpr() - 类 中的方法com.jfinal.template.expr.ast.ExprList
getFloat(Object) - 类 中的方法com.jfinal.kit.Kv
getFloat(Object) - 类 中的方法com.jfinal.kit.Okv
getFloat() - 类 中的方法com.jfinal.template.expr.ast.Const
getFunction(String) - 类 中的方法com.jfinal.template.Env
Get function of current template first, getting shared function if null before
getFunction(String) - 类 中的方法com.jfinal.template.ext.directive.RenderDirective.SubEnv
接管父类 getFunction(),先从子模板中找模板函数,找不到再去父模板中找
getFunctionName() - 类 中的方法com.jfinal.template.stat.ast.Define
getGlobal(Object) - 类 中的方法com.jfinal.template.stat.Scope
获取全局变量
全局作用域是指本次请求的整个 template
getId() - 类 中的方法com.jfinal.template.expr.ast.Assign
获取 assign 表达式左侧标识符 id
在自定义指令中得到 id 值,可以得知该赋值表达式是针对哪个变量在操作,有助于扩展
需求来源:https://jfinal.com/share/379
getId() - 类 中的方法com.jfinal.template.expr.ast.ForCtrl
getId() - 类 中的方法com.jfinal.template.expr.ast.Id
getId() - 类 中的方法com.jfinal.template.ext.spring.JFinalView.InnerSession
getIndex() - 类 中的方法com.jfinal.template.expr.ast.Assign
getIndex() - 类 中的方法com.jfinal.template.stat.ast.ForIteratorStatus
getIndex() - 类 中的方法com.jfinal.template.stat.ast.ForLoopStatus
getInit() - 类 中的方法com.jfinal.template.expr.ast.ForCtrl
getInstance() - 类 中的静态方法com.jfinal.template.expr.ast.FieldKeyBuilder
getInstance() - 类 中的静态方法com.jfinal.template.expr.ast.MethodKeyBuilder
getInt(Object) - 类 中的方法com.jfinal.kit.Kv
getInt(Object) - 类 中的方法com.jfinal.kit.Okv
getInt(String) - 类 中的方法com.jfinal.kit.Prop
getInt(String, Integer) - 类 中的方法com.jfinal.kit.Prop
getInt(String) - 类 中的静态方法com.jfinal.kit.PropKit
getInt(String, Integer) - 类 中的静态方法com.jfinal.kit.PropKit
getInt() - 类 中的方法com.jfinal.template.expr.ast.Const
getJavaFileForInput(JavaFileManager.Location, String, JavaFileObject.Kind) - 类 中的方法com.jfinal.proxy.ProxyCompiler.MyJavaFileManager
getJavaFileForOutput(JavaFileManager.Location, String, JavaFileObject.Kind, FileObject) - 类 中的方法com.jfinal.proxy.ProxyCompiler.MyJavaFileManager
getKeepLineBlankDirectives() - 类 中的方法com.jfinal.template.EngineConfig
getKey() - 类 中的方法com.jfinal.template.expr.ast.MethodInfo
getKey() - 类 中的方法com.jfinal.template.stat.ast.ForEntry
getLast() - 类 中的方法com.jfinal.template.stat.ast.ForIteratorStatus
getLastAccessedTime() - 类 中的方法com.jfinal.template.ext.spring.JFinalView.InnerSession
getLastExpr() - 类 中的方法com.jfinal.template.expr.ast.ExprList
getLastModified() - 类 中的方法com.jfinal.template.source.ClassPathSource
getLength() - 类 中的方法com.jfinal.template.expr.ast.Array.ArrayListExt
getLocal(Object) - 类 中的方法com.jfinal.template.stat.Scope
获取局部变量
getLocalDateTime(Object) - 类 中的方法com.jfinal.kit.Kv
getLocalDateTime(Object) - 类 中的方法com.jfinal.kit.Okv
getLocation() - 类 中的方法com.jfinal.template.stat.ast.Stat
getLong(Object) - 类 中的方法com.jfinal.kit.Kv
getLong(Object) - 类 中的方法com.jfinal.kit.Okv
getLong(String) - 类 中的方法com.jfinal.kit.Prop
getLong(String, Long) - 类 中的方法com.jfinal.kit.Prop
getLong(String) - 类 中的静态方法com.jfinal.kit.PropKit
getLong(String, Long) - 类 中的静态方法com.jfinal.kit.PropKit
getLong() - 类 中的方法com.jfinal.template.expr.ast.Const
getMapOfValue(Object) - 类 中的方法com.jfinal.template.stat.Scope
自内向外在作用域栈中查找变量,获取变量所在的 Map,主要用于 IncDec
getMaxInactiveInterval() - 类 中的方法com.jfinal.template.ext.spring.JFinalView.InnerSession
getMethod(Class<?>, String, Object[]) - 类 中的静态方法com.jfinal.template.expr.ast.MethodKit
getMethodKey(Class<?>, String, Class<?>[]) - 类 中的方法com.jfinal.template.expr.ast.MethodKeyBuilder.FastMethodKeyBuilder
getMethodKey(Class<?>, String, Class<?>[]) - 类 中的方法com.jfinal.template.expr.ast.MethodKeyBuilder
生成指定 class、指定方法名、指定方法形参类型的 key 值,用于缓存
getMethodKey(Class<?>, String, Class<?>[]) - 类 中的方法com.jfinal.template.expr.ast.MethodKeyBuilder.StrictMethodKeyBuilder
getMethodSignature(Method) - 类 中的静态方法com.jfinal.kit.ReflectKit
getName() - 类 中的方法com.jfinal.proxy.ProxyClass
getName() - 类 中的方法com.jfinal.template.Engine
getName() - 类 中的方法com.jfinal.template.expr.ast.MethodInfo
getNumber(Object) - 类 中的方法com.jfinal.kit.Kv
getNumber(Object) - 类 中的方法com.jfinal.kit.Okv
getNumber() - 类 中的方法com.jfinal.template.expr.ast.Const
getNumberValue() - 类 中的方法com.jfinal.template.expr.NumTok
getOdd() - 类 中的方法com.jfinal.template.stat.ast.ForIteratorStatus
getOdd() - 类 中的方法com.jfinal.template.stat.ast.ForLoopStatus
getOptions() - 类 中的方法com.jfinal.proxy.ProxyCompiler
getOuter() - 类 中的方法com.jfinal.template.stat.ast.ForIteratorStatus
getOuter() - 类 中的方法com.jfinal.template.stat.ast.ForLoopStatus
getOutputDirective(ExprList, Location) - 类 中的方法com.jfinal.template.EngineConfig
getOutputDirective(ExprList, Location) - 类 中的方法com.jfinal.template.stat.OutputDirectiveFactory
getParameterNames() - 类 中的方法com.jfinal.template.stat.ast.Define
getParameterTypes() - 类 中的方法com.jfinal.template.expr.ast.MethodInfo
getParentClassLoader() - 类 中的静态方法com.jfinal.proxy.ProxyClassLoader
getPkg() - 类 中的方法com.jfinal.proxy.ProxyClass
getProp() - 类 中的静态方法com.jfinal.kit.PropKit
getProp(String) - 类 中的静态方法com.jfinal.kit.PropKit
getProperties() - 类 中的方法com.jfinal.kit.Prop
getRandomUUID() - 类 中的静态方法com.jfinal.kit.StrKit
getRight() - 类 中的方法com.jfinal.template.expr.ast.Assign
getRootData() - 类 中的方法com.jfinal.template.stat.Scope
获取顶层作用域 data,可能为 null 值
getRoundingMode() - 类 中的方法com.jfinal.template.EngineConfig
getRow() - 类 中的方法com.jfinal.template.stat.Location
getServletContext() - 类 中的方法com.jfinal.template.ext.spring.JFinalView.InnerSession
getSessionContext() - 类 中的方法com.jfinal.template.ext.spring.JFinalView.InnerSession
getSharedMethodInfo(String, Object[]) - 类 中的方法com.jfinal.template.expr.ast.SharedMethodKit
getSharedMethodKit() - 类 中的方法com.jfinal.template.EngineConfig
getSharedObject(String) - 类 中的方法com.jfinal.template.stat.Scope
获取共享对象
getSharedObjectMap() - 类 中的方法com.jfinal.template.EngineConfig
getSimpleDateFormat(String) - 类 中的静态方法com.jfinal.kit.TimeKit
getSize() - 类 中的方法com.jfinal.template.stat.ast.ForIteratorStatus
getSource(String, String, String) - 类 中的方法com.jfinal.template.source.ClassPathSourceFactory
getSource(String, String, String) - 类 中的方法com.jfinal.template.source.FileSourceFactory
getSource(String, String, String) - 接口 中的方法com.jfinal.template.source.ISourceFactory
getSourceCode() - 类 中的方法com.jfinal.proxy.ProxyClass
getSourceFactory() - 类 中的方法com.jfinal.template.Engine
getSourceFactory() - 类 中的方法com.jfinal.template.EngineConfig
getStat(int) - 类 中的方法com.jfinal.template.stat.ast.StatList
getStr(Object) - 类 中的方法com.jfinal.kit.Kv
getStr(Object) - 类 中的方法com.jfinal.kit.Okv
getStr() - 类 中的方法com.jfinal.template.expr.ast.Const
getSubFileName(String, String) - 类 中的静态方法com.jfinal.template.stat.ast.Include
获取在父模板之下子模板的最终文件名,子模板目录相对于父模板文件目录来确定
以 "/" 打头则以 baseTemplatePath 为根,否则以父文件所在路径为根
getTarget() - 类 中的方法com.jfinal.proxy.ProxyClass
是否需要代理
getTemplate(String) - 类 中的方法com.jfinal.template.Engine
Get template by file name
getTemplate(ISource) - 类 中的方法com.jfinal.template.Engine
Get template by implementation of ISource
getTemplateByString(String) - 类 中的方法com.jfinal.template.Engine
Get template by string content and do not cache the template
getTemplateByString(String, boolean) - 类 中的方法com.jfinal.template.Engine
Get template by string content
重要:StringSource 中的 cacheKey = HashKit.md5(content),也即 cacheKey
与 content 有紧密的对应关系,当 content 发生变化时 cacheKey 值也相应变化
因此,原先 cacheKey 所对应的 Template 缓存对象已无法被获取,当 getTemplateByString(String)
的 String 参数的数量不确定时会引发内存泄漏
当 getTemplateByString(String, boolean) 中的 String 参数的
数量可控并且确定时,才可对其使用缓存
getTemplateByString(String, String) - 类 中的方法com.jfinal.template.Engine
getTemplateCacheSize() - 类 中的方法com.jfinal.template.Engine
getTemplateFile() - 类 中的方法com.jfinal.template.stat.Location
getterMethod - 类 中的变量com.jfinal.template.expr.ast.FastFieldGetter
getterMethod - 类 中的变量com.jfinal.template.expr.ast.FieldGetters.GetterMethodFieldGetter
GetterMethodFieldGetter(Method) - 类 的构造器com.jfinal.template.expr.ast.FieldGetters.GetterMethodFieldGetter
getUpdate() - 类 中的方法com.jfinal.template.expr.ast.ForCtrl
getURLClassLoader() - 类 中的方法com.jfinal.proxy.ProxyCompiler
getValue() - 类 中的方法com.jfinal.template.expr.ast.Const
getValue(Object, String) - 接口 中的方法com.jfinal.template.expr.ast.FastFieldGetter.Proxy
getValue(String) - 类 中的方法com.jfinal.template.ext.spring.JFinalView.InnerSession
getValue() - 类 中的方法com.jfinal.template.stat.ast.ForEntry
getValueNames() - 类 中的方法com.jfinal.template.ext.spring.JFinalView.InnerSession
Id - com.jfinal.template.expr.ast 中的类
Id
Id(String) - 类 的构造器com.jfinal.template.expr.ast.Id
If - com.jfinal.template.stat.ast 中的类
If
If(ExprList, StatList, Location) - 类 的构造器com.jfinal.template.stat.ast.If
IncDec - com.jfinal.template.expr.ast 中的类
自增与自减
IncDec(Sym, boolean, Expr, Location) - 类 的构造器com.jfinal.template.expr.ast.IncDec
Include - com.jfinal.template.stat.ast 中的类
Include
1:父模板被缓存时,被 include 的模板会被间接缓存,无需关心缓存问题
2:同一个模板文件被多个父模板 include,所处的背景环境不同,例如各父模板中定义的模板函数不同
各父模板所处的相对路径不同,所以多个父模板不能共用一次 parse 出来的结果,而是在每个被include
的地方重新 parse
两种用法:
1:只传入一个参数,参数必须是 String 常量,如果希望第一个参数是变量可以使用 #render 指令去实现
#include("_hot.html")
2:传入任意多个参数,除第一个参数以外的所有参数必须是赋值表达式,用于实现参数传递功能
#include("_hot.html", title = "热门新闻", list = newsList)
上例中传递了 title、list 两个参数,可以代替父模板中的 #set 指令传参方式
并且此方式传入的参数只在子模板作用域有效,不会污染父模板作用域
这种传参方式有利于将子模板模块化,例如上例的调用改成如下的参数:
#include("_hot.html", title = "热门项目", list = projectList)
通过这种传参方式在子模板 _hot.html 之中,完全不需要修改对于 title 与 list
这两个变量的处理代码,就实现了对 “热门项目” 数据的渲染
Include(Env, ExprList, String, Location) - 类 的构造器com.jfinal.template.stat.ast.Include
Index - com.jfinal.template.expr.ast 中的类
index : expr '[' expr ']'
支持 a[i]、 a[b[i]]、a[i][j]、a[i][j]...
Index(Expr, Expr, Location) - 类 的构造器com.jfinal.template.expr.ast.Index
init(OutputStream) - 类 中的方法com.jfinal.template.io.ByteWriter
init(Writer) - 类 中的方法com.jfinal.template.io.CharWriter
init() - 类 中的方法com.jfinal.template.io.FastStringWriter
init(Map.Entry<Object, Object>) - 类 中的方法com.jfinal.template.stat.ast.ForEntry
initServletContext(ServletContext) - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
spring 回调,利用 ServletContext 做必要的初始化工作
InnerEvalDirective() - 类 的构造器com.jfinal.kit.ElKit.InnerEvalDirective
InnerSession(HttpSession) - 类 的构造器com.jfinal.template.ext.spring.JFinalView.InnerSession
INT - 类 中的静态变量com.jfinal.template.expr.ast.Arith
IntegerExt - com.jfinal.template.ext.extensionmethod 中的类
针对 java.lang.Integer 的扩展方法
重要用途:
Controller.keepPara() 方法会将所有类型的数据当成 String 并传回到
到模板中,所以模板中的如下代码将无法工作:
#if(age > 18)
....
IntegerExt() - 类 的构造器com.jfinal.template.ext.extensionmethod.IntegerExt
IntegerWriter - com.jfinal.template.io 中的类
IntegerWriter() - 类 的构造器com.jfinal.template.io.IntegerWriter
invalidate() - 类 中的方法com.jfinal.template.ext.spring.JFinalView.InnerSession
invoke(Object, Object...) - 类 中的方法com.jfinal.template.expr.ast.MethodInfo
invoke(Object, Object...) - 类 中的方法com.jfinal.template.expr.ast.MethodInfoExt
invoke(Object, Object...) - 类 中的方法com.jfinal.template.expr.ast.NullMethodInfo
invokeVarArgsMethod(Object, Object[]) - 类 中的方法com.jfinal.template.expr.ast.MethodInfo
isAfter(ChronoLocalDateTime<?>, ChronoLocalDateTime<?>) - 类 中的静态方法com.jfinal.kit.TimeKit
判断 A 的时间是否在 B 的时间 "之后"
isBefore(ChronoLocalDateTime<?>, ChronoLocalDateTime<?>) - 类 中的静态方法com.jfinal.kit.TimeKit
判断 A 的时间是否在 B 的时间 "之前"
isBlank(String) - 类 中的静态方法com.jfinal.kit.StrKit
字符串为 null 或者内部字符全部为 ' ' '\t' '\n' '\r' 这四类字符时返回 true
isBlank(char) - 类 中的静态方法com.jfinal.template.stat.CharTable
isBlankOrLineFeed(char) - 类 中的静态方法com.jfinal.template.stat.CharTable
isBoolean() - 类 中的方法com.jfinal.template.expr.ast.Const
isBreak() - 类 中的方法com.jfinal.template.stat.Ctrl
isContinue() - 类 中的方法com.jfinal.template.stat.Ctrl
isDevMode() - 类 中的方法com.jfinal.template.EngineConfig
isDevMode() - 类 中的方法com.jfinal.template.Env
isDigit(char) - 类 中的静态方法com.jfinal.template.stat.CharTable
isDouble() - 类 中的方法com.jfinal.template.expr.ast.Const
isEmpty() - 类 中的方法com.jfinal.kit.Prop
isEmpty(Object) - 类 中的方法com.jfinal.template.ext.sharedmethod.SharedMethodLib
判断 Collection、Map、数组、Iterator、Iterable 类型对象中的元素个数是否为 0
规则:
1:null 返回 true
2:List、Set 等一切继承自 Collection 的,返回 isEmpty()
3:Map 返回 isEmpty()
4:数组返回 length == 0
5:Iterator 返回 !
isEmpty() - 类 中的方法com.jfinal.template.stat.ast.Text
isEqual(ChronoLocalDateTime<?>, ChronoLocalDateTime<?>) - 类 中的静态方法com.jfinal.kit.TimeKit
判断 A 的时间是否与 B 的时间 "相同"
isExprChar(char) - 类 中的静态方法com.jfinal.template.stat.CharTable
isFalse(Object) - 类 中的方法com.jfinal.kit.Kv
key 存在,并且 value 为 false,则返回 true
isFalse(Object) - 类 中的方法com.jfinal.kit.Okv
key 存在,并且 value 为 false,则返回 true
isFalse() - 类 中的方法com.jfinal.template.expr.ast.Const
isFalse(Object) - 类 中的静态方法com.jfinal.template.expr.ast.Logic
isFloat() - 类 中的方法com.jfinal.template.expr.ast.Const
isForbiddenClass(Class<?>) - 类 中的静态方法com.jfinal.template.expr.ast.MethodKit
isForbiddenMethod(String) - 类 中的静态方法com.jfinal.template.expr.ast.MethodKit
isGlobalAssignment() - 类 中的方法com.jfinal.template.stat.Ctrl
isHexadecimalDigit(char) - 类 中的静态方法com.jfinal.template.stat.CharTable
isInJar - 类 中的变量com.jfinal.template.source.ClassPathSource
isInt() - 类 中的方法com.jfinal.template.expr.ast.Const
isInUse() - 类 中的方法com.jfinal.template.io.ByteWriter
isInUse() - 类 中的方法com.jfinal.template.io.CharWriter
isInUse() - 类 中的方法com.jfinal.template.io.FastStringWriter
isIterator() - 类 中的方法com.jfinal.template.expr.ast.ForCtrl
isJump() - 类 中的方法com.jfinal.template.stat.Ctrl
isLetter(char) - 类 中的静态方法com.jfinal.template.stat.CharTable
isLetterOrDigit(char) - 类 中的静态方法com.jfinal.template.stat.CharTable
isLocalAssignment() - 类 中的方法com.jfinal.template.stat.Ctrl
isLong() - 类 中的方法com.jfinal.template.expr.ast.Const
isMethod - 类 中的变量com.jfinal.template.expr.ast.FieldGetters.IsMethodFieldGetter
IsMethodFieldGetter() - 类 的构造器com.jfinal.template.expr.ast.FieldGetters.IsMethodFieldGetter
IsMethodFieldGetter(Method) - 类 的构造器com.jfinal.template.expr.ast.FieldGetters.IsMethodFieldGetter
isModified() - 类 中的方法com.jfinal.template.source.ClassPathSource
模板文件在 jar 包文件之内则不支持热加载
isModified() - 类 中的方法com.jfinal.template.source.FileSource
isModified() - 接口 中的方法com.jfinal.template.source.ISource
reload template if modified on devMode
isModified() - 类 中的方法com.jfinal.template.source.StringSource
isModified() - 类 中的方法com.jfinal.template.Template
isNew() - 类 中的方法com.jfinal.template.ext.spring.JFinalView.InnerSession
isNull(Object) - 类 中的方法com.jfinal.kit.Kv
key 不存在,或者 key 存在但 value 为null
isNull(Object) - 类 中的方法com.jfinal.kit.Okv
key 不存在,或者 key 存在但 value 为null
isNull() - 类 中的方法com.jfinal.template.expr.ast.Const
isNullSafe() - 类 中的方法com.jfinal.template.stat.Ctrl
isNumber() - 类 中的方法com.jfinal.template.expr.ast.Const
isOctalDigit(char) - 类 中的静态方法com.jfinal.template.stat.CharTable
ISource - com.jfinal.template.source 中的接口
ISource 用于表示模板内容的来源
ISourceFactory - com.jfinal.template.source 中的接口
ISourceFactory 用于为 engine 切换不同的 ISource 实现类
FileSourceFactory 用于从指定的目录中加载模板文件
ClassPathSourceFactory 用于从 class path 以及 jar 文件中加载模板文件
配置示例:
engine.setSourceFactory(new ClassPathSourceFactory());
isReturn() - 类 中的方法com.jfinal.template.stat.Ctrl
isSourceListModified() - 类 中的方法com.jfinal.template.Env
本方法用于在 devMode 之下,判断当前 Template 以及其下 #include 指令
所涉及的所有 ISource 对象是否被修改,以便于在 devMode 下重新加载
sourceList 属性用于存放主模板以及 #include 进来的模板所对应的
ISource 对象
isSourceModifiedForDevMode() - 类 中的方法com.jfinal.template.stat.ast.Define
isStatic() - 类 中的方法com.jfinal.template.expr.ast.MethodInfo
isStaticFieldExpressionEnabled() - 类 中的方法com.jfinal.template.EngineConfig
isStaticMethodExpressionEnabled() - 类 中的方法com.jfinal.template.EngineConfig
isStr() - 类 中的方法com.jfinal.template.expr.ast.Const
isTrue(Object) - 类 中的方法com.jfinal.kit.Kv
key 存在,并且 value 为 true,则返回 true
isTrue(Object) - 类 中的方法com.jfinal.kit.Okv
key 存在,并且 value 为 true,则返回 true
isTrue() - 类 中的方法com.jfinal.template.expr.ast.Const
isTrue(Object) - 类 中的静态方法com.jfinal.template.expr.ast.Logic
规则:
1:null 返回 false
2:boolean 类型,原值返回
3:String、StringBuilder 等一切继承自 CharSequence 类的对象,返回 length > 0
4:其它返回 true
isVarArgs - 类 中的变量com.jfinal.template.expr.ast.MethodInfo
isVarArgs() - 类 中的方法com.jfinal.template.expr.ast.MethodInfo
isWindows() - 类 中的方法com.jfinal.proxy.ProxyCompiler
isWisdomAssignment() - 类 中的方法com.jfinal.template.stat.Ctrl
IWritable - com.jfinal.template.io 中的接口
IWritable 支持 OutputStream、Writer 双模式动态切换输出
详见 com.jfinal.template.stat.ast.Text 中的用法
RandomDirective - com.jfinal.template.ext.directive 中的类
输出 int 型随机数
RandomDirective() - 类 的构造器com.jfinal.template.ext.directive.RandomDirective
RangeArray - com.jfinal.template.expr.ast 中的类
RangeArray : [expr .. expr]
用法:
1:[1..3]
2:[3..1]
RangeArray(Expr, Expr, Location) - 类 的构造器com.jfinal.template.expr.ast.RangeArray
array : '[' exprList ?
RangeArray.RangeList - com.jfinal.template.expr.ast 中的类
RangeList(int, int, Location) - 类 的构造器com.jfinal.template.expr.ast.RangeArray.RangeList
RealFieldGetter(Field) - 类 的构造器com.jfinal.template.expr.ast.FieldGetters.RealFieldGetter
ReflectKit - com.jfinal.kit 中的类
反射工具类
ReflectKit() - 类 的构造器com.jfinal.kit.ReflectKit
remove(Object) - 类 中的方法com.jfinal.kit.SyncWriteMap
remove(String) - 类 中的静态方法com.jfinal.template.Engine
Remove engine with engine name managed by JFinal
remove(Object) - 类 中的方法com.jfinal.template.stat.Scope
移除变量
自内向外在作用域栈中查找变量,移除最先找到的变量
removeAllTemplateCache() - 类 中的方法com.jfinal.template.Engine
Remove all template cache
removeAttribute(String) - 类 中的方法com.jfinal.template.ext.spring.JFinalView.InnerSession
removeDirective(String) - 类 中的方法com.jfinal.template.Engine
Remove directive
removeDirective(String) - 类 中的方法com.jfinal.template.EngineConfig
removeExtensionMethod(Class<?>, Object) - 类 中的静态方法com.jfinal.template.Engine
removeExtensionMethod(Class<?>, Class<?>) - 类 中的静态方法com.jfinal.template.Engine
removeExtensionMethod(Class<?>, Object) - 类 中的静态方法com.jfinal.template.expr.ast.MethodKit
removeExtensionMethod(Class<?>, Class<?>) - 类 中的静态方法com.jfinal.template.expr.ast.MethodKit
removeFieldGetter(Class<? extends FieldGetter>) - 类 中的静态方法com.jfinal.template.Engine
removeFieldGetter(Class<? extends FieldGetter>) - 类 中的静态方法com.jfinal.template.expr.ast.FieldKit
removeForbiddenClass(Class<?>) - 类 中的静态方法com.jfinal.template.expr.ast.MethodKit
removeForbiddenMethod(String) - 类 中的静态方法com.jfinal.template.expr.ast.MethodKit
removeGlobal(Object) - 类 中的方法com.jfinal.template.stat.Scope
移除全局变量
全局作用域是指本次请求的整个 template
removeKeyword(String) - 类 中的方法com.jfinal.kit.JavaKeyword
removeLocal(Object) - 类 中的方法com.jfinal.template.stat.Scope
移除局部变量
removeSharedMethod(String) - 类 中的方法com.jfinal.template.Engine
Remove shared Method by method name
removeSharedMethod(Class<?>) - 类 中的方法com.jfinal.template.Engine
Remove shared Method of the Class
removeSharedMethod(Method) - 类 中的方法com.jfinal.template.Engine
Remove shared Method
removeSharedMethod(String, Class<?>...) - 类 中的方法com.jfinal.template.Engine
Remove shared Method
removeSharedMethod(String) - 类 中的方法com.jfinal.template.EngineConfig
Remove shared Method with method name
removeSharedMethod(Class<?>) - 类 中的方法com.jfinal.template.EngineConfig
Remove shared Method of the Class
removeSharedMethod(Method) - 类 中的方法com.jfinal.template.EngineConfig
Remove shared Method
removeSharedMethod(String, Class<?>...) - 类 中的方法com.jfinal.template.EngineConfig
Remove shared Method
removeSharedMethod(String) - 类 中的方法com.jfinal.template.expr.ast.SharedMethodKit
removeSharedMethod(Class<?>) - 类 中的方法com.jfinal.template.expr.ast.SharedMethodKit
removeSharedMethod(Method) - 类 中的方法com.jfinal.template.expr.ast.SharedMethodKit
removeSharedMethod(String, Class<?>...) - 类 中的方法com.jfinal.template.expr.ast.SharedMethodKit
removeSharedObject(String) - 类 中的方法com.jfinal.template.Engine
removeSharedObject(String) - 类 中的方法com.jfinal.template.EngineConfig
removeTemplateCache(String) - 类 中的方法com.jfinal.template.Engine
Remove template cache by cache key
removeValue(String) - 类 中的方法com.jfinal.template.ext.spring.JFinalView.InnerSession
render(Map<?, ?>, OutputStream) - 类 中的方法com.jfinal.template.Template
渲染到 OutputStream 中去
render(OutputStream) - 类 中的方法com.jfinal.template.Template
支持无 data 参数,渲染到 OutputStream 中去
适用于数据在模板中通过表达式和语句直接计算得出等等应用场景
render(Map<?, ?>, Writer) - 类 中的方法com.jfinal.template.Template
渲染到 Writer 中去
render(Writer) - 类 中的方法com.jfinal.template.Template
支持无 data 参数,渲染到 Writer 中去
适用于数据在模板中通过表达式和语句直接计算得出等等应用场景
render(Map<?, ?>, File) - 类 中的方法com.jfinal.template.Template
渲染到 File 中去
适用于代码生成器类似应用场景
render(Map<?, ?>, String) - 类 中的方法com.jfinal.template.Template
渲染到 String fileName 参数所指定的文件中去
适用于代码生成器类似应用场景
render(Map<?, ?>, OutputStream, Template.Func<ByteWriter>) - 类 中的方法com.jfinal.template.Template
渲染到 OutputStream 中去
render(Map<?, ?>, Writer, Template.Func<CharWriter>) - 类 中的方法com.jfinal.template.Template
渲染到 Writer 中去
render(Map<?, ?>, File, Template.Func<ByteWriter>) - 类 中的方法com.jfinal.template.Template
渲染到 File 中去
适用于代码生成器类似应用场景
render(Map<?, ?>, OutputStream, boolean) - 类 中的方法com.jfinal.template.Template
渲染到 OutputStream 中去,autoCloseOutputStream 指定是否自动关闭 OutputStream
render(Map<?, ?>, Writer, boolean) - 类 中的方法com.jfinal.template.Template
渲染到 Writer 中去,autoCloseWriter 指定是否自动关闭 Writer
RenderDirective - com.jfinal.template.ext.directive 中的类
#render 指令用于动态渲染子模板,作为 include 指令的补充
两种用法:
1:只传入一个参数,参数可以是 String 常量,也可以是任意表达式
#render("_hot.html")
#render(subFile)
2:传入任意多个参数,除第一个参数以外的所有参数必须是赋值表达式,用于实现参数传递功能
#render("_hot.html", title = "热门新闻", list = newsList)
上例中传递了 title、list 两个参数,可以代替父模板中的 #set 指令传参方式
并且此方式传入的参数只在子模板作用域有效,不会污染父模板作用域
这种传参方式有利于将子模板模块化,例如上例的调用改成如下的参数:
#render("_hot.html", title = "热门项目", list = projectList)
通过这种传参方式在子模板 _hot.html 之中,完全不需要修改对于 title 与 list
这两个变量的处理代码,就实现了对 “热门项目” 数据的渲染
RenderDirective() - 类 的构造器com.jfinal.template.ext.directive.RenderDirective
RenderDirective.SubEnv - com.jfinal.template.ext.directive 中的类
SubEnv 用于将子模板与父模板中的模板函数隔离开来,
否则在子模板被修改并被重新解析时会再次添加子模板中的
模板函数,从而抛出异常
SubEnv 也可以使子模板中定义的模板函数不与上层产生冲突,
有利于动态型模板渲染的模块化
注意: #render 子模板中定义的模板函数无法在父模板中调用
RenderDirective.SubStat - com.jfinal.template.ext.directive 中的类
renderMergedTemplateModel(Map<String, Object>, HttpServletRequest, HttpServletResponse) - 类 中的方法com.jfinal.template.ext.spring.JFinalView
renderToString(Map<?, ?>) - 类 中的方法com.jfinal.template.Template
渲染到 String 中去
renderToString() - 类 中的方法com.jfinal.template.Template
支持无 data 参数,渲染到 String 中去
适用于数据在模板中通过表达式和语句直接计算得出等等应用场景
renderToString(Map<?, ?>, Template.Func<CharWriter>) - 类 中的方法com.jfinal.template.Template
渲染到 String 中去
Func 接口用于接管内部的 Stat ast、Env env、Scope scope 变量,并且便于
向 Ctrl 传入 attachment 参数
例子:
Map data = new HashMap<>();
data.put("key", 123);
String ret = template.renderToString(data, (ast, env, scope, writer) -> {
// 可以传入任意类型的 attachment 参数,以下以 Kv 对象为例
// 该参数可以在指令中通过 scope.getCtrl().getAttachment() 获取
scope.getCtrl().setAttachment(Kv.of("key", 456));
// 接管内部的 ast、env、scope、writer,执行 ast.exec(...)
renderToStringBuilder(Map<?, ?>) - 类 中的方法com.jfinal.template.Template
渲染到 StringBuilder 中去
replace(K, V, V) - 类 中的方法com.jfinal.kit.SyncWriteMap
replace(K, V) - 类 中的方法com.jfinal.kit.SyncWriteMap
replaceAll(BiFunction<? super K, ? super V, ? extends V>) - 类 中的方法com.jfinal.kit.SyncWriteMap
requiredViewClass() - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
Return - com.jfinal.template.stat.ast 中的类
Return
通常用于 #define 指令内部,不支持返回值
ReturnIf - com.jfinal.template.stat.ast 中的类
#returnIf(expr) 指令,当 expr 为 true 时返回,等价于:
#if (expr)
#return
#end
ReturnIf(ExprList, Location) - 类 的构造器com.jfinal.template.stat.ast.ReturnIf
Scope - com.jfinal.template.stat 中的类
Scope
1:顶层 scope.parent 为 null
2:scope.set(...)
Scope(Map, Map<String, Object>) - 类 的构造器com.jfinal.template.stat.Scope
构建顶层 Scope, parent 为 null 是顶层 Scope 的标志
Scope(Scope) - 类 的构造器com.jfinal.template.stat.Scope
构建 AST 执行过程中作用域栈
separator - 类 中的变量com.jfinal.template.stat.Compressor
set(Object, Object) - 类 中的方法com.jfinal.kit.Kv
set(Map) - 类 中的方法com.jfinal.kit.Kv
set(Kv) - 类 中的方法com.jfinal.kit.Kv
set(Object, Object) - 类 中的方法com.jfinal.kit.Okv
set(Map) - 类 中的方法com.jfinal.kit.Okv
set(Okv) - 类 中的方法com.jfinal.kit.Okv
Set - com.jfinal.template.stat.ast 中的类
Set 赋值,从内向外作用域查找变量,找到则替换变量值,否则在顶层作用域赋值
用法:
1:#set(k = v)
2:#set(k1 = v1, k2 = v2, ..., kn = vn)
3:#set(x = 1+2)
4:#set(x = 1+2, y = 3>4, ..., z = c ?
Set(ExprList, Location) - 类 的构造器com.jfinal.template.stat.ast.Set
set(Object, Object) - 类 中的方法com.jfinal.template.stat.Scope
设置变量
自内向外在作用域栈中查找变量,如果找到则改写变量值,否则将变量存放到顶层 Scope
setAttachment(Object) - 类 中的方法com.jfinal.template.stat.Ctrl
setAttribute(String, Object) - 类 中的方法com.jfinal.template.ext.spring.JFinalView.InnerSession
setBaseTemplatePath(String) - 类 中的方法com.jfinal.template.Engine
setBaseTemplatePath(String) - 类 中的方法com.jfinal.template.EngineConfig
setBaseTemplatePath(String) - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
设置模板基础路径
setBigDecimalDivideMinScale(int) - 类 中的静态方法com.jfinal.template.expr.ast.Arith
设置 BigDecimal 除法使用的最小 scale 值,默认为 5
setBigDecimalDivideRoundingMode(RoundingMode) - 类 中的静态方法com.jfinal.template.expr.ast.Arith
设置 BigDecimal 除法使用的舍入模式,默认为四舍五入
setBreak() - 类 中的方法com.jfinal.template.stat.Ctrl
setBufferSize(int) - 类 中的方法com.jfinal.template.Engine
setBufferSize(int) - 类 中的方法com.jfinal.template.EngineConfig
setBufferSize(int) - 类 中的方法com.jfinal.template.io.WriterBuffer
setByteCode(Map<String, byte[]>) - 类 中的方法com.jfinal.proxy.ProxyClass
setCacheStringTemplate(boolean) - 类 中的方法com.jfinal.template.Engine
配置是否缓存字符串模板,也即是否缓存通过 getTemplateByString(String content)
方法获取的模板,默认配置为 false
setChineseExpression(boolean) - 类 中的静态方法com.jfinal.template.Engine
设置为 true 支持表达式、变量名、方法名、模板函数名使用中文
setChineseExpression(boolean) - 类 中的静态方法com.jfinal.template.stat.CharTable
设置为 true 支持表达式、变量名、方法名、模板函数名使用中文
setClazz(Class<?>) - 类 中的方法com.jfinal.proxy.ProxyClass
setCompileOptions(List<String>) - 类 中的方法com.jfinal.proxy.ProxyCompiler
setCompressor(Compressor) - 类 中的方法com.jfinal.template.Engine
配置 Compressor 可对模板中的静态内容进行压缩
可通过该方法配置自定义的 Compressor 来代替系统默认实现,例如:
engine.setCompressor(new MyCompressor());
setCompressor(Compressor) - 类 中的方法com.jfinal.template.EngineConfig
setCompressorOn(char) - 类 中的方法com.jfinal.template.Engine
设置开启压缩功能
setCompressorOn() - 类 中的方法com.jfinal.template.Engine
设置开启压缩功能。
setContinue() - 类 中的方法com.jfinal.template.stat.Ctrl
setCreateSession(boolean) - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
在使用 request.getSession(createSession) 时传入
用来指示 session 不存在时是否立即创建
setData(Map) - 类 中的方法com.jfinal.template.stat.Scope
设置/替换本层作用域 data,通常用于在扩展指令中使用现成可用的 Map 来存放数据,
从而避免 Scope 内部创建 data,节省时空
注意:本方法会替换掉已经存在的 data 对象
setDatePattern(String) - 类 中的方法com.jfinal.template.Engine
setDatePattern(String) - 类 中的方法com.jfinal.template.EngineConfig
setDatePattern(String) - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
设置 #date(...)
setDefault(Default, Location) - 类 中的方法com.jfinal.template.stat.ast.Switch
setDevMode(boolean) - 类 中的方法com.jfinal.template.Engine
设置 true 为开发模式,支持模板文件热加载
设置 false 为生产模式,不支持模板文件热加载,以达到更高的性能
setDevMode(boolean) - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
设置开发模式,值为 true 时支持模板文件热加载
setEncoderFactory(EncoderFactory) - 类 中的方法com.jfinal.template.Engine
Enjoy 模板引擎对 UTF-8 的 encoding 做过性能优化,某些罕见字符
无法被编码,可以配置为 JdkEncoderFactory 解决问题:
engine.setEncoderFactory(new JdkEncoderFactory());
setEncoderFactory(EncoderFactory) - 类 中的方法com.jfinal.template.EngineConfig
setEncoderFactory(EncoderFactory) - 类 中的方法com.jfinal.template.io.WriterBuffer
setEncoding(String) - 类 中的方法com.jfinal.template.Engine
setEncoding(String) - 类 中的方法com.jfinal.template.EngineConfig
setEncoding(String) - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
设置 encoding
setEncoding(String) - 类 中的方法com.jfinal.template.io.WriterBuffer
setEnvForDevMode(Env) - 类 中的方法com.jfinal.template.stat.ast.Define
setEnvKey(String) - 类 中的静态方法com.jfinal.kit.PropKit
设置环境 key,PropKit 将通过该 key 获取环境 value。
setExprList(ExprList) - 类 中的方法com.jfinal.template.Directive
指令被解析时注入指令参数表达式列表,继承类可以通过覆盖此方法对参数长度和参数类型进行校验
setExprList(ExprList) - 类 中的方法com.jfinal.template.ext.directive.CallDirective
setExprList(ExprList) - 类 中的方法com.jfinal.template.ext.directive.DateDirective
setExprList(ExprList) - 类 中的方法com.jfinal.template.ext.directive.NowDirective
setExprList(ExprList) - 类 中的方法com.jfinal.template.ext.directive.NumberDirective
setExprList(ExprList) - 类 中的方法com.jfinal.template.ext.directive.RenderDirective
setExprList(ExprList) - 类 中的方法com.jfinal.template.ext.directive.StringDirective
setExprList(ExprList) - 类 中的方法com.jfinal.template.stat.ast.Stat
setFastFieldKeyBuilder(boolean) - 类 中的静态方法com.jfinal.template.Engine
setFastFieldKeyBuilder(boolean) - 类 中的静态方法com.jfinal.template.expr.ast.FieldKeyBuilder
开启 FastFieldKeyBuilder,性能更高
setFastMode(boolean) - 类 中的静态方法com.jfinal.template.Engine
设置极速模式
极速模式将生成代理对象来消除 java.lang.reflect.Method.invoke(...)
setFastMode(boolean) - 类 中的静态方法com.jfinal.template.expr.ast.FieldKit
设置极速模式
极速模式将生成代理对象来消除 java.lang.reflect.Method.invoke(...)
setFieldKeyBuilder(FieldKeyBuilder) - 类 中的静态方法com.jfinal.template.expr.ast.FieldKeyBuilder
设置为自定义 FieldKeyBuilder
SetGlobal - com.jfinal.template.stat.ast 中的类
SetGlobal 设置全局变量,全局作用域是指本次请求的整个 template
适用于极少数的在内层作用域中希望直接操作顶层作用域的场景
SetGlobal(ExprList, Location) - 类 的构造器com.jfinal.template.stat.ast.SetGlobal
setGlobal(Object, Object) - 类 中的方法com.jfinal.template.stat.Scope
设置全局变量
全局作用域是指本次请求的整个 template
setGlobalAssignment() - 类 中的方法com.jfinal.template.stat.Ctrl
setIfNotBlank(Object, String) - 类 中的方法com.jfinal.kit.Kv
setIfNotBlank(Object, String) - 类 中的方法com.jfinal.kit.Okv
setIfNotNull(Object, Object) - 类 中的方法com.jfinal.kit.Kv
setIfNotNull(Object, Object) - 类 中的方法com.jfinal.kit.Okv
setJumpNone() - 类 中的方法com.jfinal.template.stat.Ctrl
setKeepLineBlank(String, boolean) - 类 中的方法com.jfinal.template.EngineConfig
SetLocal - com.jfinal.template.stat.ast 中的类
SetLocal 设置局部变量
通常用于 #define #include 指令内部需要与外层作用域区分,以便于定义重用型模块的场景
也常用于 #for 循环内部的临时变量
SetLocal(ExprList, Location) - 类 的构造器com.jfinal.template.stat.ast.SetLocal
setLocal(Object, Object) - 类 中的方法com.jfinal.template.stat.Scope
设置局部变量
setLocalAssignment() - 类 中的方法com.jfinal.template.stat.Ctrl
setLocation(Location) - 类 中的方法com.jfinal.template.stat.ast.Stat
setMainEngine(Engine) - 类 中的静态方法com.jfinal.template.Engine
Set main engine
setMaxBufferSize(int) - 类 中的静态方法com.jfinal.template.io.FastStringWriter
setMaxInactiveInterval(int) - 类 中的方法com.jfinal.template.ext.spring.JFinalView.InnerSession
setMethodKeyBuilder(MethodKeyBuilder) - 类 中的静态方法com.jfinal.template.expr.ast.MethodKeyBuilder
切换到用户自定义 MethodKeyBuilder
setNextCase(Case) - 类 中的方法com.jfinal.template.stat.ast.Case
setNextCase(Case) - 接口 中的方法com.jfinal.template.stat.ast.CaseSetter
setNextCase(Case) - 类 中的方法com.jfinal.template.stat.ast.Switch
setNullSafe(boolean) - 类 中的方法com.jfinal.template.stat.Ctrl
setOutputCompileError(boolean) - 类 中的静态方法com.jfinal.template.expr.ast.FastFieldGetter
setOutputDirectiveFactory(OutputDirectiveFactory) - 类 中的方法com.jfinal.template.Engine
Set output directive factory
setOutputDirectiveFactory(OutputDirectiveFactory) - 类 中的方法com.jfinal.template.EngineConfig
Set output directive factory
setReentrantBufferSize(int) - 类 中的方法com.jfinal.template.Engine
setReentrantBufferSize(int) - 类 中的方法com.jfinal.template.EngineConfig
setReentrantBufferSize(int) - 类 中的方法com.jfinal.template.io.WriterBuffer
setReloadModifiedSharedFunctionInDevMode(boolean) - 类 中的方法com.jfinal.template.Engine
Engine 独立设置为 devMode 可以方便模板文件在修改后立即生效,
但如果在 devMode 之下并不希望对 addSharedFunction(...),
添加的模板进行是否被修改的检测可以通过此方法设置 false 参进去
注意:Engine 在生产环境下(devMode 为 false),该参数无效
setReloadModifiedSharedFunctionInDevMode(boolean) - 类 中的方法com.jfinal.template.EngineConfig
setReturn() - 类 中的方法com.jfinal.template.stat.Ctrl
setRootData(Map) - 类 中的方法com.jfinal.template.stat.Scope
设置/替换顶层作用域 data,可以在扩展指令之中通过此方法切换掉顶层作用域
实现作用域完全隔离的功能
注意:本方法会替换掉顶层已经存在的 data 对象
setRoundingMode(RoundingMode) - 类 中的方法com.jfinal.template.Engine
设置 #number 指令与 Arith 中浮点数的舍入规则,默认为 RoundingMode.HALF_UP "四舍五入"
setRoundingMode(RoundingMode) - 类 中的方法com.jfinal.template.EngineConfig
设置 #number 指令与 Arith 中浮点数的舍入规则,默认为 RoundingMode.HALF_UP "四舍五入"
setSessionInView(boolean) - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
设置为 true 时支持在模板中使用 #(session.value) 形式访问 session 中的数据
setSharedFunction(String) - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
设置 shared function 文件,多个文件用逗号分隔
主要用于 Spring MVC 的 xml 配置方式
Spring Boot 的代码配置方式可使用 addSharedFunction(...)
setSharedFunctionList(List<String>) - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
通过 List 配置多个 shared function file
配置示例:
_layout.html
_paginate.html
setSourceCode(String) - 类 中的方法com.jfinal.proxy.ProxyClass
setSourceFactory(ISourceFactory) - 类 中的方法com.jfinal.template.Engine
设置 ISourceFactory 用于为 engine 切换不同的 ISource 实现类
ISource 用于从不同的来源加载模板内容
配置为 ClassPathSourceFactory 时特别注意:
由于 JFinal 会在 configEngine(Engine me) 方法调用 “之前”,会默认调用一次如下方法:
me.setBaseTemplatePath(PathKit.getWebRootPath())
而 ClassPathSourceFactory 在以上默认值下不能工作,所以需要通过如下方式清掉该值:
me.setBaseTemplatePath(null)
或者配置具体要用的 baseTemplatePath 值,例如:
me.setBaseTemplatePath("view");
setSourceFactory(ISourceFactory) - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
设置 ISourceFactory 用于为 engine 切换不同的 ISource 实现类
配置为 ClassPathSourceFactory 时特别注意:
由于在 initServletContext() 通过如下方法中已设置了 baseTemplatePath 值:
setBaseTemplatePath(servletContext.getRealPath("/"))
而 ClassPathSourceFactory 在 initServletContext() 方法中设置的
值之下不能工作,所以在本方法中通过如下方法清掉了该值:
setBaseTemplatePath(null)
这种处理方式适用于绝大部分场景,如果在使用 ClassPathSourceFactory 的同时
仍然需要设置 baseTemplatePath,则在调用该方法 “之后” 通过如下代码再次配置:
setBaseTemplatePath(value)
setStat(Stat) - 类 中的方法com.jfinal.template.Directive
指令被解析时注入指令 body 内容,仅对于具有 #end 结束符的指令有效
setStat(Stat) - 类 中的方法com.jfinal.template.stat.ast.ElseIf
take over setStat(...) method of super class
setStat(Stat) - 类 中的方法com.jfinal.template.stat.ast.If
take over setStat(...) method of super class
setStat(Stat) - 类 中的方法com.jfinal.template.stat.ast.Stat
setStaticFieldExpression(boolean) - 类 中的方法com.jfinal.template.Engine
设置为 true 支持静态属性访问表达式,自 jfinal 5.0.2 版本开始默认值为 false
setStaticFieldExpression(boolean) - 类 中的方法com.jfinal.template.EngineConfig
设置为 true 支持静态属性访问表达式,自 jfinal 5.0.2 版本开始默认值为 false
setStaticMethodExpression(boolean) - 类 中的方法com.jfinal.template.Engine
设置为 true 支持静态方法调用表达式,自 jfinal 5.0.2 版本开始默认值为 false
setStaticMethodExpression(boolean) - 类 中的方法com.jfinal.template.EngineConfig
设置为 true 支持静态方法调用表达式,自 jfinal 5.0.2 版本开始默认值为 false
setToClassPathSourceFactory() - 类 中的方法com.jfinal.template.Engine
设置为 ClassPathSourceFactory 的快捷方法
setToClassPathSourceFactory() - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
设置为 ClassPathSourceFactory 的快捷方法
ClassPathSourceFactory 将从 CLASSPATH 与 jar 包中读取模板
setToJdkEncoderFactory() - 类 中的方法com.jfinal.template.Engine
配置为 JdkEncoderFactory,支持 utf8mb4,支持 emoji 表情字符,
支持各种罕见字符编码
setToStrictMethodKeyBuilder() - 类 中的静态方法com.jfinal.template.expr.ast.MethodKeyBuilder
切换到 StrictMethodKeyBuilder
特别注意:
如果希望将 configEngine(Engine me) 中的 Engine 切换到 StrictMethodKeyBuilder,
需要在 YourJFinalConfig extends JFinalConfig 中利用如下代码块才能生效:
static {
MethodKeyBuilder.setToStrictMethodKeyBuilder();
}
原因是在 com.jfinal.core.Config 中 new Engine() 时 setToStrictMethodKeyBuilder()
方法并未生效,所以 extension method 生成 method key 时仍然使用的是 FastMethodKeyBuilder
以至于在运行时,使用 StrictMethodKeyBuilder 生成的 key 找不到 extension method
后续版本考虑在调用 setToStrictMethodKeyBuilder() 以后重新初始化一下 MethodKit 中的变量
原先的 static 初始化方式重构出 synchronized void init() 方法来方便调用
setValue(Object) - 类 中的方法com.jfinal.template.stat.ast.ForEntry
setWisdomAssignment() - 类 中的方法com.jfinal.template.stat.Ctrl
setWriterBuffer(WriterBuffer) - 类 中的方法com.jfinal.template.EngineConfig
配置自己的 WriterBuffer 实现,配置方法:
engine.getEngineConfig().setWriterBuffer(
sha1(String) - 类 中的静态方法com.jfinal.kit.HashKit
sha256(String) - 类 中的静态方法com.jfinal.kit.HashKit
sha384(String) - 类 中的静态方法com.jfinal.kit.HashKit
sha512(String) - 类 中的静态方法com.jfinal.kit.HashKit
SharedMethod - com.jfinal.template.expr.ast 中的类
SharedMethod
用法:
engine.addSharedMethod(new StrKit());
engine.addSharedStaticMethod(MyKit.class);
#if (notBlank(para))
....
SharedMethod(SharedMethodKit, String, ExprList, Location) - 类 的构造器com.jfinal.template.expr.ast.SharedMethod
SharedMethodKit - com.jfinal.template.expr.ast 中的类
SharedMethodKit
SharedMethodKit() - 类 的构造器com.jfinal.template.expr.ast.SharedMethodKit
SharedMethodLib - com.jfinal.template.ext.sharedmethod 中的类
SharedMethodLib 共享方法库,逐步添加一些最常用的共享方法
3.3 版本之前的 Logic.isTrue(Object) 方法不再对 Collection、
Map、数组、Iterator、Iterable 进行为空的判断,这部分逻辑已转移至
SharedMethodLib.isEmpty(Object)
SharedMethodLib() - 类 的构造器com.jfinal.template.ext.sharedmethod.SharedMethodLib
ShortExt - com.jfinal.template.ext.extensionmethod 中的类
针对 java.lang.Short 的扩展方法
用法:
#if(value.toInt() == 123)
ShortExt() - 类 的构造器com.jfinal.template.ext.extensionmethod.ShortExt
size() - 类 中的方法com.jfinal.template.expr.ast.RangeArray.RangeList
slowEquals(byte[], byte[]) - 类 中的静态方法com.jfinal.kit.HashKit
slowEquals(String, String) - 类 中的静态方法com.jfinal.kit.StrKit
source - 类 中的变量com.jfinal.template.ext.directive.RenderDirective.SubStat
sourceList - 类 中的变量com.jfinal.template.Env
stat - 类 中的变量com.jfinal.template.Directive
具有 #end 结束符的指令内部嵌套的所有内容,调用 stat.exec(env, scope, writer)
即可执行指令内部嵌入所有指令与表达式,如果指令没有 #end 结束符,该属性无效
stat - 类 中的变量com.jfinal.template.ext.directive.RenderDirective.SubStat
Stat - com.jfinal.template.stat.ast 中的类
Stat
Stat() - 类 的构造器com.jfinal.template.stat.ast.Stat
StaticField - com.jfinal.template.expr.ast 中的类
StaticField : ID_list '::' ID
动态获取静态变量值,变量值改变时仍可正确获取
用法:com.jfinal.core.Const::JFINAL_VERSION
StaticField(String, String, Location) - 类 的构造器com.jfinal.template.expr.ast.StaticField
StaticMethod - com.jfinal.template.expr.ast 中的类
StaticMethod : ID_list : '::' ID '(' exprList?
StaticMethod(String, String, Location) - 类 的构造器com.jfinal.template.expr.ast.StaticMethod
StaticMethod(String, String, ExprList, Location) - 类 的构造器com.jfinal.template.expr.ast.StaticMethod
StatList - com.jfinal.template.stat.ast 中的类
StatList
StatList(List<Stat>) - 类 的构造器com.jfinal.template.stat.ast.StatList
StrictFieldKeyBuilder() - 类 的构造器com.jfinal.template.expr.ast.FieldKeyBuilder.StrictFieldKeyBuilder
StrictMethodKeyBuilder() - 类 的构造器com.jfinal.template.expr.ast.MethodKeyBuilder.StrictMethodKeyBuilder
StringDirective - com.jfinal.template.ext.directive 中的类
#string 指令方便定义大量的多行文本变量,这个是 java 语言中极为需要的功能
定义:
#string(name)
在此是大量的字符串
#end
使用:
#(name)
StringDirective() - 类 的构造器com.jfinal.template.ext.directive.StringDirective
StringExt - com.jfinal.template.ext.extensionmethod 中的类
针对 java.lang.String 的扩展方法
重要用途:
Controller.keepPara() 方法会将所有类型的数据当成 String 并传回到
到模板中,所以模板中的如下代码将无法工作:
#if(age > 18)
....
StringExt() - 类 的构造器com.jfinal.template.ext.extensionmethod.StringExt
StringSource - com.jfinal.template.source 中的类
StringSource 用于从 String 变量中加载模板内容
StringSource(String, boolean) - 类 的构造器com.jfinal.template.source.StringSource
构造 StringSource
StringSource(String, String) - 类 的构造器com.jfinal.template.source.StringSource
构造 StringSource
StringSource(StringBuilder, boolean) - 类 的构造器com.jfinal.template.source.StringSource
StringSource(StringBuilder, String) - 类 的构造器com.jfinal.template.source.StringSource
StrKit - com.jfinal.kit 中的类
StrKit.
StrKit() - 类 的构造器com.jfinal.kit.StrKit
SubEnv(Env) - 类 的构造器com.jfinal.template.ext.directive.RenderDirective.SubEnv
SubStat(RenderDirective.SubEnv, Stat, ISource) - 类 的构造器com.jfinal.template.ext.directive.RenderDirective.SubStat
Switch - com.jfinal.template.stat.ast 中的类
Switch
#switch 指令与 Java 12 switch 新特性的设计相似: http://openjdk.java.net/jeps/325
在与 java 老版本指令基本用法相同的基础上,主要变化与特性有:
1: 移除 java 语法中的 fall-through semantics,即不需要 break 关键字进行断开
2: 不引入 #break 指令,代码更少、更优雅
3: #case 参数可使用多个用逗号分隔的表达式,每个表达式求值后与 #switch 参数求值后比较,
从根本上消除了 #break 指令的必要性
4: #case 支持任意类型数据与表达式(java 语言只支持少数常量类型)
示例:
#switch (month)
#case (1, 3, 5, 7, 8, 10, 12)
#(month) 月有 31 天
#case (2)
#(month) 月平年有28天,闰年有29天
#default
月份错误: #(month ??
Switch(ExprList, Location) - 类 的构造器com.jfinal.template.stat.ast.Switch
Sym - com.jfinal.template.expr 中的枚举
Sym
SyncWriteMap <K ,V > - com.jfinal.kit 中的类
SyncWriteMap 同步写 HashMap
创建原因是 HashMap扩容时,遇到并发修改可能造成 100% CPU 占用
SyncWriteMap 拥有 HashMap 的性能,但不保障并发访问的线程安全
只用于读多写少且不用保障线程安全的场景
例如 MethodKit 中用于缓存 MethodInfo 的 cache,被写入的数据
不用保障是单例,读取之后会做 null 值判断
ActionMapping 中的 HashMap 是系统启动时在独立线程内初始化的,
不存在并发写,只存在并发读的情况,所以仍然可以使用 HashMap
SyncWriteMap() - 类 的构造器com.jfinal.kit.SyncWriteMap
SyncWriteMap(int) - 类 的构造器com.jfinal.kit.SyncWriteMap
SyncWriteMap(int, float) - 类 的构造器com.jfinal.kit.SyncWriteMap
SyncWriteMap(Map<? extends K, ? extends V>) - 类 的构造器com.jfinal.kit.SyncWriteMap
takeOver(Class<?>, String) - 类 中的方法com.jfinal.template.expr.ast.FastFieldGetter
takeOver(Class<?>, String) - 类 中的方法com.jfinal.template.expr.ast.FieldGetter
接管 target.fieldName 表达式,如果可以接管则返回接管对象,否则返回 null
takeOver(Class<?>, String) - 类 中的方法com.jfinal.template.expr.ast.FieldGetters.ArrayLengthGetter
takeOver(Class<?>, String) - 类 中的方法com.jfinal.template.expr.ast.FieldGetters.GetterMethodFieldGetter
takeOver(Class<?>, String) - 类 中的方法com.jfinal.template.expr.ast.FieldGetters.IsMethodFieldGetter
takeOver(Class<?>, String) - 类 中的方法com.jfinal.template.expr.ast.FieldGetters.MapFieldGetter
takeOver(Class<?>, String) - 类 中的方法com.jfinal.template.expr.ast.FieldGetters.NullFieldGetter
takeOver(Class<?>, String) - 类 中的方法com.jfinal.template.expr.ast.FieldGetters.RealFieldGetter
Template - com.jfinal.template 中的类
Template
用法:
Template template = Engine.use().getTemplate(...);
template.render(data, writer);
template.renderToString(data);
Template(Env, Stat) - 类 的构造器com.jfinal.template.Template
Template.Func <T > - com.jfinal.template 中的接口
Func 接口用于接管内部的 Stat ast、Env env、Scope scope 变量
实现更加灵活、强大的功能
TemplateException - com.jfinal.template 中的异常错误
Template runtime exception
TemplateException(String, Location) - 异常错误 的构造器com.jfinal.template.TemplateException
TemplateException(String, Location, Throwable) - 异常错误 的构造器com.jfinal.template.TemplateException
Ternary - com.jfinal.template.expr.ast 中的类
Ternary
Ternary(Expr, Expr, Expr, Location) - 类 的构造器com.jfinal.template.expr.ast.Ternary
cond ?
Text - com.jfinal.template.stat.ast 中的类
Text 输出纯文本块以及使用 "#[[" 与 "]]#" 定义的原样输出块
Text(StringBuilder, EngineConfig) - 类 的构造器com.jfinal.template.stat.ast.Text
TimeKit - com.jfinal.kit 中的类
TimeKit 用于简化 JDK 8 新增的时间 API
新旧日期转换通过桥梁 Instant 进行,转成 LocalDate、LocalTime 需要先转成 LocalDateTime:
新转旧:LocalDateTime.atZone(ZoneId).toInstant() -> Instant -> Date.from(Instant)
旧转新:Date.toInstant() -> Instant -> LocalDateTime.ofInstant(Instant, ZoneId)
经测试,SimpleDateFormat 比 DateTimeFormatter 对 pattern 的支持更好
对于同样的 pattern 值 "yyyy-MM-dd HH:mm:ss",前者可以转换 "2020-06-9 12:13:19"
后者却不支持,原因是 pattern 的 dd 位置只有数字 9,必须要是两位数字才能支持
所以:建议优先使用转换结果为 Date 的 parse 方法,使用 SimpleDateFormat 来转换
TimeKit() - 类 的构造器com.jfinal.kit.TimeKit
toBigDecimal(Object) - 类 中的静态方法com.jfinal.kit.TypeKit
toBigDecimal(BigDecimal) - 类 中的方法com.jfinal.template.ext.extensionmethod.BigDecimalExt
toBigDecimal(BigInteger) - 类 中的方法com.jfinal.template.ext.extensionmethod.BigIntegerExt
toBigDecimal(Byte) - 类 中的方法com.jfinal.template.ext.extensionmethod.ByteExt
toBigDecimal(Double) - 类 中的方法com.jfinal.template.ext.extensionmethod.DoubleExt
toBigDecimal(Float) - 类 中的方法com.jfinal.template.ext.extensionmethod.FloatExt
toBigDecimal(Integer) - 类 中的方法com.jfinal.template.ext.extensionmethod.IntegerExt
toBigDecimal(Long) - 类 中的方法com.jfinal.template.ext.extensionmethod.LongExt
toBigDecimal(Short) - 类 中的方法com.jfinal.template.ext.extensionmethod.ShortExt
toBigDecimal(String) - 类 中的方法com.jfinal.template.ext.extensionmethod.StringExt
toBigInteger(BigInteger) - 类 中的方法com.jfinal.template.ext.extensionmethod.BigIntegerExt
toBigInteger(Byte) - 类 中的方法com.jfinal.template.ext.extensionmethod.ByteExt
toBigInteger(Double) - 类 中的方法com.jfinal.template.ext.extensionmethod.DoubleExt
toBigInteger(Float) - 类 中的方法com.jfinal.template.ext.extensionmethod.FloatExt
toBigInteger(Integer) - 类 中的方法com.jfinal.template.ext.extensionmethod.IntegerExt
toBigInteger(Long) - 类 中的方法com.jfinal.template.ext.extensionmethod.LongExt
toBigInteger(Short) - 类 中的方法com.jfinal.template.ext.extensionmethod.ShortExt
toBigInteger(String) - 类 中的方法com.jfinal.template.ext.extensionmethod.StringExt
toBoolean(Object) - 类 中的静态方法com.jfinal.kit.TypeKit
toBoolean(BigDecimal) - 类 中的方法com.jfinal.template.ext.extensionmethod.BigDecimalExt
toBoolean(BigInteger) - 类 中的方法com.jfinal.template.ext.extensionmethod.BigIntegerExt
toBoolean(Byte) - 类 中的方法com.jfinal.template.ext.extensionmethod.ByteExt
toBoolean(Double) - 类 中的方法com.jfinal.template.ext.extensionmethod.DoubleExt
toBoolean(Float) - 类 中的方法com.jfinal.template.ext.extensionmethod.FloatExt
toBoolean(Integer) - 类 中的方法com.jfinal.template.ext.extensionmethod.IntegerExt
toBoolean(Long) - 类 中的方法com.jfinal.template.ext.extensionmethod.LongExt
toBoolean(Short) - 类 中的方法com.jfinal.template.ext.extensionmethod.ShortExt
toBoolean(String) - 类 中的方法com.jfinal.template.ext.extensionmethod.StringExt
StringExt.toBoolean() 是数据类型转换,所以与 Logic.isTrue(String)
中的逻辑不同,后者只要 String 值非 null 并且 length() > 0 即返回 true
toByte(Object) - 类 中的静态方法com.jfinal.kit.TypeKit
toByte(BigDecimal) - 类 中的方法com.jfinal.template.ext.extensionmethod.BigDecimalExt
toByte(BigInteger) - 类 中的方法com.jfinal.template.ext.extensionmethod.BigIntegerExt
toByte(Byte) - 类 中的方法com.jfinal.template.ext.extensionmethod.ByteExt
toByte(Double) - 类 中的方法com.jfinal.template.ext.extensionmethod.DoubleExt
toByte(Float) - 类 中的方法com.jfinal.template.ext.extensionmethod.FloatExt
toByte(Integer) - 类 中的方法com.jfinal.template.ext.extensionmethod.IntegerExt
toByte(Long) - 类 中的方法com.jfinal.template.ext.extensionmethod.LongExt
toByte(Short) - 类 中的方法com.jfinal.template.ext.extensionmethod.ShortExt
toByte(String) - 类 中的方法com.jfinal.template.ext.extensionmethod.StringExt
toCamelCase(String) - 类 中的静态方法com.jfinal.kit.StrKit
将包含下划线字符 '_' 的字符串转换成驼峰格式,不包含下划线则原样返回
toCamelCase(String, boolean) - 类 中的静态方法com.jfinal.kit.StrKit
字符串转换成驼峰格式
toLowerCaseAnyway 参数的作用如下:
1:当待转换字符串中包含下划线字符 '_' 时,无需关心 toLowerCaseAnyway 参数的值,转换结果始终一样
2:当待转换字符串中不包含下划线字符 '_' 时,toLowerCaseAnyway 参数规则如下:
true 值: 将待转换字符串全部转换成小与字母,适用于 oralce 数据库字段转换的场景
因为 oracle 字段全是大写字母
false 值: 则原样返回待转换字符串,适用于待转换字符串可能原本就是驼峰格式的场景
如果原本就是驼峰,全部转成小写字母显然不合理
toConstIfPossible() - 类 中的方法com.jfinal.template.expr.ast.Unary
如果可能的话,将 Unary 表达式转化成 Const 表达式,类似于 ExprParser.buildMapEntry() 需要这种转化来简化实现
除了可简化程序外,还起到一定的性能优化作用
Number : +123 -456 +3.14 -0.12
Boolean : !
toDate(LocalDateTime) - 类 中的静态方法com.jfinal.kit.TimeKit
java.time.LocalDateTime --> java.util.Date
toDate(LocalDate) - 类 中的静态方法com.jfinal.kit.TimeKit
java.time.LocalDate --> java.util.Date
toDate(LocalTime) - 类 中的静态方法com.jfinal.kit.TimeKit
java.time.LocalTime --> java.util.Date
toDate(LocalDate, LocalTime) - 类 中的静态方法com.jfinal.kit.TimeKit
java.time.LocalTime --> java.util.Date
toDate(Object) - 类 中的静态方法com.jfinal.kit.TypeKit
toDouble(Object) - 类 中的静态方法com.jfinal.kit.TypeKit
toDouble(BigDecimal) - 类 中的方法com.jfinal.template.ext.extensionmethod.BigDecimalExt
toDouble(BigInteger) - 类 中的方法com.jfinal.template.ext.extensionmethod.BigIntegerExt
toDouble(Byte) - 类 中的方法com.jfinal.template.ext.extensionmethod.ByteExt
toDouble(Double) - 类 中的方法com.jfinal.template.ext.extensionmethod.DoubleExt
toDouble(Float) - 类 中的方法com.jfinal.template.ext.extensionmethod.FloatExt
toDouble(Integer) - 类 中的方法com.jfinal.template.ext.extensionmethod.IntegerExt
toDouble(Long) - 类 中的方法com.jfinal.template.ext.extensionmethod.LongExt
toDouble(Short) - 类 中的方法com.jfinal.template.ext.extensionmethod.ShortExt
toDouble(String) - 类 中的方法com.jfinal.template.ext.extensionmethod.StringExt
toFloat(Object) - 类 中的静态方法com.jfinal.kit.TypeKit
toFloat(BigDecimal) - 类 中的方法com.jfinal.template.ext.extensionmethod.BigDecimalExt
toFloat(BigInteger) - 类 中的方法com.jfinal.template.ext.extensionmethod.BigIntegerExt
toFloat(Byte) - 类 中的方法com.jfinal.template.ext.extensionmethod.ByteExt
toFloat(Double) - 类 中的方法com.jfinal.template.ext.extensionmethod.DoubleExt
toFloat(Float) - 类 中的方法com.jfinal.template.ext.extensionmethod.FloatExt
toFloat(Integer) - 类 中的方法com.jfinal.template.ext.extensionmethod.IntegerExt
toFloat(Long) - 类 中的方法com.jfinal.template.ext.extensionmethod.LongExt
toFloat(Short) - 类 中的方法com.jfinal.template.ext.extensionmethod.ShortExt
toFloat(String) - 类 中的方法com.jfinal.template.ext.extensionmethod.StringExt
toHex(byte[]) - 类 中的静态方法com.jfinal.kit.HashKit
toInt(Object) - 类 中的静态方法com.jfinal.kit.TypeKit
toInt(BigDecimal) - 类 中的方法com.jfinal.template.ext.extensionmethod.BigDecimalExt
toInt(BigInteger) - 类 中的方法com.jfinal.template.ext.extensionmethod.BigIntegerExt
toInt(Byte) - 类 中的方法com.jfinal.template.ext.extensionmethod.ByteExt
toInt(Double) - 类 中的方法com.jfinal.template.ext.extensionmethod.DoubleExt
toInt(Float) - 类 中的方法com.jfinal.template.ext.extensionmethod.FloatExt
toInt(Integer) - 类 中的方法com.jfinal.template.ext.extensionmethod.IntegerExt
toInt(Long) - 类 中的方法com.jfinal.template.ext.extensionmethod.LongExt
toInt(Short) - 类 中的方法com.jfinal.template.ext.extensionmethod.ShortExt
toInt(String) - 类 中的方法com.jfinal.template.ext.extensionmethod.StringExt
toJavaFormatString() - 类 中的方法com.jfinal.template.io.FloatingDecimal
toLocalDate(Date) - 类 中的静态方法com.jfinal.kit.TimeKit
java.util.Date --> java.time.LocalDate
toLocalDateTime(Date) - 类 中的静态方法com.jfinal.kit.TimeKit
java.util.Date --> java.time.LocalDateTime
toLocalDateTime(Object) - 类 中的静态方法com.jfinal.kit.TypeKit
toLocalTime(Date) - 类 中的静态方法com.jfinal.kit.TimeKit
java.util.Date --> java.time.LocalTime
toLong(Object) - 类 中的静态方法com.jfinal.kit.TypeKit
toLong(BigDecimal) - 类 中的方法com.jfinal.template.ext.extensionmethod.BigDecimalExt
toLong(BigInteger) - 类 中的方法com.jfinal.template.ext.extensionmethod.BigIntegerExt
toLong(Byte) - 类 中的方法com.jfinal.template.ext.extensionmethod.ByteExt
toLong(Double) - 类 中的方法com.jfinal.template.ext.extensionmethod.DoubleExt
toLong(Float) - 类 中的方法com.jfinal.template.ext.extensionmethod.FloatExt
toLong(Integer) - 类 中的方法com.jfinal.template.ext.extensionmethod.IntegerExt
toLong(Long) - 类 中的方法com.jfinal.template.ext.extensionmethod.LongExt
toLong(Short) - 类 中的方法com.jfinal.template.ext.extensionmethod.ShortExt
toLong(String) - 类 中的方法com.jfinal.template.ext.extensionmethod.StringExt
toMap() - 类 中的方法com.jfinal.kit.Kv
toMap() - 类 中的方法com.jfinal.kit.Okv
toNumber(Object) - 类 中的静态方法com.jfinal.kit.TypeKit
toShort(Object) - 类 中的静态方法com.jfinal.kit.TypeKit
toShort(BigDecimal) - 类 中的方法com.jfinal.template.ext.extensionmethod.BigDecimalExt
toShort(BigInteger) - 类 中的方法com.jfinal.template.ext.extensionmethod.BigIntegerExt
toShort(Byte) - 类 中的方法com.jfinal.template.ext.extensionmethod.ByteExt
toShort(Double) - 类 中的方法com.jfinal.template.ext.extensionmethod.DoubleExt
toShort(Float) - 类 中的方法com.jfinal.template.ext.extensionmethod.FloatExt
toShort(Integer) - 类 中的方法com.jfinal.template.ext.extensionmethod.IntegerExt
toShort(Long) - 类 中的方法com.jfinal.template.ext.extensionmethod.LongExt
toShort(Short) - 类 中的方法com.jfinal.template.ext.extensionmethod.ShortExt
toShort(String) - 类 中的方法com.jfinal.template.ext.extensionmethod.StringExt
toStr(Object) - 类 中的静态方法com.jfinal.kit.TypeKit
toString() - 类 中的方法com.jfinal.template.Engine
toString() - 类 中的方法com.jfinal.template.expr.ast.Const
toString() - 类 中的方法com.jfinal.template.expr.ast.FastFieldGetter
toString() - 类 中的方法com.jfinal.template.expr.ast.FieldGetters.GetterMethodFieldGetter
toString() - 类 中的方法com.jfinal.template.expr.ast.FieldGetters.IsMethodFieldGetter
toString() - 类 中的方法com.jfinal.template.expr.ast.FieldGetters.RealFieldGetter
toString() - 类 中的方法com.jfinal.template.expr.ast.FieldKeyBuilder.FieldKey
toString() - 类 中的方法com.jfinal.template.expr.ast.Id
Id.toString() 后续版本不能变动,已有部分第三方依赖此方法
toString() - 类 中的方法com.jfinal.template.expr.ast.MethodInfo
toString() - 类 中的方法com.jfinal.template.expr.ast.StaticField
toString() - 类 中的方法com.jfinal.template.expr.ast.Unary
toString() - 类 中的方法com.jfinal.template.expr.NumTok
toString() - 枚举 中的方法com.jfinal.template.expr.Sym
toString() - 类 中的方法com.jfinal.template.ext.spring.JFinalView.InnerSession
toString() - 类 中的方法com.jfinal.template.io.FastStringWriter
toString() - 类 中的方法com.jfinal.template.io.FloatingDecimal
toString() - 类 中的方法com.jfinal.template.source.ClassPathSource
toString() - 类 中的方法com.jfinal.template.source.FileSource
toString() - 类 中的方法com.jfinal.template.source.StringSource
toString() - 类 中的方法com.jfinal.template.stat.ast.Define
toString() - 类 中的方法com.jfinal.template.stat.ast.Text
toString() - 类 中的方法com.jfinal.template.stat.Location
toString() - 类 中的方法com.jfinal.template.stat.ParaToken
toStringBuilder() - 类 中的方法com.jfinal.template.io.FastStringWriter
TRUE - 类 中的静态变量com.jfinal.template.expr.ast.Const
TypeKit - com.jfinal.kit 中的类
TypeKit
TypeKit() - 类 的构造器com.jfinal.kit.TypeKit