- JBoss:Developer's Guide
- Elvadas Nono Woguia
- 191字
- 2021-07-02 18:37:24
Adding attributes to classes
To add a private name property with getters and setters to the HelloJBossWorld class, use the java-new-field Forge command. This command is applied to the selected classes:
[HelloJBossWorld.java]$ java-new-field
***INFO*** Required inputs not satisfied, entering interactive mode
[0] (x) com.beosbank.forge.demo.HelloJBossWorld
Press <ENTER> to confirm, or <CTRL>+C to cancel.
* Target Class (The class where the field will be created): [0] 0
* Field Name (The field name to be created in this class): name
* Field Type (The type intended to be used for this field) [String]:
[0] ( ) public
[1] ( ) protected
[2] (x) private
[3] ( ) default
Press <ENTER> to confirm, or <CTRL>+C to cancel.
? Access Type (The access type): [0-3] 2
? Generate Getter (Generate accessor method) [Y/n]: Y
? Generate Setter (Generate mutator method) [Y/n]: Y
? Update toString (Updates the toString method by adding the field) [Y/n]:Y
***SUCCESS*** Field name created
We now have a mini project set up with a single class. Forge commands are not only used to create a project's objects but can also serve as gateways to interact with project builder tools such as maven.
推薦閱讀
- Boost程序庫完全開發指南:深入C++”準”標準庫(第5版)
- 跟小海龜學Python
- Oracle 12c中文版數據庫管理、應用與開發實踐教程 (清華電腦學堂)
- 機械工程師Python編程:入門、實戰與進階
- HTML5+CSS3+JavaScript Web開發案例教程(在線實訓版)
- JavaScript動態網頁開發詳解
- SQL Server 2012數據庫管理與開發項目教程
- Python編程:從入門到實踐
- Visual C++開發入行真功夫
- UVM實戰
- 蘋果的產品設計之道:創建優秀產品、服務和用戶體驗的七個原則
- 微服務架構深度解析:原理、實踐與進階
- Developing SSRS Reports for Dynamics AX
- Hands-On Kubernetes on Windows
- Visual Basic程序設計(第三版)