common_helper/src/main/java/com/xiongyingqi/util/EntityHelper.java
public static String simpleReflectToString(Object object) {
        if (object == null) {
            return null;
        }
        Class clazz = object.getClass();
        Class superClazz = clazz.getSuperclass();

        StringBuilder builder = new StringBuilder(clazz.getName());
        builder.append("@");
        builder.append(Integer.toHexString(object.hashCode()));
        builder.append("[");

        Method[] methods = clazz.getDeclaredMethods();
        for (int i = 0; i < methods.length; i++) {
            Method method = methods[i];
            if (!isSimpleType(method.getReturnType())) {
                continue;
            }
            String methodName = method.getName();
            if (methodName.startsWith("get") && !Modifier.isStatic(method.getModifiers())
                    && Modifier.isPublic(method.getModifiers())) {
                try {
                    Object value = method.invoke(object);

                    String propertyName = methodName.substring(3, 4).toLowerCase()
                            + methodName.substring(4);
                    builder.append(propertyName);
                    builder.append("=");

                    if (value == null) {
                        builder.append("<null>");
                    } else {
                        if (value.getClass().isArray()) {
                            int arraysuperLength = Array.getLength(value);
                            builder.append("{");
                            for (int j = 0; j < arraysuperLength; j++) {
                                Object object2 = Array.get(value, j);
                                builder.append(object2.toString());
                                if (j < arraysuperLength - 1) {
                                    builder.append(", ");
                                }
                            }
                            builder.append("}");
                        } else {
                            builder.append(value.toString());
                        }
                    }
                    builder.append(", ");
                } catch (IllegalArgumentException e) {
                } catch (IllegalAccessException e) {
                } catch (InvocationTargetException e) {
                }
            }
        }
        if (builder.toString().contains(", ")) {
            builder.replace(builder.length() - 2, builder.length(), "");
        }

        builder.append("]");
        return builder.toString();
    }
public static String simpleReflectToString(Object object) {
        if (object == null) {
            return null;
        }
        Class clazz = object.getClass();
        Class superClazz = clazz.getSuperclass();

        StringBuilder builder = new StringBuilder(clazz.getName());
        builder.append("@");
        builder.append(Integer.toHexString(object.hashCode()));
        builder.append("[");

        Method[] methods = clazz.getDeclaredMethods();
        for (int i = 0; i < methods.length; i++) {
            Method method = methods[i];
            if (!isSimpleType(method.getReturnType())) {
                continue;
            }
            String methodName = method.getName();
            if (methodName.startsWith("get") && !Modifier.isStatic(method.getModifiers())
                    && Modifier.isPublic(method.getModifiers())) {
                try {
                    Object value = method.invoke(object);

                    String propertyName = methodName.substring(3, 4).toLowerCase()
                            + methodName.substring(4);
                    builder.append(propertyName);
                    builder.append("=");

                    if (value == null) {
                        builder.append("<null>");
                    } else {
                        if (value.getClass().isArray()) {
                            int arraysuperLength = Array.getLength(value);
                            builder.append("{");
                            for (int j = 0; j < arraysuperLength; j++) {
                                Object object2 = Array.get(value, j);
                                builder.append(object2.toString());
                                if (j < arraysuperLength - 1) {
                                    builder.append(", ");
                                }
                            }
                            builder.append("}");
                        } else {
                            builder.append(value.toString());
                        }
                    }
                    builder.append(", ");
                } catch (IllegalArgumentException e) {
                } catch (IllegalAccessException e) {
                } catch (InvocationTargetException e) {
                }
            }
        }
        if (builder.toString().contains(", ")) {
            builder.replace(builder.length() - 2, builder.length(), "");
        }

        builder.append("]");
        return builder.toString();
    }
public static String simpleReflectToString ( Object object ) { if ( object == null ) { return null ; } Class clazz = object . getClass ( ) ; Class superClazz = clazz . getSuperclass ( ) ; StringBuilder builder = new StringBuilder ( clazz . getName ( ) ) ; builder . append ( "@" ) ; builder . append ( Integer . toHexString ( object . hashCode ( ) ) ) ; builder . append ( "[" ) ; Method [ ] methods = clazz . getDeclaredMethods ( ) ; for ( int i = 0 ; i < methods . length ; i ++ ) { Method method = methods [ i ] ; if ( ! isSimpleType ( method . getReturnType ( ) ) ) { continue ; } String methodName = method . getName ( ) ; if ( methodName . startsWith ( "get" ) && ! Modifier . isStatic ( method . getModifiers ( ) ) && Modifier . isPublic ( method . getModifiers ( ) ) ) { try { Object value = method . invoke ( object ) ; String propertyName = methodName . substring ( 3 , 4 ) . toLowerCase ( ) + methodName . substring ( 4 ) ; builder . append ( propertyName ) ; builder . append ( "=" ) ; if ( value == null ) { builder . append ( "<null>" ) ; } else { if ( value . getClass ( ) . isArray ( ) ) { int arraysuperLength = Array . getLength ( value ) ; builder . append ( "{" ) ; for ( int j = 0 ; j < arraysuperLength ; j ++ ) { Object object2 = Array . get ( value , j ) ; builder . append ( object2 . toString ( ) ) ; if ( j < arraysuperLength - 1 ) { builder . append ( ", " ) ; } } builder . append ( "}" ) ; } else { builder . append ( value . toString ( ) ) ; } } builder . append ( ", " ) ; } catch ( IllegalArgumentException e ) { } catch ( IllegalAccessException e ) { } catch ( InvocationTargetException e ) { } } } if ( builder . toString ( ) . contains ( ", " ) ) { builder . replace ( builder . length ( ) - 2 , builder . length ( ) , "" ) ; } builder . append ( "]" ) ; return builder . toString ( ) ; }
简单的ToString方法，只会查找简单类型的数据 <br>
2013-8-14 下午3:42:01

@param object
@return
简单的ToString方法，只会查找简单类型的数据 <br > 2013 - 8 - 14 下午3 : 42 : 01