| Configuration | Description |
|
Use fully qualified classname | The dumped classname will be including its packagename. (The $classname variable in the Velocity Context) |
|
Use field chooser dialog | A dialog for selecting fields is used (like the getter/setter dialog). |
|
Always use default conflict resolution policy | Will use the option selected from the Conflict Resoluction Policy settings. |
|
Disable action in code and editor popup menus | If selected the Generate toString() action will not be visible in IDEA's Code and EditorPopup (right-click menu) Menus |
|
Enable on-the-fly code inspection | If selected the code inspection for toString() will be run in the background (on-the-fly) and report any errors as warnings. This is like some existing IDEA code inspection for fields not used etc. |
|
Enable getters in code generation | If selected the code generator will have $methods avail in the Velocity Macro Language. |
|
Default Conflict Resolution Policy | Replace Existing = automatic replace existing toString() code. Duplicate = Create a duplicate toString() method (will not erase you existing code). Cancel = No code changes - remove the existing toString() method. |
|
Exclude fields (For constant fields) | If checked then any fields that's a constant will not be part of avaiable fields for the code generator. |
|
Exclude fields (For static fields) | If checked then any fields that's has a static modifier will not be part of avaiable fields for the code generator. |
|
Exclude fields (For transient fields) | If checked then any fields that has a transient modifier will not be part of avaiable fields for the code generator. |
|
Exclude fields (By fieldname) | Performs a regular expression matching on the fieldname. If the result is true the field will not be part of avaiable fields for the code generator. |
|
Exclude methods (By methodname) | Performs a regular expression matching on the methodname. If the result is true the method will not be part of avaiable methods for the code generator. |
|
Automatic add implements java.io.Serializable | Will automatic add implements Serializable to the java bean class if not already implemented. This is usefull for value objects that usually have to implement this interface for working in J2EE environments. |
|
Automatic import packages | Will automatic import the packages. Additional packages can be seperated using comma. IDEA will optmize the imports so java.util.* will be optmized to java.util.List;java.util.Arrays etc. Can be used to import your own Classes that might be added to the generated code in the toString method. |
|
Templates | A list of predefined templates to choose. To activate a new template first select it and click the Activate this template button. |
|
Active template | Activates the current selected template. A confirm dialog will be prompted. |
|
Save template | Saving the current template to a file. A file chooser dialog will be prompted. |
|
Syntax check | Performs a Velocity syntax check of the current template code from the text area. Can be used to catch early syntax errors during customizing of teamplates. |
|
Method body (Velocity Macro Language) | The java code for the toString() method body is generated using Velocity Macro Language. In this text area you can change how the code is generated. |
| Variable | Returns | Description |
| $classname | String | The name of the class (can be the qualified classname if this is selected in the settings) |
| $FQClassname | String | @deprecated (use $class.qualifiedName) - The fully qualified name of the class |
| |
| $fields | java.util.List | List of FieldElement objects |
| $methods | java.util.List | List of MethodElement objects |
| $members | java.util.List | List of both FieldElement and MethodElement objects |
| |
| $member | Element | The Element object |
| $member.accessor | String | The accessor of the field or method. For field it is the $field.name and for method it is $method.methodName |
| $member.typeName | String | The classname of the type (Object, String, List etc.) |
| $member.typeQualifiedName | String | The qualified classname of the type (java.lang.Object, java.lang.String, java.uti.List etc.) |
| $member.array | boolean | Tests if the type is an array type (either a primitve array or object array)? |
| $member.primitiveArray | boolean | Is the type a primitve array type? (int[], short[], float[] etc.) |
| $member.objectArray | boolean | Is the type an Object array type? (Object[], String[] etc.) |
| $member.stringArray | boolean | Is the type an String array type? (String[]) |
| $member.collection | boolean | Is the type assignable from java.util.Collection? |
| $member.list | boolean | Is the type assignable from java.util.List? |
| $member.map | boolean | Is the type assignable from java.util.Map? |
| $member.set | boolean | Is the type assignable from java.util.Set? |
| $member.primitive | boolean | Is the type a primitive type? (int, char, float etc.) |
| $member.modifierStatic | boolean | Does the type have a static modifier? |
| $member.modifierPublic | boolean | Does the type have a public modifier? |
| $member.modifierProtected | boolean | Does the type have a protected modifier? |
| $member.modifierPackageLocal | boolean | Does the type have a package-local modifier? |
| $member.modifierPrivate | boolean | Does the type have a private modifier? |
| $member.modifierFinal | boolean | Does the type have a final modifier? |
| $member.string | boolean | Is the type assignable from java.lang.String? |
| $member.numeric | boolean | Is the type either assignable from java.lang.Numeric or a primitive type of byte, short, int, long, float, double? |
| $member.object | boolean | Is the type assignable from java.lang.Object? |
| $member.date | boolean | Is the type assignable from java.util.Date? |
| $member.calendar | boolean | Is the type assignable from java.util.Calendar? |
| $member.boolean | boolean | Is the type assignable from java.lang.Boolean? or a primitive boolean |
| |
| $field | FieldElement | The FieldElement object |
| $field.name | String | The name of the field |
| $field.modifierTransient | boolean | Does the field have a transient modifier? |
| $field.modifierVolatile | boolean | Does the field have a volatile modifier? |
| $field.constant | boolean | Is the field a constant type? (has static modified and its name is in UPPERCASE only) |
| $field.matchName(regexp) | boolean | Performs a regular expression matching on the fieldname. |
| |
| $method | MethodElement | The MethodElement object |
| $method.name | String | Either: 1) The name of the field this getter method covers or 2) the name of the method 'getFoo' when the method does not cover a field as in situation 1 |
| $method.methodName | String | The name of the method (getFoo). |
| $method.fieldName | String | The name of the field this getter method covers |
| $method.modifierAbstract | boolean | Is this method an abstract method? |
| $method.modifierSynchronzied | boolean | Is this method a synchronzied method? |
| $method.returnTypeVoid | boolean | Is this method a void method (does not return anything) ? |
| $methor.getter | boolean | Is this a getter method? |
| $method.matchName(regexp) | boolean | Performs a regular expression matching on the methodname. |
| |
| $class | ClassElement | The ClassElement object |
| $class.name | String | The name of the class |
| $class.matchName(regexp) | boolean | Performs a regular expression matching on the classname. |
| $class.qualifiedName | String | The fully qualified name of the class |
| $class.hasSuper | boolean | Does the class have a superclass? (extends another class - note extending java.lang.Object is not concidered having a superclass) |
| $class.superName | String | The name of the superclass (empty if no superclass) |
| $class.superQualifiedName | String | The fully qualified name of the superclass (empty if no superclass) |
| $class.implements(interfaceNames) | boolean | Tests if the class implements the given interface name. Testing several interfaces names can be done by seperating the names with comma. Tests is based using the short classname. |
| $class.implementNames | String[] | Returns the classnames of the interfaces the class implements. An empty array is returned if the class does not implement any interfaces. |
| $class.extends(classNames) | boolean | Tests if the class extends any of the the given class names. Testing several class names can be done by seperating the names with comma. Tests is based using the short classname. |