Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import java.util.Calendar;
  2.  
  3. public class Functions {
  4.  
  5. public String getTypeAttribute(Class clazz, String field) throws Exception {
  6. String[] fields = field.replace(".", ",").split(",");
  7. String type = null;
  8. for(int i = 0; i < fields.length; i++) {
  9. type = clazz.getDeclaredField(fields[i]).getType().getSimpleName();
  10. clazz = clazz.getDeclaredField(fields[i]).getType();
  11. }
  12. return type;
  13. }
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement