Skip to content

Чтение предопределенных данных (предопределенных значений)#610

Merged
nixel2007 merged 1 commit into
developfrom
feature/predefined-values
Jun 5, 2026
Merged

Чтение предопределенных данных (предопределенных значений)#610
nixel2007 merged 1 commit into
developfrom
feature/predefined-values

Conversation

@nixel2007

@nixel2007 nixel2007 commented Jun 5, 2026

Copy link
Copy Markdown
Member

Что сделано

Добавлено чтение предопределённых данных (предопределённых значений) для объектов:
Catalog, ChartOfCharacteristicTypes, ChartOfAccounts, ChartOfCalculationTypes, ExchangePlan.

Поддержаны оба формата хранения:

  • Конфигуратор — отдельный файл <Объект>/Ext/Predefined.xml. Читается проактивно (как модули), через новый метод MDReader.readPredefinedData(...); корень PredefinedData разбирает @DesignerConverter PredefinedDataConverter.
  • EDT — встроенный элемент <predefined> в файле объекта. Разбирается в edt/converter/Unmarshaller; обработка включается только для PredefinedDataOwner, поэтому булев <predefined> у регламентных заданий/ботов не задевается.

Элементы (<Item> / <items>) читаются общим рекурсивным common/converter/PredefinedValueConverter (иерархия — ChildItems/вложенные items; код в EDT берётся из вложенного <value>).

Модель

  • mdo/children/PredefinedValueMDChild + ChildrenOwner, поддерживает иерархию (childItems); поля: code, description, folder, дерево;
  • mdo/PredefinedDataOwner — интерфейс-владелец (реализуют 5 объектов выше);
  • mdo/storage/PredefinedData — контейнер для файла Ext/Predefined.xml.

Поведение

  • Предопределённые значения включаются в getChildren()/getPlainChildren() (через LazyLoader);
  • получают mdoReference типа PREDEFINED_VALUE (например Catalog.Справочник1.Predefined.ПредопределённыйЭлемент), owner и наследуют supportVariant владельца — это проставляется в MDReaderContext.build().

Зависимость

Требует bsl-common-library:0.11.0 — в него добавлен новый тип метаданных PREDEFINED_VALUE (обновлено в build.gradle.kts).

Тесты и фикстуры

  • predefinedValues включены в JSON-эталоны (23 файла); дифф — только добавление поля, без сдвигов @reference.
  • Явные ассерты: CatalogTest (Справочник1, оба формата) и ChartOfCharacteristicTypesTest.testPredefined (ssl_3_1, оба формата) — имя/код/наименование/группа/дерево/owner/mdoReference.
  • Счётчики дочерних в ConfigurationTest/ConfigurationTest2 дополнены динамическим слагаемым predefinedCount(...) (предопределённые входят в getPlainChildren()).

Примечание

Фикстура mdclasses_3_24/Configuration_edt.json обновлена под фикс режима совместимости DontUse (8.3.998.99.99), пришедший вместе с подъёмом bsl-common-library на 0.11.0 — к предопределённым не относится.

Дальнейшее (отдельной задачей)

Типоспецифичные поля предопределённых счетов/расчётов (AccountingFlags-значения, ExtDimensionTypes, AccountType, actionPeriodIsBase) + синтетические фикстуры для счетов/расчётов/планов обмена.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for predefined values across catalogs, charts, calculation/characteristic types, and exchange plans
    • Enhanced metadata parsing to read and structure predefined items from configuration files
  • Tests

    • Updated and added tests to validate parsing and ownership of predefined items
  • Dependencies

    • Updated bsl-common-library from 0.10.0 to 0.11.0

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 78c4e46c-6488-4347-a7d6-6bfadd1113b6

📥 Commits

Reviewing files that changed from the base of the PR and between 9b83e9c and 71a8cd5.

⛔ Files ignored due to path filters (23)
  • src/test/resources/fixtures/mdclasses/Catalogs.Справочник1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Catalogs.Справочник1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ChartsOfAccounts.ПланСчетов1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ChartsOfAccounts.ПланСчетов1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ChartsOfCalculationTypes.ПланВидовРасчета1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ChartsOfCharacteristicTypes.ПланВидовХарактеристик1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ChartsOfCharacteristicTypes.ПланВидовХарактеристик1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Configuration.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Configuration_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ExchangePlans.ПланОбмена1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ExchangePlans.ПланОбмена1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_18/Configuration.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_18/Configuration_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_24/Configuration_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_5_1/Configuration.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Catalogs.ВерсииФайлов.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Catalogs.ВерсииФайлов_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Catalogs.Заметки.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Catalogs.Заметки_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/ExchangePlans.ОбновлениеИнформационнойБазы.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/ExchangePlans.ОбновлениеИнформационнойБазы_edt.json is excluded by !src/test/resources/**
📒 Files selected for processing (22)
  • build.gradle.kts
  • src/main/java/com/github/_1c_syntax/bsl/mdo/Catalog.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccounts.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCalculationTypes.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ExchangePlan.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/PredefinedDataOwner.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/children/PredefinedValue.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/storage/PredefinedData.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/utils/LazyLoader.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/MDReader.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/context/MDReaderContext.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/converter/PredefinedValueConverter.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/designer/DesignerReader.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/PredefinedDataConverter.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/MDChildConverter.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/Unmarshaller.java
  • src/test/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationTest2.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CatalogTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypesTest.java
🚧 Files skipped from review as they are similar to previous changes (22)
  • src/main/java/com/github/_1c_syntax/bsl/reader/MDReader.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCalculationTypes.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CatalogTest.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/MDChildConverter.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ExchangePlan.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/storage/PredefinedData.java
  • src/test/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationTest.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/Catalog.java
  • build.gradle.kts
  • src/test/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationTest2.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/converter/PredefinedValueConverter.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/context/MDReaderContext.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/designer/DesignerReader.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/Unmarshaller.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/utils/LazyLoader.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypesTest.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccounts.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/PredefinedDataConverter.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/MDChildConverter.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/children/PredefinedValue.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/PredefinedDataOwner.java

📝 Walkthrough

Walkthrough

This PR adds support for predefined values across metadata catalogs and charts through a new PredefinedDataOwner interface, PredefinedValue child type, and XML unmarshalling from Ext/Predefined.xml for Designer configurations, updating five container types and their tests.

Changes

Predefined Values Support

Layer / File(s) Summary
Core data contracts and models
src/main/java/com/github/_1c_syntax/bsl/mdo/PredefinedDataOwner.java, src/main/java/com/github/_1c_syntax/bsl/mdo/children/PredefinedValue.java, src/main/java/com/github/_1c_syntax/bsl/mdo/storage/PredefinedData.java
PredefinedDataOwner extends ChildrenOwner and declares getPredefinedValues() returning a list. PredefinedValue is a Lombok value type implementing both MDChild and ChildrenOwner, with fields for identity (uuid, name, code), ownership (owner, objectBelonging, supportVariant), hierarchy (childItems, plainChildren), and metadata (description, folder, comment, synonym). PredefinedData container holds a singularly-configurable items list with an EMPTY constant.
Container classes implement predefined values
src/main/java/com/github/_1c_syntax/bsl/mdo/Catalog.java, ChartOfAccounts.java, ChartOfCalculationTypes.java, ChartOfCharacteristicTypes.java, ExchangePlan.java
Five reference types each add PredefinedDataOwner to their interface list and declare a Lombok @Singular predefinedValues field of type List<PredefinedValue> to hold their predefined metadata elements.
XStream converters for XML unmarshalling
src/main/java/com/github/_1c_syntax/bsl/reader/common/converter/PredefinedValueConverter.java, src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/PredefinedDataConverter.java
PredefinedValueConverter unmarshals XML into PredefinedValue by mapping element names to builder fields, parsing the id attribute, and recursively reading child items via ChildItems wrapper. PredefinedDataConverter iterates XML children, converts each Item node to PredefinedValue via context, and builds a PredefinedData container.
Reader interface and Designer implementation
src/main/java/com/github/_1c_syntax/bsl/reader/MDReader.java, src/main/java/com/github/_1c_syntax/bsl/reader/designer/DesignerReader.java
MDReader adds a default method readPredefinedData(...) returning an empty list by default. DesignerReader overrides it to read Ext/Predefined.xml, unmarshal via XStream using PredefinedDataConverter, and return items when found or empty list when missing.
Context integration and reference resolution
src/main/java/com/github/_1c_syntax/bsl/reader/common/context/MDReaderContext.java, src/main/java/com/github/_1c_syntax/bsl/mdo/utils/LazyLoader.java
MDReaderContext.build() detects PredefinedDataOwner implementations and calls setupPredefinedValues() before other population logic. This method reads predefined values from MDReader for Designer source or cache otherwise, transforms each PredefinedValue to rebuild mdoReference and propagate owner/supportVariant, recursively applies transformation to child items, then sets the transformed list into the context. LazyLoader.computeChildren() includes getPredefinedValues() in computed children when the owner implements PredefinedDataOwner.
Format-specific converter exclusions (Designer and EDT)
src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/MDChildConverter.java, src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/MDChildConverter.java, src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/Unmarshaller.java
Designer and EDT MDChildConverter implementations add PredefinedValue type checks to canConvert() to prevent incorrect deserialization routing. EDT Unmarshaller adds special handling for predefined XML nodes: when the target class is assignable to PredefinedDataOwner, it calls readPredefined() instead of generic readNode path, which collects items child nodes as PredefinedValue objects and stores the non-empty list into the context cache.
Dependency update and test coverage
build.gradle.kts, src/test/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationTest.java, ConfigurationTest2.java, src/test/java/com/github/_1c_syntax/bsl/mdo/CatalogTest.java, ChartOfCharacteristicTypesTest.java
Dependency bsl-common-library version updated from 0.10.0 to 0.11.0. Test classes add a predefinedCount() helper to count PredefinedValue instances in plain-children lists, and four test methods in ConfigurationTest are updated to include those counts in expected sizes. CatalogTest extends assertions to verify catalog.getPredefinedValues() returns one predefined value with correct name, UUID, code, description, folder flag, and owner fields. ChartOfCharacteristicTypesTest adds a parameterized test testPredefined() that loads configurations from EDT and Designer resource paths and asserts the chart contains exactly one predefined value with matching MdoReference and owner fields.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • 1c-syntax/mdclasses#523: Both PRs modify MDReaderContext.build() to add new metadata-population flows—main PR for PredefinedDataOwner/predefinedValues, and retrieved PR for standard attributes via StdAttributeFiller—directly connected at the same code path.

Poem

🐰 In fields of XML I nibble and read,
Predefined values sprout where their owners need.
I stitch references, children, and name,
Hop through configs and bring them to frame.
A tiny rabbit, proud of this feed, 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 36.84% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Чтение предопределенных данных (предопределенных значений)' directly describes the main feature added in this PR: support for reading predefined data (predefined values) for various metadata objects.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/predefined-values

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Test Results

  402 files  ± 0    402 suites  ±0   5m 5s ⏱️ -39s
  286 tests + 2    286 ✅ + 2  0 💤 ±0  0 ❌ ±0 
1 776 runs  +12  1 776 ✅ +12  0 💤 ±0  0 ❌ ±0 

Results for commit 71a8cd5. ± Comparison against base commit b377e01.

♻️ This comment has been updated with latest results.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/test/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationTest.java (1)

105-106: ⚡ Quick win

Avoid self-referential expected-size assertions for predefined values.

At Line 105 (and the same pattern on Lines 219, 256, 298), the expected value is derived from cf.getPlainChildren() itself, so a predefined-values regression can still pass. Please assert predefined count separately (fixture-specific expected value or explicit non-zero where expected).

Suggested pattern
-assertThat(cf.getPlainChildren())
-  .hasSize(9810 + predefinedCount(cf.getPlainChildren()))
+var plainChildren = cf.getPlainChildren();
+assertThat(predefinedCount(plainChildren)).isGreaterThan(0); // where fixture guarantees predefined values
+assertThat(plainChildren)
+  .hasSize(9810 + predefinedCount(plainChildren))

Also applies to: 219-220, 256-257, 298-299

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/test/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationTest.java`
around lines 105 - 106, The test currently computes expected size using
predefinedCount(cf.getPlainChildren()), which is self-referential and can hide
regressions; change the assertions in ConfigurationTest (the blocks using
.hasSize(9810 + predefinedCount(cf.getPlainChildren())) and similar at the other
locations) to compare the collection size against a literal or fixture-specific
expected predefined count instead of calling predefinedCount on the same
cf.getPlainChildren() result; compute or hardcode the known predefinedCount
value (or assert it is > 0 explicitly) and then use .hasSize(<explicit expected>
+ <literal predefinedCount>) and keep the .allMatch(md ->
md.getSupportVariant().equals(SupportVariant.NOT_EDITABLE)) check as-is.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/test/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationTest.java`:
- Around line 105-106: The test currently computes expected size using
predefinedCount(cf.getPlainChildren()), which is self-referential and can hide
regressions; change the assertions in ConfigurationTest (the blocks using
.hasSize(9810 + predefinedCount(cf.getPlainChildren())) and similar at the other
locations) to compare the collection size against a literal or fixture-specific
expected predefined count instead of calling predefinedCount on the same
cf.getPlainChildren() result; compute or hardcode the known predefinedCount
value (or assert it is > 0 explicitly) and then use .hasSize(<explicit expected>
+ <literal predefinedCount>) and keep the .allMatch(md ->
md.getSupportVariant().equals(SupportVariant.NOT_EDITABLE)) check as-is.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1b4a453b-1100-4ab9-8518-131b24ebf13a

📥 Commits

Reviewing files that changed from the base of the PR and between b377e01 and 0955bef.

⛔ Files ignored due to path filters (1)
  • src/test/resources/fixtures/mdclasses_3_24/Configuration_edt.json is excluded by !src/test/resources/**
📒 Files selected for processing (23)
  • build.gradle.kts
  • src/main/java/com/github/_1c_syntax/bsl/mdo/Catalog.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccounts.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCalculationTypes.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ExchangePlan.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/PredefinedDataOwner.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/children/PredefinedValue.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/storage/PredefinedData.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/utils/LazyLoader.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/MDReader.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/context/MDReaderContext.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/converter/PredefinedValueConverter.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/designer/DesignerReader.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/PredefinedDataConverter.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/MDChildConverter.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/Unmarshaller.java
  • src/test/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationTest2.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CatalogTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypesTest.java
  • src/test/java/com/github/_1c_syntax/bsl/test_utils/MDTestUtils.java

@nixel2007
nixel2007 force-pushed the feature/predefined-values branch from 0955bef to 9b83e9c Compare June 5, 2026 09:40

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/main/java/com/github/_1c_syntax/bsl/mdo/PredefinedDataOwner.java`:
- Line 35: Add the org.jspecify.annotations.NonNull annotation to the interface
method to declare its non-null contract: import org.jspecify.annotations.NonNull
and annotate the method getPredefinedValues() in PredefinedDataOwner so the
signature becomes annotated with `@NonNull` (ensuring implementors’ `@Singular`
non-null collections are reflected in the interface contract).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 13d732e2-61b5-424f-b81e-55ca6a65fac2

📥 Commits

Reviewing files that changed from the base of the PR and between 0955bef and 9b83e9c.

⛔ Files ignored due to path filters (23)
  • src/test/resources/fixtures/mdclasses/Catalogs.Справочник1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Catalogs.Справочник1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ChartsOfAccounts.ПланСчетов1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ChartsOfAccounts.ПланСчетов1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ChartsOfCalculationTypes.ПланВидовРасчета1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ChartsOfCharacteristicTypes.ПланВидовХарактеристик1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ChartsOfCharacteristicTypes.ПланВидовХарактеристик1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Configuration.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Configuration_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ExchangePlans.ПланОбмена1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ExchangePlans.ПланОбмена1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_18/Configuration.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_18/Configuration_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_24/Configuration_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_5_1/Configuration.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Catalogs.ВерсииФайлов.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Catalogs.ВерсииФайлов_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Catalogs.Заметки.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Catalogs.Заметки_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/ExchangePlans.ОбновлениеИнформационнойБазы.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/ExchangePlans.ОбновлениеИнформационнойБазы_edt.json is excluded by !src/test/resources/**
📒 Files selected for processing (22)
  • build.gradle.kts
  • src/main/java/com/github/_1c_syntax/bsl/mdo/Catalog.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccounts.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCalculationTypes.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ExchangePlan.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/PredefinedDataOwner.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/children/PredefinedValue.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/storage/PredefinedData.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/utils/LazyLoader.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/MDReader.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/context/MDReaderContext.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/converter/PredefinedValueConverter.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/designer/DesignerReader.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/PredefinedDataConverter.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/MDChildConverter.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/Unmarshaller.java
  • src/test/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationTest2.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CatalogTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypesTest.java
🚧 Files skipped from review as they are similar to previous changes (15)
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/MDChildConverter.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccounts.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/MDReader.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/storage/PredefinedData.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/utils/LazyLoader.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/Catalog.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CatalogTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypesTest.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/designer/DesignerReader.java
  • src/test/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationTest.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/converter/PredefinedValueConverter.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/children/PredefinedValue.java
  • src/test/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationTest2.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/PredefinedDataConverter.java

Добавлено чтение предопределенных данных для справочников, планов видов
характеристик, планов счетов, планов видов расчета и планов обмена в обоих
форматах:
- Конфигуратор: отдельный файл <Объект>/Ext/Predefined.xml;
- EDT: встроенный элемент <predefined> в файле объекта.

Модель:
- PredefinedValue (MDChild + ChildrenOwner, поддерживает иерархию childItems);
- интерфейс-владелец PredefinedDataOwner;
- контейнер PredefinedData для файла Ext/Predefined.xml.

Предопределенные значения включаются в getChildren()/getPlainChildren(),
получают mdoReference (тип PREDEFINED_VALUE), owner и наследуют supportVariant
владельца.

Требует bsl-common-library 0.11.0 (новый тип метаданных PREDEFINED_VALUE).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@nixel2007
nixel2007 force-pushed the feature/predefined-values branch from 9b83e9c to 71a8cd5 Compare June 5, 2026 10:44
@sonarqubecloud

sonarqubecloud Bot commented Jun 5, 2026

Copy link
Copy Markdown

@nixel2007
nixel2007 merged commit 2ca9028 into develop Jun 5, 2026
19 checks passed
@nixel2007
nixel2007 deleted the feature/predefined-values branch June 5, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant