@Test public void testShowField() throws Exception { ShowClassDetailInfo.showDeclaredField(TargetClass.class); }
public static String showDeclaredField(Class clazz) { StringBuffer stringBuffer = new StringBuffer(); Field[] fields = clazz.getDeclaredFields(); for (Field field : fields) { Annotation[] annotations = field.getDeclaredAnnotations(); stringBuffer = constructorAnnotation(stringBuffer, annotations); String fieldModifier = Modifier.toString(field.getModifiers()); String fieldType = field.getType().getSimpleName(); stringBuffer.append(fieldModifier).append(SPACE).append(fieldType).append(SPACE); stringBuffer.append(field.getName()).append(SEMICOLON).append(LINE_BREAK).append(LINE_BREAK); } return stringBuffer.toString(); }
ShowClassDetailInfo { public static String showDeclaredField(Class clazz) { StringBuffer stringBuffer = new StringBuffer(); Field[] fields = clazz.getDeclaredFields(); for (Field field : fields) { Annotation[] annotations = field.getDeclaredAnnotations(); stringBuffer = constructorAnnotation(stringBuffer, annotations); String fieldModifier = Modifier.toString(field.getModifiers()); String fieldType = field.getType().getSimpleName(); stringBuffer.append(fieldModifier).append(SPACE).append(fieldType).append(SPACE); stringBuffer.append(field.getName()).append(SEMICOLON).append(LINE_BREAK).append(LINE_BREAK); } return stringBuffer.toString(); } }
ShowClassDetailInfo { public static String showDeclaredField(Class clazz) { StringBuffer stringBuffer = new StringBuffer(); Field[] fields = clazz.getDeclaredFields(); for (Field field : fields) { Annotation[] annotations = field.getDeclaredAnnotations(); stringBuffer = constructorAnnotation(stringBuffer, annotations); String fieldModifier = Modifier.toString(field.getModifiers()); String fieldType = field.getType().getSimpleName(); stringBuffer.append(fieldModifier).append(SPACE).append(fieldType).append(SPACE); stringBuffer.append(field.getName()).append(SEMICOLON).append(LINE_BREAK).append(LINE_BREAK); } return stringBuffer.toString(); }  }
ShowClassDetailInfo { public static String showDeclaredField(Class clazz) { StringBuffer stringBuffer = new StringBuffer(); Field[] fields = clazz.getDeclaredFields(); for (Field field : fields) { Annotation[] annotations = field.getDeclaredAnnotations(); stringBuffer = constructorAnnotation(stringBuffer, annotations); String fieldModifier = Modifier.toString(field.getModifiers()); String fieldType = field.getType().getSimpleName(); stringBuffer.append(fieldModifier).append(SPACE).append(fieldType).append(SPACE); stringBuffer.append(field.getName()).append(SEMICOLON).append(LINE_BREAK).append(LINE_BREAK); } return stringBuffer.toString(); }  static String showClassFullInfo(Class clazz); static String showClassPackage(Class clazz); static boolean hasSuperClass(Class clazz); static String showSuperClass(Class clazz); static boolean hasInterface(Class clazz); static String showClassImplInterfaces(Class clazz); static String showConstructs(Class clazz); static Object[] showAllDirectInstanceFieldsValue(Object object); static String showDeclaredField(Class clazz); static String showDeclaredMethod(Class clazz); }
ShowClassDetailInfo { public static String showDeclaredField(Class clazz) { StringBuffer stringBuffer = new StringBuffer(); Field[] fields = clazz.getDeclaredFields(); for (Field field : fields) { Annotation[] annotations = field.getDeclaredAnnotations(); stringBuffer = constructorAnnotation(stringBuffer, annotations); String fieldModifier = Modifier.toString(field.getModifiers()); String fieldType = field.getType().getSimpleName(); stringBuffer.append(fieldModifier).append(SPACE).append(fieldType).append(SPACE); stringBuffer.append(field.getName()).append(SEMICOLON).append(LINE_BREAK).append(LINE_BREAK); } return stringBuffer.toString(); }  static String showClassFullInfo(Class clazz); static String showClassPackage(Class clazz); static boolean hasSuperClass(Class clazz); static String showSuperClass(Class clazz); static boolean hasInterface(Class clazz); static String showClassImplInterfaces(Class clazz); static String showConstructs(Class clazz); static Object[] showAllDirectInstanceFieldsValue(Object object); static String showDeclaredField(Class clazz); static String showDeclaredMethod(Class clazz);  }