Back to project page SimpleStorage.
The source code is released under:
Apache License
If you think the Android project SimpleStorage listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.njzk2.simplestorage; /* www. j a va 2 s . co m*/ import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Map; public class SQLHelper { private static Map<Class<?>, Field[]> fields = new HashMap<Class<?>, Field[]>(); static Field[] getFields(Class<? extends Storable> clazz) { if (!fields.containsKey(clazz)) { Collection<Field> fs = new ArrayList<Field>(); for (Field field : clazz.getDeclaredFields()) { if (!Modifier.isStatic(field.getModifiers())) { fs.add(field); } } fields.put(clazz, fs.toArray(new Field[0])); } return fields.get(clazz); } public static String getTableName(Class<? extends Storable> clazz) { return clazz.getSimpleName(); } }