inLine = AObj.SaveInline();
Class<?> currentType = type;
Class<?> tempType;
Type aTempType;
ClassContainer tempContainer;
SaveableField info;
HashSet<String> overrides = new HashSet<String>();
// Iterate through this class and superclass's and get saveable fields
do
{
// Locate all members that are saveable.
for (Field f : currentType.getDeclaredFields())
{
if (overrides.contains(f.getName()))
{
overrides.remove(f.getName());
continue;
}
// if its a saveable field
if (f.isAnnotationPresent(SaveableField.class))
{
info = f.getAnnotation(SaveableField.class);
// register ignoire classes....
if (info != null && !info.overrideParent().isEmpty())
{
overrides.add(info.overrideParent());
}
tempType = f.getType();
aTempType = f.getGenericType();
if (aTempType instanceof ParameterizedType)
{
Type[] types = ((ParameterizedType) aTempType).getActualTypeArguments();
Class<?>[] params = new Class[types.length];
for (int i = 0; i < types.length; i++)
{
if (types[i] instanceof Class)
{
params[i] = (Class<?>) types[i];
}
else if (types[i] instanceof ParameterizedType)
{
params[i] = (Class<?>) ((ParameterizedType) types[i]).getRawType();
}
}
tempContainer = new ClassContainer(tempType, params);
fields.put(f.getName(), tempContainer);
}
else
{
tempContainer = new ClassContainer(tempType);
fields.put(f.getName(), tempContainer);
}
}
// check for UniqueKey