-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
26 lines (24 loc) · 936 Bytes
/
Main.java
File metadata and controls
26 lines (24 loc) · 936 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package src;
public class Main {
public static void main(String[] args) {
Generator generator = new GeneratorJava();
String result = generator
.createSomeText("// generated by Vadim")
.createClass("Main", Modificator.PUBLIC)
.createField("name", "Vadim", Type.STRING, Modificator.PRIVATE)
.createField("age", 19, Type.INT, Modificator.PRIVATE)
.generate();
System.out.println(result);
try {
Field field = new Field.Builder()
.setModificator(Modificator.PRIVATE)
.setType(Type.STRING)
.setName("city")
.setValue("Volgograd")
.build();
System.out.println(field);
} catch (EmptyNameException e) {
System.out.println("Ошибка: " + e.getMessage());
}
}
}