*/
public class MapPropertiesFinder extends SinglePropertyFinder {
@Override
protected PropertyInfo createPropertyInfo(TypeInfo type) {
if (type instanceof ClassTypeInfo && Map.class.isAssignableFrom(type.getRawType())) {
MethodInfo writeMethod = ((ClassTypeInfo) type).getMethod("put", Object.class, Object.class);
Class<?> keyType = writeMethod.getParameterTypes().get(0).getRawType();
if (keyType.isAssignableFrom(String.class)) {
MethodInfo readMethod = ((ClassTypeInfo) type).getMethod("get", Object.class);
TypeInfo propertyType = writeMethod.getParameterTypes().get(1);
return new MapPropertyImpl(readMethod.getDeclaringType(), propertyType, readMethod, writeMethod);
}
}
return null;
}