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)