You can use domain modeling class diagrams to add fields
to Java classes and interfaces.
Before you begin
You must have a domain modeling class diagram with Java classes or interfaces open.
About this task
Tip: When you add fields to classes or interfaces,
fully qualified names will be added for type proposals in packages
if the Java Editor Code Assist's default Add
import instead of qualified name preference option is
cleared. Otherwise, import declarations will be added automatically.
To
add a field to a Java class or interface, complete
the following steps:
Procedure
- In the diagram editor, right-click a Java class
or interface; then click .
- In the Create Java Field wizard, in
the Name field, type a name for the new field.
- In the Initial Value field, specify
the initial value expression.
- Under Type and Dimensions, click
a type and specify dimensions.
- Under Visibility, click a visibility
style.
- Under Modifiers, click modifiers.
- Click Finish.
What to do next
Note: You can also use the action bar to add
fields to Java classes and interfaces.