- addCompileOption(String) - 类 中的方法com.jfinal.proxy.ProxyCompiler
-
- addDirective(String, Class<? extends Directive>) - 类 中的方法com.jfinal.template.Engine
-
Add directive
示例:
addDirective("now", NowDirective.class)
- addDirective(String, Directive) - 类 中的方法com.jfinal.template.Engine
-
已过时。
- addDirective(String, Directive) - 类 中的方法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
-
已过时。
- 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(CharSequence) - 类 中的方法com.jfinal.template.io.FastStringWriter
-
- append(CharSequence, int, int) - 类 中的方法com.jfinal.template.io.FastStringWriter
-
- append(char) - 类 中的方法com.jfinal.template.io.FastStringWriter
-
- Arith - com.jfinal.template.expr.ast中的类
-
Arithmetic
1:支持 byte short int long float double 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
-
普通赋值表达式
- 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
-
真正调用模板函数
- 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.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
-
- close() - 类 中的方法com.jfinal.template.io.Writer
-
- 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 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
-
- 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
- Continue - com.jfinal.template.stat.ast中的类
-
Continue
- create() - 类 中的静态方法com.jfinal.kit.Kv
-
- create(String) - 类 中的静态方法com.jfinal.template.Engine
-
Create engine with engine name managed by JFinal
- 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, 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(long, 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
-
- formats - 类 中的变量com.jfinal.template.io.Writer
-
- funcNameExpr - 类 中的变量com.jfinal.template.ext.directive.CallDirective
-
- functionMap - 类 中的变量com.jfinal.template.Env
-
- 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(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
-
- 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
-
- getBoolean(Object) - 类 中的方法com.jfinal.kit.Kv
-
- 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
-
- 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 值
- getDateFormat(String) - 类 中的方法com.jfinal.template.io.DateFormats
-
- getDatePattern() - 类 中的方法com.jfinal.template.Engine
-
- getDatePattern() - 类 中的方法com.jfinal.template.EngineConfig
-
- getDevMode() - 类 中的方法com.jfinal.template.Engine
-
- getDirective(String) - 类 中的方法com.jfinal.template.EngineConfig
-
- getDouble() - 类 中的方法com.jfinal.template.expr.ast.Const
-
- getEncoder() - 类 中的方法com.jfinal.template.io.EncoderFactory
-
- 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
-
- 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() - 类 中的方法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 值,可以得知该赋值表达式是针对哪个变量在操作,有助于扩展
需求来源:http://www.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() - 类 中的方法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
-
- 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
-
获取局部变量
- getLocation() - 类 中的方法com.jfinal.template.stat.ast.Stat
-
- getLong(Object) - 类 中的方法com.jfinal.kit.Kv
-
- 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() - 类 中的方法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
-
- getRandomUUID() - 类 中的静态方法com.jfinal.kit.StrKit
-
- getRight() - 类 中的方法com.jfinal.template.expr.ast.Assign
-
- getRootData() - 类 中的方法com.jfinal.template.stat.Scope
-
获取顶层作用域 data,可能为 null 值
- 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
-
- getSharedObjectMap() - 类 中的方法com.jfinal.template.EngineConfig
-
- 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() - 类 中的方法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 参数的
数量可控并且确定时,才可对其使用缓存
- 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(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
-
- invokeVarArgsMethod(Object, Object[]) - 类 中的方法com.jfinal.template.expr.ast.MethodInfo
-
- 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(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
-
- isExprChar(char) - 类 中的静态方法com.jfinal.template.stat.CharTable
-
- isFalse(Object) - 类 中的方法com.jfinal.kit.Kv
-
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
-
- 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() - 类 中的方法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
-
- isStr() - 类 中的方法com.jfinal.template.expr.ast.Const
-
- isTrue(Object) - 类 中的方法com.jfinal.kit.Kv
-
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
通过 Logic.setToOldWorkMode() 设置,可支持老版本中的以下四个规则:
1:Number 类型,返回 value !
- 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) - 类 中的方法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) - 类 中的方法com.jfinal.template.expr.ast.SharedMethodKit
-
- removeSharedMethod(Class<?>) - 类 中的方法com.jfinal.template.expr.ast.SharedMethodKit
-
- removeSharedMethod(Method) - 类 中的方法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 参数所指定的文件中去
适用于代码生成器类似应用场景
- 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 中去
- renderToStringBuilder(Map<?, ?>) - 类 中的方法com.jfinal.template.Template
-
渲染到 StringBuilder 中去
- requiredViewClass() - 类 中的方法com.jfinal.template.ext.spring.JFinalViewResolver
-
- Return - com.jfinal.template.stat.ast中的类
-
Return
通常用于 #define 指令内部,不支持返回值
- 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 执行过程中作用域栈
- set(Object, Object) - 类 中的方法com.jfinal.kit.Kv
-
- set(Map) - 类 中的方法com.jfinal.kit.Kv
-
- set(Kv) - 类 中的方法com.jfinal.kit.Kv
-
- 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
- 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
-
设置模板基础路径
- setBreak() - 类 中的方法com.jfinal.template.stat.Ctrl
-
- setBufferSize(int) - 类 中的方法com.jfinal.template.io.WriterBuffer
-
- setByteCode(Map<String, byte[]>) - 类 中的方法com.jfinal.proxy.ProxyClass
-
- setClazz(Class<?>) - 类 中的方法com.jfinal.proxy.ProxyClass
-
- setCompileOptions(List<String>) - 类 中的方法com.jfinal.proxy.ProxyCompiler
-
- 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 做过性能优化,某些偏门字符在
被编码为 UTF-8 时会出现异常,此时可以通过继承扩展 EncoderFactory
来解决编码异常,具体用法参考:
http://www.jfinal.com/feedback/5340
- 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
-
- 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
-
- setIfNotNull(Object, Object) - 类 中的方法com.jfinal.kit.Kv
-
- setJumpNone() - 类 中的方法com.jfinal.template.stat.Ctrl
-
- 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
- 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 对象
- 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
-
- setToClassPathSourceFactory() - 类 中的方法com.jfinal.template.Engine
-
设置为 ClassPathSourceFactory 的快捷方法
- setToOldWorkMode() - 类 中的静态方法com.jfinal.template.expr.ast.Logic
-
已过时。
- 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
-
- setWriterBufferSize(int) - 类 中的方法com.jfinal.template.Engine
-
- setWriterBufferSize(int) - 类 中的方法com.jfinal.template.EngineConfig
-
- 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(StringBuilder, boolean) - 类 的构造器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
-