fastjson new Filter & processor requirements

t30tvxxf  于 2022-10-21  发布在  其他
关注(0)|答案(2)|浏览(147)
  • for serialize

implement one class to simple name or tag filter such as:

public interface TypeFilter extends SerializeFilter {
    String process(Class<?> type, String name);
}
  • for parser

need class name process to translate class name to Class helping with TypeFilter of serializer

public interface TypeProcessor extends ParseProcess {
    Class<?> process(ParseContext[] context, int size, String typeName, Type expectClass);
}

and NameProcessor for field name processing to match java bean field name (serializer has NameFilter)

public interface NameProcessor extends ParseProcess {
	//only process complex or abnormal property
    Object process(ParseContext[] context, int size, Object fieldName);
}

or better suggestion , thx

making distribute rpc/rest service easier & compatible in multiple languages

wpx232ag

wpx232ag1#

very good idea, i will add these features in the next version.

wnrlj8wa

wnrlj8wa2#

for TypeFilter , does the class level SerializeFilter meet you needs?
https://github.com/alibaba/fastjson/wiki/Class_Level_SerializeFilter

相关问题