You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Jack Tan (JIRA)" <ji...@apache.org> on 2015/04/18 16:01:58 UTC
[jira] [Created] (LANG-1117) Want an implemention of
ToStringBuilder supports annotation
Jack Tan created LANG-1117:
------------------------------
Summary: Want an implemention of ToStringBuilder supports annotation
Key: LANG-1117
URL: https://issues.apache.org/jira/browse/LANG-1117
Project: Commons Lang
Issue Type: Wish
Components: lang.builder.*
Affects Versions: 3.4
Reporter: Jack Tan
When using {{ReflectionToStringBuilder}}, we need call {{ReflectionToStringBuilder.setExcludeFieldNames(str1,str2)}} to exclude fields. Why not use annotation? Just look like:
{code:title=Bar.java|borderStyle=solid}
public class Bar {
private String name;
private Date signDate;
private int age;
@ExcludeFields({"signDate", "age"})
public String toString() {
return AnnotationToStringBuilder.toString(this, ToStringStyle.JSON_STYLE);
}
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)