关于java类的toString方法

ReflectionToStringBuilder reflectionToStringBuilder=new ReflectionToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE);
reflectionToStringBuilder.setExcludeFieldNames(Arrays.asList("titleTokens","contentTokens","content").toArray(new String[0]));

利用ReflectionToStringBuilder类将类中的所有信息,打印出来,但不打印属性名称为"titleTokens","contentTokens","content"的属性值。

posted @ 2011-07-08 17:46  xiao晓  阅读(403)  评论(0编辑  收藏  举报