那么你可以有一个PropertyNamingStrategy的实现,看起来像这样:
import org.codehaus.jackson.map.MapperConfig;
import org.codehaus.jackson.map.PropertyNamingStrategy;
import org.codehaus.jackson.map.introspect.AnnotatedField;
import org.codehaus.jackson.map.introspect.AnnotatedMethod;
public class CustomNameStrategy extends PropertyNamingStrategy
{
@Override
public String nameForField(MapperConfig
config,
AnnotatedField field, String defaultName) {
return convert(defaultName);
}
@Override
public String nameForGetterMethod(MapperConfig
config,
AnnotatedMethod method, String defaultName) {
return convert(defaultName);
}
@Override
public String nameForSetterMethod(MapperConfig
config,
AnnotatedMethod method, String defaultName) {