Preserve section block body, that contain usefull contents.Each preserved section block has three parts: Represent special code comments that remain intact between two code generations.Ī Rebel user should take care to do all his customisations of the code within the Customization may include annotating method or attribute, adding a new method toĬlass, implementing method defined within the model, etc. Rebel generates preserved sections to make it possible for the developer to customize > Generate from the StarUML menu or use the shortcut key Step 4: Select Rebel -> Generate from the menu to generate codeįinally, to generate Java code, use Rebel Package is rebel, the code generator will place generated sources in the c:/sample-project/src/main/java/com/archetype/contactsĭirectory. Having in mind that the base package is com.archetype and the name of the root If not set, the Rebel will prompt you to choose destination folder by opening file selectįor more information about project configuration you can further explore RebelĪs an example, our destination folder may be Step 3 (optional): Define a destination folder for the generated sources.Ī destination folder for the generated Java code is set by using Thus, the full name of our root package will be. We have defined com.archetype to be a prefix of our root package. In our example, you can see in the Rebel Property Editor that Rebel allows you to set a custom base package for your project, using the Rebel Property Editor. Step 2 (optional): define the base package for your project. ( contacts) and the value of its stereotype attribute ( root). In the Properties panel below, you can see the name of the package Model Explorer that the contacts is our root package. Looking at our example project, you can see in the StarUML In other words: the UML package having stereotype root is the starting point of the All contents below this package will be processed during the code Setting up a new project Step 1: Using StarUML Property editor, set the stereotype of the projectĬode generation always starts from the package having stereotype This chapter will guide you step by step through the code generation setup.įor the sake of simplicity, we will use the example from the picture below. In order to generate Java code from your UML model, you need to configure the project root We have prepared a short screencast that presents the creation of a simple project,
0 Comments
Leave a Reply. |