Skip to content

Commit 4293cc2

Browse files
committed
updated fields to match bo4e-standard
1 parent 51ded8b commit 4293cc2

4 files changed

Lines changed: 42 additions & 43 deletions

File tree

README.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ to [BO4E-Java](https://github.com/TimoMolls/BO4E-Java).
1212

1313
## Options
1414

15-
| name | alias | type | description |
16-
|----------|-------|-----------|---------------------------------------------------------------------------------|
17-
| input | i | string | The input directory that holds the json-schemas and defines the file structure. |
18-
| output | o | string | The output directory. |
19-
| package | p | string... | The package to put in the classes package signature (default: same as output). |
20-
| keep | k | boolean | Prevent overwriting of existing files. |
21-
| remove | r | boolean | Delete all existing files in output directory. |
22-
| create | c | boolean | Create output directory if it does not exist. |
23-
| annotate | a | boolean | Add JsonInclude Annotations. |
24-
| verbose | v | boolean | Turn on debugging output. |
25-
| quiet | q | boolean | Silence output. |
26-
| help | h | boolean | Display an usage guide. |
15+
| name | alias | type | description |
16+
|----------|-------|---------|---------------------------------------------------------------------------------|
17+
| input | i | string | The input directory that holds the json-schemas and defines the file structure. |
18+
| output | o | string | The output directory. |
19+
| package | p | string | The package to put in the classes package signature (default: same as output). |
20+
| keep | k | boolean | Prevent overwriting of existing files. |
21+
| remove | r | boolean | Delete all existing files in output directory. |
22+
| create | c | boolean | Create output directory if it does not exist. |
23+
| annotate | a | boolean | Add JsonInclude Annotations. |
24+
| verbose | v | boolean | Turn on debugging output. |
25+
| quiet | q | boolean | Silence output. |
26+
| help | h | boolean | Display an usage guide. |
2727

2828
## Important to note
2929

@@ -33,6 +33,5 @@ to [BO4E-Java](https://github.com/TimoMolls/BO4E-Java).
3333
- all classes in *bo* extend **Geschaeftsobjekt**
3434
- all classes in *com* extend **COM**
3535
- **Geschaeftsobjekt** and **COM** are added, even if not included in the *schemas*
36-
- *version* was renamed to **boVersion** since there already is a version field in **Lastgang**
3736
- every class has a *no-args-constructor* and a **Builder** but no *all-args-constructor*
3837
- Comments are copied from the schemas, their correctness is not validated

quicktype.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ async function processCommandLineArguments() {
232232
TARGET_DIR_PATH = options['output'];
233233
}
234234
SOURCE_DIR_PATH = options['input'];
235-
PACKAGE_NAME = (options['package'] && options['package'].length > 0) ? options['package'].join('.') : TARGET_DIR_PATH.replaceAll('/', '.');
235+
PACKAGE_NAME = (options['package'] && options['package'].length > 0) ? options['package'] : TARGET_DIR_PATH.replaceAll('/', '.');
236236
USE_ANNOTATIONS = !!options['annotate'];
237237
VERBOSE = !!options['verbose'];
238238
QUIET = !!options['quiet'];
@@ -643,11 +643,11 @@ function addTypeToFieldsAndMethods(fieldList, javaMethodList, fileData) {
643643
}
644644
}
645645
const field = {
646-
name: `typ = Typ.${type}`,
646+
name: `_typ = Typ.${type}`,
647647
type: 'Typ',
648648
description: '/**\n* Typ des Geschaeftsobjekts\n*/'
649649
};
650-
javaMethodList.unshift('', getJavaMethod({name: 'typ', type: 'Typ'}));
650+
javaMethodList.unshift('', getJavaMethod({name: '_typ', type: 'Typ'}));
651651
fieldList.unshift(field);
652652
}
653653

resource_schemas/COM.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,34 @@
1616
* <https://json-schema.app/view/%23?url=https://raw.githubusercontent.com/Hochfrequenz/BO4E-Schemas/v202401.0.1-/src/bo4e_schemas/com/COM.json>`_
1717
*/
1818
public abstract class COM {
19-
private String id;
20-
private final String boVersion = versionPlaceholder;
19+
private String _id;
20+
private final String _version = versionPlaceholder;
2121
private List<ZusatzAttribut> zusatzAttribute;
2222

2323
protected COM(COMBuilder builder) {
24-
this.id = builder.id;
24+
this._id = builder._id;
2525
this.zusatzAttribute = builder.zusatzAttribute;
2626
}
2727

2828
/**
2929
* Hier können IDs anderer Systeme hinterlegt werden (z.B. eine SAP-GP-Nummer oder eine GUID)
3030
*/
31-
public String getId() {
32-
return id;
31+
public String get_id() {
32+
return _id;
3333
}
3434

3535
/**
3636
* Hier können IDs anderer Systeme hinterlegt werden (z.B. eine SAP-GP-Nummer oder eine GUID)
3737
*/
38-
public void setId(String value) {
39-
this.id = value;
38+
public void set_id(String value) {
39+
this._id = value;
4040
}
4141

4242
/**
4343
* Version der BO-Struktur aka "fachliche Versionierung"
4444
*/
45-
public String getBoVersion() {
46-
return boVersion;
45+
public String get_version() {
46+
return _version;
4747
}
4848

4949
public List<ZusatzAttribut> getZusatzAttribute() {
@@ -55,7 +55,7 @@ public void setZusatzAttribute(List<ZusatzAttribut> value) {
5555
}
5656

5757
public abstract static class COMBuilder {
58-
private String id;
58+
private String _id;
5959
private List<ZusatzAttribut> zusatzAttribute;
6060

6161
private COMBuilder() {
@@ -64,8 +64,8 @@ private COMBuilder() {
6464
/**
6565
* Hier können IDs anderer Systeme hinterlegt werden (z.B. eine SAP-GP-Nummer oder eine GUID)
6666
*/
67-
public COMBuilder setId(String value) {
68-
this.id = value;
67+
public COMBuilder set_id(String value) {
68+
this._id = value;
6969
return this;
7070
}
7171

resource_schemas/Geschaeftsobjekt.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,42 @@
1919
* <https://json-schema.app/view/%23?url=https://raw.githubusercontent.com/Hochfrequenz/BO4E-Schemas/v202401.0.1-/src/bo4e_schemas/bo/Geschaeftsobjekt.json>`_
2020
*/
2121
public abstract class Geschaeftsobjekt {
22-
private String id;
23-
private final Typ typ = Typ.GESCHAEFTSOBJEKT;
24-
private final String boVersion = versionPlaceholder;
22+
private String _id;
23+
private final Typ _typ = Typ.GESCHAEFTSOBJEKT;
24+
private final String _version = versionPlaceholder;
2525
private List<ZusatzAttribut> zusatzAttribute;
2626

2727
protected Geschaeftsobjekt(GeschaeftsobjektBuilder builder) {
28-
this.id = builder.id;
28+
this._id = builder._id;
2929
this.zusatzAttribute = builder.zusatzAttribute;
3030
}
3131

3232
/**
3333
* Hier können IDs anderer Systeme hinterlegt werden (z.B. eine SAP-GP-Nummer oder eine GUID)
3434
*/
35-
public String getId() {
36-
return id;
35+
public String get_id() {
36+
return _id;
3737
}
3838

3939
/**
4040
* Hier können IDs anderer Systeme hinterlegt werden (z.B. eine SAP-GP-Nummer oder eine GUID)
4141
*/
42-
public void setId(String value) {
43-
this.id = value;
42+
public void set_id(String value) {
43+
this._id = value;
4444
}
4545

4646
/**
4747
* Typ des Geschaeftsobjekts
4848
*/
49-
public Typ getTyp() {
50-
return typ;
49+
public Typ get_typ() {
50+
return _typ;
5151
}
5252

5353
/**
5454
* Version der BO-Struktur aka "fachliche Versionierung"
5555
*/
56-
public String getBoVersion() {
57-
return boVersion;
56+
public String get_version() {
57+
return _version;
5858
}
5959

6060
public List<ZusatzAttribut> getZusatzAttribute() {
@@ -66,14 +66,14 @@ public void setZusatzAttribute(List<ZusatzAttribut> value) {
6666
}
6767

6868
public abstract static class GeschaeftsobjektBuilder {
69-
private String id;
69+
private String _id;
7070
private List<ZusatzAttribut> zusatzAttribute;
7171

7272
/**
7373
* Hier können IDs anderer Systeme hinterlegt werden (z.B. eine SAP-GP-Nummer oder eine GUID)
7474
*/
75-
public GeschaeftsobjektBuilder setId(String value) {
76-
this.id = value;
75+
public GeschaeftsobjektBuilder set_id(String value) {
76+
this._id = value;
7777
return this;
7878
}
7979

0 commit comments

Comments
 (0)