jetbrick-template-2.x 已经发布,新版文档请看这里:http://subchen.github.io/jetbrick-template/2x/

§jetbrick-template 常见错误分析

§1. The method getXXX() or isXXX() is undefined for the type Object

${obj.foo}
  1. 确定 obj 存在 getFoo() or isFoo() 方法,并且是 public
  2. obj 对象是否已经声明变量类型,否则请用 #define(TYPE obj) 声明变量类型。

§2. The method foo(xxx, ...) is undefined for the type Object

${obj.foo(...)}
  1. 确定 obj 存在 foo(...) 方法,并且是 public 的,参数类型是否匹配。
  2. obj 对象是否已经声明变量类型,否则请用 #define(TYPE obj) 声明变量类型。
  3. 如果 foo 是扩展方法,那么请确认扩展函数 XXX 是否已经注册到 JetEngine 中,或者参数类型是否匹配。

§3. Operator [] is not applicable for the object (Object)

${obj[foo]}
  1. obj 对象是否已经声明变量类型,否则请用 #define(TYPE obj) 声明变量类型。
  2. 只有 ListMapJetContext 对象支持 "[]" 操作

§4. Duplicate local variable xxx

变量 xxx 定义的两次(相同作用域只能定义一次),请查找 #define#set 指令是否对 变量 xxx 进行多次定义

§5. Type mismatch: cannot convert from XXX to YYY

#define(String str)
#set(int a = str)

变量类型部不兼容,比如 String 对象复制给 int

§6. Undefined function XXX

扩展函数 XXX 没有找到,请确认扩展函数 XXX 是否已经注册到 JetEngine 中,或者参数类型是否匹配。

§7. Undefined tag definition: XXX(...)

没有找到对应的 Tag 定义,请确认 Tag 是否已经注册到 JetEngine 中,或者参数类型是否匹配。

§8. line xxx: Implicit definition for context variable: XXX

变量 XXX 没有声明变量类型,而直接使用。(这个仅仅是一个 Warning,不是 Error)