@Test public void testShowConstructors() throws Exception { ShowClassDetailInfo.showConstructs(TargetClass.class); }
public static String showConstructs(Class clazz) { StringBuffer stringBuffer = new StringBuffer(); Constructor[] constructors = clazz.getConstructors(); for (Constructor constructor : constructors) { Annotation[] annotations = constructor.getDeclaredAnnotations(); stringBuffer = constructorAnnotation(stringBuffer, annotations); String modifierType = Modifier.toString(constructor.getModifiers()); stringBuffer.append(modifierType).append(SPACE).append(clazz.getSimpleName()).append("("); Class[] types = constructor.getParameterTypes(); if (types.length > 0) { for (Class type : types) { String parameterTypeName = type.getName(); String parameterTypeReferenceName = type.getClass().getSimpleName().toLowerCase(); stringBuffer = injectMethodParametersContent(stringBuffer, parameterTypeName, parameterTypeReferenceName); } stringBuffer = fixStringBuffer(stringBuffer); } stringBuffer.append(")").append("{...}").append(LINE_BREAK).append(LINE_BREAK); } return stringBuffer.toString(); }
ShowClassDetailInfo { public static String showConstructs(Class clazz) { StringBuffer stringBuffer = new StringBuffer(); Constructor[] constructors = clazz.getConstructors(); for (Constructor constructor : constructors) { Annotation[] annotations = constructor.getDeclaredAnnotations(); stringBuffer = constructorAnnotation(stringBuffer, annotations); String modifierType = Modifier.toString(constructor.getModifiers()); stringBuffer.append(modifierType).append(SPACE).append(clazz.getSimpleName()).append("("); Class[] types = constructor.getParameterTypes(); if (types.length > 0) { for (Class type : types) { String parameterTypeName = type.getName(); String parameterTypeReferenceName = type.getClass().getSimpleName().toLowerCase(); stringBuffer = injectMethodParametersContent(stringBuffer, parameterTypeName, parameterTypeReferenceName); } stringBuffer = fixStringBuffer(stringBuffer); } stringBuffer.append(")").append("{...}").append(LINE_BREAK).append(LINE_BREAK); } return stringBuffer.toString(); } }
ShowClassDetailInfo { public static String showConstructs(Class clazz) { StringBuffer stringBuffer = new StringBuffer(); Constructor[] constructors = clazz.getConstructors(); for (Constructor constructor : constructors) { Annotation[] annotations = constructor.getDeclaredAnnotations(); stringBuffer = constructorAnnotation(stringBuffer, annotations); String modifierType = Modifier.toString(constructor.getModifiers()); stringBuffer.append(modifierType).append(SPACE).append(clazz.getSimpleName()).append("("); Class[] types = constructor.getParameterTypes(); if (types.length > 0) { for (Class type : types) { String parameterTypeName = type.getName(); String parameterTypeReferenceName = type.getClass().getSimpleName().toLowerCase(); stringBuffer = injectMethodParametersContent(stringBuffer, parameterTypeName, parameterTypeReferenceName); } stringBuffer = fixStringBuffer(stringBuffer); } stringBuffer.append(")").append("{...}").append(LINE_BREAK).append(LINE_BREAK); } return stringBuffer.toString(); }  }
ShowClassDetailInfo { public static String showConstructs(Class clazz) { StringBuffer stringBuffer = new StringBuffer(); Constructor[] constructors = clazz.getConstructors(); for (Constructor constructor : constructors) { Annotation[] annotations = constructor.getDeclaredAnnotations(); stringBuffer = constructorAnnotation(stringBuffer, annotations); String modifierType = Modifier.toString(constructor.getModifiers()); stringBuffer.append(modifierType).append(SPACE).append(clazz.getSimpleName()).append("("); Class[] types = constructor.getParameterTypes(); if (types.length > 0) { for (Class type : types) { String parameterTypeName = type.getName(); String parameterTypeReferenceName = type.getClass().getSimpleName().toLowerCase(); stringBuffer = injectMethodParametersContent(stringBuffer, parameterTypeName, parameterTypeReferenceName); } stringBuffer = fixStringBuffer(stringBuffer); } stringBuffer.append(")").append("{...}").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 showConstructs(Class clazz) { StringBuffer stringBuffer = new StringBuffer(); Constructor[] constructors = clazz.getConstructors(); for (Constructor constructor : constructors) { Annotation[] annotations = constructor.getDeclaredAnnotations(); stringBuffer = constructorAnnotation(stringBuffer, annotations); String modifierType = Modifier.toString(constructor.getModifiers()); stringBuffer.append(modifierType).append(SPACE).append(clazz.getSimpleName()).append("("); Class[] types = constructor.getParameterTypes(); if (types.length > 0) { for (Class type : types) { String parameterTypeName = type.getName(); String parameterTypeReferenceName = type.getClass().getSimpleName().toLowerCase(); stringBuffer = injectMethodParametersContent(stringBuffer, parameterTypeName, parameterTypeReferenceName); } stringBuffer = fixStringBuffer(stringBuffer); } stringBuffer.append(")").append("{...}").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);  }