[
http://jira.andromda.org/jira/browse/JAVA-3?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Plushnikov Michail closed JAVA-3.
---------------------------------
Resolution: Fixed
Fix Version/s: 3.4-SNAPSHOT
Assignee: Bob Fields (was: Matthias Bohlen)
> generation of toString() method
> -------------------------------
>
> Key: JAVA-3
> URL: http://jira.andromda.org/jira/browse/JAVA-3
> Project: Java Cartridge
> Issue Type: New Feature
> Reporter: Tomasz Lempart
> Assignee: Bob Fields
> Priority: Minor
> Fix For: 3.4-SNAPSHOT
>
>
> It is useful for logging and debug reasons to generate for every ValueObject
> toString() method. The template is not complicated:
> public String toString() {
> StringBuffer result = new StringBuffer();
> result.append("${class.name}: [");
> #foreach ( $att in $class.attributes )
> #set ($atttypename = $att.type.fullyQualifiedName)
> result.append("${att.name}=" + ${att.name});
> #if ($velocityCount != $class.attributes.size())
> result.append(", ");
> #end
> #end
> result.append("]");
> return result.toString();
> }
> There is some problem with attributes which should not be logged i.e.
> password attribute. It could be used some tag value i.e. andromda.java.logged
> with false value to exclude attribute from generation.
> Such functionality is useful not only for java cartridge but for other too,
> for example hibernate cartridge can take advantage of it. Is there some
> possibility to make it generic?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.andromda.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev