Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse Java Development User Guide
Previous Page Home Next Page

Java Code Style Preferences

The Opens the Code Style preference page Java > Code Style preference page allows to configure naming conventions, style rules and comment settings. These preferences are used when new code has to be generated.

Sub pages offer more code style settings:

The options are:

Naming Conventions

The list defines the naming conventions for fields (static and non-static), parameters and local variables. For each variable type it is possible to configure a list of prefix or suffix or both.
Naming conventions are used by all actions and 'Quick Fix' proposals that create fields, parameters and local variables, in particular the Source actions.

Action

Description

Edit...

Opens a dialog to edit the list of prefix and suffixes for the currently selected variable type

Code Conventions

The following settings specify how newly generated code should look like. The names of getter methods can be specified as well as the format of field accesses, method comments, annotations and exception variables.

Action

Description

Default

Qualify all generated field accesses with 'this.'

If selected, field accesses are always prefixed with 'this', regardless whether the name of the field is unique in the scope of the field access or not.

Off

Use 'is' prefix for getters that return boolean

If selected, the names of getter methods of boolean type are prefixed with 'is' rather than 'get'.

On

Add '@Override' annotation for overriding methods

If selected, methods which override an already implemented method are annotated with an '@Override' annotation. See the Compiler preference page for settings related to annotations.

On

Exception variable name in catch blocks

Specify the name of the exception variable declared in catch blocks.

e

Related reference

Source actions
Java editor
Java editor preferences
Java compiler preferences
Code templates preferences


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire