use of org.apache.commons.lang.builder.ReflectionToStringBuilder in project cu-kfs by CU-CommunityApps.
the class PayeeACHAccount method toString.
/**
* KFSCNTRB-1682: Some of the fields contain confidential information
*
* @see org.kuali.rice.krad.bo.BusinessObjectBase#toString()
*/
@Override
public String toString() {
class PayeeACHAccountToStringBuilder extends ReflectionToStringBuilder {
private PayeeACHAccountToStringBuilder(Object object) {
super(object);
}
@Override
public boolean accept(Field field) {
if (BusinessObject.class.isAssignableFrom(field.getType())) {
return false;
}
DataDictionaryService dataDictionaryService = SpringContext.getBean(DataDictionaryService.class);
AttributeSecurity attributeSecurity = dataDictionaryService.getAttributeSecurity(PayeeACHAccount.class.getName(), field.getName());
if ((ObjectUtils.isNotNull(attributeSecurity) && (attributeSecurity.isHide() || attributeSecurity.isMask() || attributeSecurity.isPartialMask()))) {
return false;
}
return super.accept(field);
}
}
;
ReflectionToStringBuilder toStringBuilder = new PayeeACHAccountToStringBuilder(this);
return toStringBuilder.toString();
}
Aggregations