public TypeMapper(Class type)
{
TypeResolver typeResolver = new TypeResolver();
ResolvedType resolvedType = typeResolver.resolve(type);
MemberResolver memberResolver = new MemberResolver(typeResolver);
ResolvedTypeWithMembers typeWithMembers =memberResolver.resolve(resolvedType, null, null);
for (ResolvedField field : typeWithMembers.getMemberFields())
{
fields.put(field.getName(),field);
}