Example #1
0
 @Override
 public void scan(Template template) {
   super.scan(template);
   if (getParameter(1) != null) {
     template.preventCacheVariable(getParameter(1).toString());
   }
 }
Example #2
0
  @Override
  public void process(ParameterCharacter[] parameters, Map<String, IExpression> fields)
      throws ParseException {
    super.process(parameters, fields);
    // 移除必须存在的参数
    fields.remove("file");
    fields.remove("assign");

    // 保存所有的参数与值
    IExpression[] expressions = new IExpression[fields.size() * 2 + 2];
    expressions[0] = getParameter(0);
    expressions[1] = getParameter(1);

    int i = 2;
    for (Entry<String, IExpression> entry : fields.entrySet()) {
      expressions[i] = new StringExpression(entry.getKey());
      expressions[i + 1] = entry.getValue();
      i += 2;
    }

    setParameters(expressions);
  }