Skip to content

Commit 5bece3e

Browse files
📝 Add docstrings to feature/updCommonLib
Docstrings generation was requested by @theshadowco. * #524 (comment) The following files were modified: * `src/main/java/com/github/_1c_syntax/bsl/mdclasses/CF.java` * `src/main/java/com/github/_1c_syntax/bsl/mdclasses/MDClasses.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/Catalog.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/Enum.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/Language.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/storage/form/FormElementType.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/support/ApplicationRunMode.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/support/AutoRecordType.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/support/ConfigurationExtensionPurpose.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/support/DataLockControlMode.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/support/DataSeparation.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/support/DataSetType.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/support/FormType.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/support/Handler.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/support/IndexingType.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/support/InterfaceCompatibilityMode.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/support/MessageDirection.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/support/ObjectBelonging.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/support/ReturnValueReuse.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/support/ReuseSessions.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/support/RoleRight.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/support/TemplateType.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/support/TransferDirection.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/support/UseMode.java` * `src/main/java/com/github/_1c_syntax/bsl/mdo/support/UsePurposes.java` * `src/main/java/com/github/_1c_syntax/bsl/reader/common/context/MDCReaderContext.java` * `src/main/java/com/github/_1c_syntax/bsl/reader/common/converter/DataSetConverter.java` * `src/main/java/com/github/_1c_syntax/bsl/reader/common/converter/EnumConverter.java` * `src/main/java/com/github/_1c_syntax/bsl/reader/common/converter/SubsystemConverter.java` * `src/main/java/com/github/_1c_syntax/bsl/reader/common/converter/ValueTypeConverter.java` * `src/main/java/com/github/_1c_syntax/bsl/reader/common/converter/ValueTypeDescriptionConverter.java` * `src/main/java/com/github/_1c_syntax/bsl/reader/common/converter/ValueTypeQualifierConverter.java` * `src/main/java/com/github/_1c_syntax/bsl/reader/common/xstream/ExtendXStream.java` * `src/main/java/com/github/_1c_syntax/bsl/reader/designer/DesignerReader.java` * `src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/FormElementConverter.java` * `src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/MDChildConverter.java` * `src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/TemplateConverter.java` * `src/main/java/com/github/_1c_syntax/bsl/reader/edt/EDTReader.java` * `src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/ExternalDataSourceTableConverter.java` * `src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/FormItemConverter.java` * `src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/ObjectTemplateConverter.java` * `src/test/java/com/github/_1c_syntax/bsl/test_utils/MDTestUtils.java`
1 parent 67d2fa5 commit 5bece3e

Some content is hidden

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

43 files changed

+586
-133
lines changed

src/main/java/com/github/_1c_syntax/bsl/mdclasses/CF.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,11 @@ default List<Subsystem> includedSubsystems(MD md, boolean addParentSubsystem) {
146146
}
147147

148148
/**
149-
* Возвращает список подсистем, в состав которых входит ссылка
149+
* List subsystems that include the specified metadata reference.
150150
*
151-
* @param mdoReference ссылка на объект метаданных
152-
* @param addParentSubsystem - признак необходимости добавлять родительскую (текущую) подсистему в список,
153-
* если объект присутствует в дочерних.
154-
* Используется для кейса: раз есть в дочерней, то считаем что и ко всем родителям
155-
* тоже относится
156-
* @return список подсистем
151+
* @param mdoReference the metadata object reference to search for
152+
* @param addParentSubsystem if true, include parent (containing) subsystems when the reference is present in a child subsystem
153+
* @return a list of subsystems that include the given reference (may be empty)
157154
*/
158155
default List<Subsystem> includedSubsystems(MdoReference mdoReference, boolean addParentSubsystem) {
159156
return getSubsystems().parallelStream()
@@ -196,4 +193,4 @@ default Optional<MD> findChild(MdoReference ref) {
196193
default Optional<CommonModule> findCommonModule(String name) {
197194
return Optional.ofNullable(getCommonModulesByName().get(name));
198195
}
199-
}
196+
}

src/main/java/com/github/_1c_syntax/bsl/mdclasses/MDClasses.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@ private List<Path> findFiles(Path sourcePath, Pattern pattern) {
190190
return listPath;
191191
}
192192

193+
/**
194+
* Collects the group names of MDO types to be used for exclusion filters.
195+
*
196+
* <p>Excludes the EXTERNAL_REPORT, EXTERNAL_DATA_PROCESSOR, and UNKNOWN types.</p>
197+
*
198+
* @return a set of group-name strings for all included MDOType values
199+
*/
193200
private Set<String> mdoTypeGroupNames() {
194201
return Arrays.stream(MDOType.values())
195202
.filter(type -> type != MDOType.EXTERNAL_REPORT
@@ -199,4 +206,4 @@ private Set<String> mdoTypeGroupNames() {
199206
.map(MDOType::groupName)
200207
.collect(Collectors.toSet());
201208
}
202-
}
209+
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ public class Catalog implements ReferenceObject, AccessRightsOwner {
109109
@Singular("addOwners")
110110
List<MdoReference> owners;
111111

112+
/**
113+
* Retrieve the catalog's child metadata objects.
114+
*
115+
* @return the list of child MD objects for this catalog, computed on first access and cached for subsequent calls
116+
*/
112117
@Override
113118
public List<MD> getChildren() {
114119
return children.getOrCompute();
@@ -190,4 +195,4 @@ private static List<RoleRight> computePossibleRights() {
190195
RoleRight.SWITCH_TO_DATA_HISTORY_VERSION
191196
);
192197
}
193-
}
198+
}

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,22 @@ private List<MD> computePlainStorageFields() {
161161
return LazyLoader.computePlainStorageFields(this);
162162
}
163163

164+
/**
165+
* Compute the complete list of modules associated with this chart of characteristic types.
166+
*
167+
* @return the list of all modules that apply to this object, possibly empty
168+
*/
164169
private List<Module> computeAllModules() {
165170
return LazyLoader.computeAllModules(this);
166171
}
167172

173+
/**
174+
* Gets the value type description for this chart of characteristic types.
175+
*
176+
* @return the ValueTypeDescription describing this object's value type
177+
*/
168178
@Override
169179
public ValueTypeDescription getValueType() {
170180
return type;
171181
}
172-
}
182+
}

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,23 @@ public List<Module> getAllModules() {
134134
return allModules.getOrCompute();
135135
}
136136

137+
/**
138+
* Compute the list of all modules associated with this Enum.
139+
*
140+
* @return a list of Module objects representing all modules belonging to this Enum; empty list if there are none
141+
*/
137142
private List<Module> computeAllModules() {
138143
return LazyLoader.computeAllModules(this);
139144
}
140145

146+
/**
147+
* Returns the list of attributes declared on this enum.
148+
*
149+
* @return the list of attributes for this enum
150+
*/
141151
@Override
142152
public List<Attribute> getAllAttributes() {
143153
return getAttributes();
144154
}
145155

146-
}
156+
}

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ public static Language defaultLanguage() {
9595
return defaultLanguage(ScriptVariant.RUSSIAN);
9696
}
9797

98+
/**
99+
* Creates a Language instance with the provided display name and language code.
100+
*
101+
* @param name the display name of the language
102+
* @param code the language code used for synonym and languageCode fields
103+
* @return a Language configured with the given name and code; synonym is initialized and mdoReference is configured for MDOType.LANGUAGE
104+
*/
98105
private static Language newLanguage(String name, String code) {
99106
return Language.builder()
100107
.name(name)
@@ -107,4 +114,4 @@ private static Language newLanguage(String name, String code) {
107114
.languageCode(code)
108115
.build();
109116
}
110-
}
117+
}

src/main/java/com/github/_1c_syntax/bsl/mdo/storage/form/FormElementType.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,21 @@ public enum FormElementType implements EnumWithName {
8484
@Accessors(fluent = true)
8585
private final MultiName fullName;
8686

87+
/**
88+
* Initializes the enum constant with localized display names.
89+
*
90+
* @param nameEn the English display name for the element
91+
* @param nameRu the Russian display name for the element
92+
*/
8793
FormElementType(String nameEn, String nameRu) {
8894
this.fullName = MultiName.create(nameEn, nameRu);
8995
}
9096

9197
/**
92-
* Ищет элемент перечисления по именам (рус, анг)
98+
* Finds a FormElementType by its English or Russian name.
9399
*
94-
* @param string Имя искомого элемента
95-
* @return Найденное значение, если не найден - то UNKNOWN
100+
* @param string the English or Russian name to look up (case-insensitive)
101+
* @return the matching FormElementType, or {@code UNKNOWN} if no match is found; a warning is logged when no match is found
96102
*/
97103
public static FormElementType valueByName(String string) {
98104
var result = KEYS.getOrDefault(string.toLowerCase(Locale.ROOT), UNKNOWN);
@@ -101,4 +107,4 @@ public static FormElementType valueByName(String string) {
101107
}
102108
return result;
103109
}
104-
}
110+
}

src/main/java/com/github/_1c_syntax/bsl/mdo/support/ApplicationRunMode.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,23 @@ public enum ApplicationRunMode implements EnumWithName {
4646
@Accessors(fluent = true)
4747
private final MultiName fullName;
4848

49+
/**
50+
* Create an ApplicationRunMode with the given English and Russian display names.
51+
*
52+
* @param nameEn the English name for the mode
53+
* @param nameRu the Russian name for the mode
54+
*/
4955
ApplicationRunMode(String nameEn, String nameRu) {
5056
this.fullName = MultiName.create(nameEn, nameRu);
5157
}
5258

5359
/**
54-
* Ищет элемент перечисления по именам (рус, анг)
60+
* Finds an ApplicationRunMode by its English or Russian name (case-insensitive).
5561
*
56-
* @param string Имя искомого элемента
57-
* @return Найденное значение, если не найден - то UNKNOWN
62+
* @param string English or Russian name of the mode to look up
63+
* @return the matching ApplicationRunMode, or UNKNOWN if no match is found
5864
*/
5965
public static ApplicationRunMode valueByName(String string) {
6066
return KEYS.getOrDefault(string.toLowerCase(Locale.ROOT), UNKNOWN);
6167
}
62-
}
68+
}

src/main/java/com/github/_1c_syntax/bsl/mdo/support/AutoRecordType.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,24 @@ public enum AutoRecordType implements EnumWithName {
4545
@Accessors(fluent = true)
4646
private final MultiName fullName;
4747

48+
/**
49+
* Creates an enum constant with the given English and Russian display names.
50+
*
51+
* @param nameEn the English name for the enum constant
52+
* @param nameRu the Russian name for the enum constant
53+
*/
4854
AutoRecordType(String nameEn, String nameRu) {
4955
this.fullName = MultiName.create(nameEn, nameRu);
5056
}
5157

5258

53-
/**
54-
* Ищет элемент перечисления по именам (рус, анг)
55-
*
56-
* @param string Имя искомого элемента
57-
* @return Найденное значение, если не найден - то UNKNOWN
59+
/**
60+
* Finds the enum constant matching the given English or Russian name (case-insensitive).
61+
*
62+
* @param string the name to look up (English or Russian, case-insensitive)
63+
* @return the matching {@code AutoRecordType}, or {@code UNKNOWN} if no match is found
5864
*/
5965
public static AutoRecordType valueByName(String string) {
6066
return KEYS.getOrDefault(string.toLowerCase(Locale.ROOT), UNKNOWN);
6167
}
62-
}
68+
}

src/main/java/com/github/_1c_syntax/bsl/mdo/support/ConfigurationExtensionPurpose.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,25 @@ public enum ConfigurationExtensionPurpose implements EnumWithName {
4747
@Accessors(fluent = true)
4848
private final MultiName fullName;
4949

50+
/**
51+
* Creates an enum constant with the specified English and Russian names.
52+
*
53+
* @param nameEn the English name for the enum constant
54+
* @param nameRu the Russian name for the enum constant
55+
*/
5056
ConfigurationExtensionPurpose(String nameEn, String nameRu) {
5157
this.fullName = MultiName.create(nameEn, nameRu);
5258
}
5359

54-
/**
55-
* Ищет элемент перечисления по именам (рус, анг)
56-
*
57-
* @param string Имя искомого элемента
58-
* @return Найденное значение, если не найден - то UNKNOWN
60+
/**
61+
* Finds an enum constant by its English or Russian name.
62+
*
63+
* <p>Lookup is case-insensitive (uses Locale.ROOT).</p>
64+
*
65+
* @param string the English or Russian name to look up
66+
* @return `UNKNOWN` if no match is found, otherwise the matching enum constant
5967
*/
6068
public static ConfigurationExtensionPurpose valueByName(String string) {
6169
return KEYS.getOrDefault(string.toLowerCase(Locale.ROOT), UNKNOWN);
6270
}
63-
}
71+
}

0 commit comments

Comments
 (0)