Configuration

Commonclipse lets you configure different aspects in generateed methods. After installing the plugin you will find a new "Commonclipse" Preference page in "Window"->"Preferences" menu under the "Java" section.

ToString

toString type:

  • Use javabean properties : the toString() method will contains all the readable javabean properties in the current class (defined by getXXX or isXXX methods). This is mostly useful for dataobjects you are writing to a log or displaying in a jsp page with the help of jsp tags (maybe using the display tag library ?). The javabean is accessed using the getter method or using the field with the same name if existing.
  • Use fields : standard toString() with all the fields in the current class, plus public or protected fields in superclasses.

ToString style: you can left it blank to use the default implementation, choose one of the available jakarta implementations (ToStringStyle.DEFAULT_STYLE, ToStringStyle.MULTI_LINE_STYLE, ToStringStyle.NO_FIELD_NAMES_STYLE, ToStringStyle.SIMPLE_STYLE) or provide your own ToStringStyle.

General

Append super in XXX : all the jakarta builders support an "appendSuper()" method to add the superclass implementation to the current method. You can choose to enable it for any of the supported method.

Declare method parameters as final (from version 1.2) : Add "final" to parameters in compareTo and equals() methods.

add an instance equality check to equals() (from version 1.1) : Add an optional check ( if (this == compared) return true ) to equals. This will speed up comparison when evaluating equals between two pointers to the same instance

Overwrite existing methods without confirmation : If this option is not selected commonclipse will ask before deleting existing methods.

Excluded fields

Fields/properties not included in generated methods : You can add any property you don't want to be included in methods here. For example you can avoid fields defining Loggers or the standard class javabean property (Object#getClass()) to appear in generated toString(). From version 1.1 you can use ? and * wildcards in names.