Commit 661ceed2 by s_guodong

PublicFilter 移入

parent d4343539
package com.brilliance.eibs.core.service.instance.impl;
import com.brilliance.eibs.core.model.IFieldDef;
import com.brilliance.eibs.core.service.Context;
import java.util.HashMap;
import java.util.Map;
/**
* 公共Filter,进行基础处理
*
* @author xiaoyuanzhen
*
*/
public class PublicFilter extends AbsFilter {
Map<Object, Integer[]> arrayLenMap = new HashMap<Object, Integer[]>();
@Override
public void execute(Context context) {
// logger.debug( LOG_FLAG + "PublicFilter is running" +
// LOG_FLAG);
context.setCurrentInstance(this);
super.execute(context);
if ("out".equals(getFilterDef().getType())) {
// saveToContext(getFilterDef().getScope(), getFilterDef().getTag(),
// context.getObject());
}
// logger.debug( LOG_FLAG + "PublicFilter has finished running"
// + LOG_FLAG);
}
/**
* 遍历一个数组或List
*
* @param object
* @return
*/
public boolean next(Object object) {
if (!arrayLenMap.containsKey(object)) {
int len = getArrayLen(object);
arrayLenMap.put(object, new Integer[] { 0, len });
}
Integer[] lens = arrayLenMap.get(object);
if (lens[0] >= lens[1])
return false;
else {
lens[0]++;
return true;
}
}
@Override
public Object getFieldValue(IFieldDef fieldDef) {
return null;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment