Skip to content

Commit a8af664

Browse files
authored
Merge pull request #440 from 1c-syntax/feature/Explanation
Представление и описание
2 parents 70f005e + a5311a3 commit a8af664

File tree

91 files changed

+1214
-736
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1214
-736
lines changed

src/main/java/com/github/_1c_syntax/bsl/mdo/AccountingRegister.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,10 @@ public class AccountingRegister implements Register {
8888
* Свое
8989
*/
9090

91+
/**
92+
* Пояснение
93+
*/
94+
@Default
95+
MultiLanguageString explanation = MultiLanguageString.EMPTY;
96+
9197
}

src/main/java/com/github/_1c_syntax/bsl/mdo/AccumulationRegister.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ public class AccumulationRegister implements Register {
8888
* Свое
8989
*/
9090

91+
/**
92+
* Пояснение
93+
*/
94+
@Default
95+
MultiLanguageString explanation = MultiLanguageString.EMPTY;
96+
9197
}
9298

9399

src/main/java/com/github/_1c_syntax/bsl/mdo/BusinessProcess.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,11 @@ public class BusinessProcess implements ReferenceObject {
8484
* Свое
8585
*/
8686

87+
/**
88+
* Пояснение
89+
*/
90+
@Default
91+
MultiLanguageString explanation = MultiLanguageString.EMPTY;
92+
93+
8794
}

src/main/java/com/github/_1c_syntax/bsl/mdo/CalculationRegister.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ public class CalculationRegister implements Register {
9393
@Singular
9494
List<Recalculation> recalculations;
9595

96+
/**
97+
* Пояснение
98+
*/
99+
@Default
100+
MultiLanguageString explanation = MultiLanguageString.EMPTY;
101+
96102
@Override
97103
@NonNull
98104
public List<MD> getChildren() {

src/main/java/com/github/_1c_syntax/bsl/mdo/Catalog.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,11 @@ public class Catalog implements ReferenceObject {
8484
/*
8585
* Свое
8686
*/
87+
88+
/**
89+
* Пояснение
90+
*/
91+
@Default
92+
MultiLanguageString explanation = MultiLanguageString.EMPTY;
93+
8794
}

src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccounts.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ public class ChartOfAccounts implements ReferenceObject {
101101
@Singular
102102
List<ExtDimensionAccountingFlag> extDimensionAccountingFlags;
103103

104+
/**
105+
* Пояснение
106+
*/
107+
@Default
108+
MultiLanguageString explanation = MultiLanguageString.EMPTY;
109+
104110
@Override
105111
public @NonNull List<Attribute> getAllAttributes() {
106112
var allAttributes = new ArrayList<>(ReferenceObject.super.getAllAttributes());

src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCalculationTypes.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,10 @@ public class ChartOfCalculationTypes implements ReferenceObject {
8585
* Свое
8686
*/
8787

88+
/**
89+
* Пояснение
90+
*/
91+
@Default
92+
MultiLanguageString explanation = MultiLanguageString.EMPTY;
93+
8894
}

src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,10 @@ public class ChartOfCharacteristicTypes implements ReferenceObject {
8585
* Свое
8686
*/
8787

88+
/**
89+
* Пояснение
90+
*/
91+
@Default
92+
MultiLanguageString explanation = MultiLanguageString.EMPTY;
93+
8894
}

src/main/java/com/github/_1c_syntax/bsl/mdo/Constant.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,10 @@ public class Constant implements MDObject, ModuleOwner {
7676
*/
7777
boolean passwordMode;
7878

79+
/**
80+
* Пояснение
81+
*/
82+
@Default
83+
MultiLanguageString explanation = MultiLanguageString.EMPTY;
84+
7985
}

src/main/java/com/github/_1c_syntax/bsl/mdo/DataProcessor.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ public class DataProcessor implements MDObject, ModuleOwner, CommandOwner, Attri
111111
* Свое
112112
*/
113113

114+
/**
115+
* Пояснение
116+
*/
117+
@Default
118+
MultiLanguageString explanation = MultiLanguageString.EMPTY;
119+
120+
114121
@Override
115122
@NonNull
116123
public List<Attribute> getAllAttributes() {

src/main/java/com/github/_1c_syntax/bsl/mdo/Document.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,11 @@ public class Document implements ReferenceObject {
9090
*/
9191
@Singular("addRegisterRecords")
9292
List<MdoReference> registerRecords;
93+
94+
/**
95+
* Пояснение
96+
*/
97+
@Default
98+
MultiLanguageString explanation = MultiLanguageString.EMPTY;
99+
93100
}

src/main/java/com/github/_1c_syntax/bsl/mdo/DocumentJournal.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ public class DocumentJournal implements MDObject, ModuleOwner, CommandOwner, Att
111111
@Singular("addRegisteredDocuments")
112112
List<MdoReference> registeredDocuments;
113113

114+
/**
115+
* Пояснение
116+
*/
117+
@Default
118+
MultiLanguageString explanation = MultiLanguageString.EMPTY;
119+
114120
@Override
115121
@NonNull
116122
public List<Attribute> getAllAttributes() {

src/main/java/com/github/_1c_syntax/bsl/mdo/Enum.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,18 @@ public class Enum implements MDObject, ModuleOwner, CommandOwner, FormOwner, Tem
9898
* Свое
9999
*/
100100

101-
102101
/**
103102
* Элементы перечисления
104103
*/
105104
@Singular
106105
List<EnumValue> enumValues;
107106

107+
/**
108+
* Пояснение
109+
*/
110+
@Default
111+
MultiLanguageString explanation = MultiLanguageString.EMPTY;
112+
108113
@Override
109114
@NonNull
110115
public List<MD> getChildren() {

src/main/java/com/github/_1c_syntax/bsl/mdo/ExchangePlan.java

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
/*
2-
* This file is a part of MDClasses.
3-
*
4-
* Copyright (c) 2019 - 2024
5-
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors
6-
*
7-
* SPDX-License-Identifier: LGPL-3.0-or-later
8-
*
9-
* MDClasses is free software; you can redistribute it and/or
10-
* modify it under the terms of the GNU Lesser General Public
11-
* License as published by the Free Software Foundation; either
12-
* version 3.0 of the License, or (at your option) any later version.
13-
*
14-
* MDClasses is distributed in the hope that it will be useful,
15-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17-
* Lesser General Public License for more details.
18-
*
19-
* You should have received a copy of the GNU Lesser General Public
20-
* License along with MDClasses.
21-
*/
22-
package com.github._1c_syntax.bsl.mdo;
1+
/*
2+
* This file is a part of MDClasses.
3+
*
4+
* Copyright (c) 2019 - 2024
5+
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors
6+
*
7+
* SPDX-License-Identifier: LGPL-3.0-or-later
8+
*
9+
* MDClasses is free software; you can redistribute it and/or
10+
* modify it under the terms of the GNU Lesser General Public
11+
* License as published by the Free Software Foundation; either
12+
* version 3.0 of the License, or (at your option) any later version.
13+
*
14+
* MDClasses is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17+
* Lesser General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Lesser General Public
20+
* License along with MDClasses.
21+
*/
22+
package com.github._1c_syntax.bsl.mdo;
2323

2424
import com.github._1c_syntax.bsl.mdo.children.ObjectCommand;
2525
import com.github._1c_syntax.bsl.mdo.children.ObjectForm;
@@ -102,6 +102,12 @@ public class ExchangePlan implements ReferenceObject {
102102
@Singular("addContent")
103103
List<RecordContent> content;
104104

105+
/**
106+
* Пояснение
107+
*/
108+
@Default
109+
MultiLanguageString explanation = MultiLanguageString.EMPTY;
110+
105111
/**
106112
* Проверяет наличие объекта в составе плана обмена (вне зависимости от режима авторегистрации)
107113
*

src/main/java/com/github/_1c_syntax/bsl/mdo/ExternalDataSource.java

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
/*
2-
* This file is a part of MDClasses.
3-
*
4-
* Copyright (c) 2019 - 2024
5-
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors
6-
*
7-
* SPDX-License-Identifier: LGPL-3.0-or-later
8-
*
9-
* MDClasses is free software; you can redistribute it and/or
10-
* modify it under the terms of the GNU Lesser General Public
11-
* License as published by the Free Software Foundation; either
12-
* version 3.0 of the License, or (at your option) any later version.
13-
*
14-
* MDClasses is distributed in the hope that it will be useful,
15-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17-
* Lesser General Public License for more details.
18-
*
19-
* You should have received a copy of the GNU Lesser General Public
20-
* License along with MDClasses.
21-
*/
22-
package com.github._1c_syntax.bsl.mdo;
1+
/*
2+
* This file is a part of MDClasses.
3+
*
4+
* Copyright (c) 2019 - 2024
5+
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors
6+
*
7+
* SPDX-License-Identifier: LGPL-3.0-or-later
8+
*
9+
* MDClasses is free software; you can redistribute it and/or
10+
* modify it under the terms of the GNU Lesser General Public
11+
* License as published by the Free Software Foundation; either
12+
* version 3.0 of the License, or (at your option) any later version.
13+
*
14+
* MDClasses is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17+
* Lesser General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Lesser General Public
20+
* License along with MDClasses.
21+
*/
22+
package com.github._1c_syntax.bsl.mdo;
2323

2424
import com.github._1c_syntax.bsl.mdo.children.ExternalDataSourceTable;
2525
import com.github._1c_syntax.bsl.mdo.support.MultiLanguageString;
@@ -72,6 +72,12 @@ public class ExternalDataSource implements MDObject, ChildrenOwner {
7272
@Singular
7373
List<ExternalDataSourceTable> tables;
7474

75+
/**
76+
* Пояснение
77+
*/
78+
@Default
79+
MultiLanguageString explanation = MultiLanguageString.EMPTY;
80+
7581
// todo сделать функции и кубы
7682

7783
@Override

src/main/java/com/github/_1c_syntax/bsl/mdo/FilterCriterion.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,10 @@ public class FilterCriterion implements MDObject, ModuleOwner, CommandOwner, For
8787
* Свое
8888
*/
8989

90+
/**
91+
* Пояснение
92+
*/
93+
@Default
94+
MultiLanguageString explanation = MultiLanguageString.EMPTY;
95+
9096
}

src/main/java/com/github/_1c_syntax/bsl/mdo/InformationRegister.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,11 @@ public class InformationRegister implements Register {
8787
/*
8888
* Свое
8989
*/
90+
91+
/**
92+
* Пояснение
93+
*/
94+
@Default
95+
MultiLanguageString explanation = MultiLanguageString.EMPTY;
96+
9097
}

src/main/java/com/github/_1c_syntax/bsl/mdo/MD.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,33 @@ default MDOType getMdoType() {
7575
*/
7676
String getComment();
7777

78+
/**
79+
* Представление объекта, формируемое на основании синонима для русского языка.
80+
* Если синонима для русского нет, вернет иной синоним при его наличии. В противном случае вернет имя.
81+
*/
82+
default String getDescription() {
83+
return getDescription("ru");
84+
}
85+
86+
/**
87+
* Представление объекта, формируемое на основании синонима для указанного языка.
88+
* Если синонима для указанного языка нет, вернет иной синоним при его наличии. В противном случае вернет имя.
89+
*
90+
* @param code Код языка
91+
*/
92+
default String getDescription(String code) {
93+
if (getSynonym().isEmpty()) {
94+
return getName();
95+
}
96+
var description = getSynonym().get(code);
97+
if (description.isEmpty()) {
98+
description = getSynonym().getAny();
99+
}
100+
101+
if (description.isEmpty()) {
102+
description = getName();
103+
}
104+
105+
return description;
106+
}
78107
}

src/main/java/com/github/_1c_syntax/bsl/mdo/Report.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ public class Report implements MDObject, ModuleOwner, CommandOwner, AttributeOwn
111111
* Свое
112112
*/
113113

114+
/**
115+
* Пояснение
116+
*/
117+
@Default
118+
MultiLanguageString explanation = MultiLanguageString.EMPTY;
119+
114120
@Override
115121
@NonNull
116122
public List<Attribute> getAllAttributes() {

0 commit comments

Comments
 (0)