Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ dependencies {

implementation("com.thoughtworks.xstream:xstream:1.4.21")

// JAXB (Jakarta) for Designer XML write via XSD-generated classes
implementation("jakarta.xml.bind:jakarta.xml.bind-api:4.0.2")
implementation("org.glassfish.jaxb:jaxb-runtime:4.0.5")

// логирование
implementation("org.slf4j:slf4j-api:2.0.16")

Expand Down Expand Up @@ -89,13 +93,55 @@ dependencies {
jmhAnnotationProcessor("org.openjdk.jmh:jmh-generator-annprocess:1.37")
}

val xjcOutputMDClasses = layout.buildDirectory.dir("generated/sources/xjc-mdclasses")
val xsdV85Dir = layout.projectDirectory.dir("src/main/xsd/v8.5")

val xjc by configurations.creating
dependencies {
xjc("org.glassfish.jaxb:jaxb-xjc:4.0.5")
xjc("org.glassfish.jaxb:jaxb-runtime:4.0.5")
}

tasks.register<JavaExec>("xjcMDClasses") {
group = "Build"
description = "Generate JAXB classes from v8.5 MDClasses XSD"
classpath = xjc
mainClass = "com.sun.tools.xjc.Driver"
workingDir = xsdV85Dir.asFile
doFirst {
args(
"-extension",
"-catalog", "catalog.xml",
"-b", "bindings.xjb",
"-d", xjcOutputMDClasses.get().asFile.absolutePath,
"v8.1c.ru-8.3-MDClasses.xsd"
)
}
inputs.dir(xsdV85Dir)
outputs.dir(xjcOutputMDClasses)
}

tasks.compileJava {
dependsOn("xjcMDClasses")
}

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
withSourcesJar()
withJavadocJar()
}

sourceSets["main"].java.srcDir(xjcOutputMDClasses)

tasks.named("sourcesJar") {
dependsOn("xjcMDClasses")
}

tasks.named("licenseMain") {
dependsOn("xjcMDClasses")
}

jmh {
warmupIterations = 3
iterations = 5
Expand Down Expand Up @@ -172,6 +218,7 @@ license {
ext["project"] = "MDClasses"
mapping("java", "SLASHSTAR_STYLE")
include("**/*.java")
exclude("**/jaxb/**")
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* This file is a part of MDClasses.
*
* Copyright (c) 2019 - 2026
* Tymko Oleg <olegtymko@yandex.ru>, Maximov Valery <maximovvalery@gmail.com> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
package com.github._1c_syntax.bsl.mdclasses.jaxb.write;

import com.github._1c_syntax.bsl.mdo.AccountingRegister;
import com.github._1c_syntax.bsl.mdo.children.ObjectForm;
import com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.AccountingRegisterChildObjects;
import com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.AccountingRegisterProperties;
import com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.MetaDataObject;
import com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.ObjectFactory;

import java.math.BigDecimal;

/**
* Преобразует регистр бухгалтерии mdclasses в JAXB-DTO для записи Designer XML.
*/
public final class AccountingRegisterToJaxbConverter {

private static final ObjectFactory FACTORY = new ObjectFactory();

private AccountingRegisterToJaxbConverter() {
}

/**
* Собирает JAXB MetaDataObject из регистра бухгалтерии.
*
* @param ar регистр бухгалтерии из модели mdclasses
* @return корневой элемент для маршаллинга в Designer XML
*/
public static MetaDataObject toMetaDataObject(AccountingRegister ar) {
MetaDataObject root = FACTORY.createMetaDataObject();
root.setVersion(JaxbWriteDefaults.DEFAULT_FORMAT_VERSION);
com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.AccountingRegister inner = FACTORY.createAccountingRegister();
inner.setUuid(ar.getUuid() != null ? ar.getUuid() : "");
inner.setProperties(buildProperties(ar));
inner.setChildObjects(buildChildObjects(ar));
root.setAccountingRegister(inner);
return root;
}

private static AccountingRegisterProperties buildProperties(AccountingRegister ar) {
AccountingRegisterProperties p = FACTORY.createAccountingRegisterProperties();
p.setName(ar.getName());
p.setSynonym(JaxbWriteDefaults.localStringType(JaxbWriteUtils.contentForLocalString(ar.getSynonym())));
p.setComment(ar.getComment() != null ? ar.getComment() : "");
p.setObjectBelonging(JaxbWriteDefaults.objectBelongingNative());
p.setUseStandardCommands(false);
p.setIncludeHelpInContents(false);
p.setHelp("");
p.setChartOfAccounts("");
p.setCorrespondence(false);
p.setPeriodAdjustmentLength(BigDecimal.ZERO);
p.setDefaultListForm("");
p.setAuxiliaryListForm("");
p.setRecordSetModule("");
p.setManagerModule("");
p.setStandardAttributes(JaxbWriteDefaults.emptyStandardAttributeDescriptions());
p.setDataLockControlMode(JaxbWriteDefaults.defaultDataLockControlModeAutomatic());
p.setEnableTotalsSplitting(false);
p.setFullTextSearch(JaxbWriteDefaults.fullTextSearchDontUse());
p.setListPresentation(JaxbWriteDefaults.localStringType(""));
p.setExtendedListPresentation(JaxbWriteDefaults.localStringType(""));
p.setExplanation(JaxbWriteDefaults.localStringType(""));
p.setAdditionalIndexes("");
return p;
}

private static AccountingRegisterChildObjects buildChildObjects(AccountingRegister ar) {
AccountingRegisterChildObjects co = FACTORY.createAccountingRegisterChildObjects();
if (ar.getForms() != null) {
for (ObjectForm form : ar.getForms()) {
co.getForm().add(form.getName() != null ? form.getName() : "");
}
}
return co;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* This file is a part of MDClasses.
*
* Copyright (c) 2019 - 2026
* Tymko Oleg <olegtymko@yandex.ru>, Maximov Valery <maximovvalery@gmail.com> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
package com.github._1c_syntax.bsl.mdclasses.jaxb.write;

import com.github._1c_syntax.bsl.mdo.AccumulationRegister;
import com.github._1c_syntax.bsl.mdo.children.ObjectForm;
import com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.AccumulationRegisterChildObjects;
import com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.AccumulationRegisterProperties;
import com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.MetaDataObject;
import com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.ObjectFactory;

/**
* Преобразует регистр накопления mdclasses в JAXB-DTO для записи Designer XML.
*/
public final class AccumulationRegisterToJaxbConverter {

private static final ObjectFactory FACTORY = new ObjectFactory();

private AccumulationRegisterToJaxbConverter() {
}

/**
* Собирает JAXB MetaDataObject из регистра накопления.
*
* @param ar регистр накопления из модели mdclasses
* @return корневой элемент для маршаллинга в Designer XML
*/
public static MetaDataObject toMetaDataObject(AccumulationRegister ar) {
MetaDataObject root = FACTORY.createMetaDataObject();
root.setVersion(JaxbWriteDefaults.DEFAULT_FORMAT_VERSION);
com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.AccumulationRegister inner = FACTORY.createAccumulationRegister();
inner.setUuid(ar.getUuid() != null ? ar.getUuid() : "");
inner.setProperties(buildProperties(ar));
inner.setChildObjects(buildChildObjects(ar));
root.setAccumulationRegister(inner);
return root;
}

private static AccumulationRegisterProperties buildProperties(AccumulationRegister ar) {
AccumulationRegisterProperties p = FACTORY.createAccumulationRegisterProperties();
p.setName(ar.getName());
p.setSynonym(JaxbWriteDefaults.localStringType(JaxbWriteUtils.contentForLocalString(ar.getSynonym())));
p.setComment(ar.getComment() != null ? ar.getComment() : "");
p.setObjectBelonging(JaxbWriteDefaults.objectBelongingNative());
p.setUseStandardCommands(false);
p.setDefaultListForm("");
p.setAuxiliaryListForm("");
p.setRegisterType(JaxbWriteDefaults.accumulationRegisterTypeBalance());
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if AccumulationRegister has registerType property
rg -n "getRegisterType|registerType" --type java -g "**/mdo/AccumulationRegister.java"

Repository: 1c-syntax/mdclasses

Length of output: 45


🏁 Script executed:

#!/bin/bash
# First, let's find the AccumulationRegister class
find . -name "AccumulationRegister.java" -type f 2>/dev/null | head -20

Repository: 1c-syntax/mdclasses

Length of output: 134


🏁 Script executed:

#!/bin/bash
# List files in the mdo directory to understand structure
fd -t f "AccumulationRegister" | head -20

Repository: 1c-syntax/mdclasses

Length of output: 392


🏁 Script executed:

#!/bin/bash
# Check the converter file to see the current implementation
cat -n src/main/java/com/github/_1c_syntax/bsl/mdclasses/jaxb/write/AccumulationRegisterToJaxbConverter.java | head -80

Repository: 1c-syntax/mdclasses

Length of output: 4014


🏁 Script executed:

#!/bin/bash
# Check AccumulationRegister class for registerType property
cat -n src/main/java/com/github/_1c_syntax/bsl/mdo/AccumulationRegister.java | head -100

Repository: 1c-syntax/mdclasses

Length of output: 3865


🏁 Script executed:

#!/bin/bash
# Search for registerType in AccumulationRegister class
rg -n "registerType" src/main/java/com/github/_1c_syntax/bsl/mdo/AccumulationRegister.java

Repository: 1c-syntax/mdclasses

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Continue reading AccumulationRegister to see all fields
cat -n src/main/java/com/github/_1c_syntax/bsl/mdo/AccumulationRegister.java | tail -n +100 | head -100

Repository: 1c-syntax/mdclasses

Length of output: 745


🏁 Script executed:

#!/bin/bash
# Check the Register interface
find . -name "Register.java" -type f 2>/dev/null | xargs cat -n | head -100

Repository: 1c-syntax/mdclasses

Length of output: 1830


🏁 Script executed:

#!/bin/bash
# Check if any other register types have registerType property
rg -n "registerType" --type java | head -30

Repository: 1c-syntax/mdclasses

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Search for AccumulationRegisterType or similar enum
rg -n "registerType|RegisterType|Balance|Turnovers" --type java | grep -i "accumulation\|register.*type" | head -40

Repository: 1c-syntax/mdclasses

Length of output: 847


🏁 Script executed:

#!/bin/bash
# Check the test file to understand the expected behavior
cat src/test/java/com/github/_1c_syntax/bsl/mdo/AccumulationRegisterTest.java

Repository: 1c-syntax/mdclasses

Length of output: 2292


🏁 Script executed:

#!/bin/bash
# Check the JSON fixture file to see if registerType is in the source data
cat src/test/resources/fixtures/mdclasses/AccumulationRegisters.РегистрНакопления1.json | head -100

Repository: 1c-syntax/mdclasses

Length of output: 3464


🏁 Script executed:

#!/bin/bash
# Search for how AccumulationRegisterType enum is used elsewhere
rg -n "AccumulationRegisterType" --type java -A 3 -B 1

Repository: 1c-syntax/mdclasses

Length of output: 1794


🏁 Script executed:

#!/bin/bash
# Check if registerType is parsed from the 1C metadata files anywhere
rg -n "registerType" --type java -B 5 -A 5 | head -100

Repository: 1c-syntax/mdclasses

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Look for AccumulationRegisterType enum values
find . -name "AccumulationRegisterType.java" -type f 2>/dev/null | xargs cat -n

Repository: 1c-syntax/mdclasses

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Search for AccumulationRegisterType in all file types
find . -name "*AccumulationRegisterType*" -type f 2>/dev/null

Repository: 1c-syntax/mdclasses

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Check what methods are available in AccumulationRegisterType enum
rg -n "BALANCE|TURNOVERS" --type java | head -20

Repository: 1c-syntax/mdclasses

Length of output: 534


🏁 Script executed:

#!/bin/bash
# Look at how Designer XML is parsed from the input side (read operations)
find . -name "*read*" -type d | head -10

Repository: 1c-syntax/mdclasses

Length of output: 160


🏁 Script executed:

#!/bin/bash
# Check the reader directory for AccumulationRegister parsing
find ./src/main/java/com/github/_1c_syntax/bsl/reader -name "*Accumulation*" -type f 2>/dev/null

Repository: 1c-syntax/mdclasses

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Look at the write converters to understand the pattern - check other register converters
find ./src/main/java/com/github/_1c_syntax/bsl/mdclasses/jaxb/write -name "*RegisterToJaxbConverter.java" -type f 2>/dev/null | head -10

Repository: 1c-syntax/mdclasses

Length of output: 474


🏁 Script executed:

#!/bin/bash
# Check what registerType value should be for different register types
rg -n "setRegisterType\|RegisterType" --type java src/main/java/com/github/_1c_syntax/bsl/mdclasses/jaxb/write/ -B 2 -A 2

Repository: 1c-syntax/mdclasses

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Check InformationRegisterToJaxbConverter to understand the pattern
cat -n ./src/main/java/com/github/_1c_syntax/bsl/mdclasses/jaxb/write/InformationRegisterToJaxbConverter.java | head -80

Repository: 1c-syntax/mdclasses

Length of output: 2968


🏁 Script executed:

#!/bin/bash
# Check AccountingRegisterToJaxbConverter which might have registerType
cat -n ./src/main/java/com/github/_1c_syntax/bsl/mdclasses/jaxb/write/AccountingRegisterToJaxbConverter.java | grep -A 5 -B 5 "registerType\|RegisterType"

Repository: 1c-syntax/mdclasses

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Check if there's a field or property related to register type in any 1C metadata format
rg -n "registerType\|RegisterType\|balance\|turnovers" --type java src/main/java/com/github/_1c_syntax/bsl/reader/ -B 2 -A 2 | head -60

Repository: 1c-syntax/mdclasses

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Check the JAXB generated classes to see what AccumulationRegisterType values exist
find . -path "*/jaxb/v8_3_xcf_enums*" -name "AccumulationRegisterType*" -type f 2>/dev/null

Repository: 1c-syntax/mdclasses

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Look for JAXB classes directory structure
find . -path "*/jaxb/*enums*" -type d 2>/dev/null | head -5

Repository: 1c-syntax/mdclasses

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Check if there are any Designer XML examples or test files that show accumulation register structure
find . -path "*/test*" -name "*.xml" -type f 2>/dev/null | xargs grep -l "AccumulationRegister\|registerType\|balance\|turnovers" 2>/dev/null | head -10

Repository: 1c-syntax/mdclasses

Length of output: 922


🏁 Script executed:

#!/bin/bash
# Check the Designer XML files for registerType values
cat ./src/test/resources/ext/designer/mdclasses_3_25/src/cf/AccumulationRegisters/РегистрНакопления1.xml | grep -A 5 -B 5 "registerType\|RegisterType" | head -50

Repository: 1c-syntax/mdclasses

Length of output: 469


🏁 Script executed:

#!/bin/bash
# Check what's in the actual Designer XML accumulation register files
cat ./src/test/resources/ext/designer/mdclasses_3_25/src/cf/AccumulationRegisters/РегистрНакопления2.xml | head -100

Repository: 1c-syntax/mdclasses

Length of output: 4776


🏁 Script executed:

#!/bin/bash
# Check all accumulation register XML files for registerType
grep -n "registerType" ./src/test/resources/ext/designer/mdclasses_3_25/src/cf/AccumulationRegisters/*.xml

Repository: 1c-syntax/mdclasses

Length of output: 45


RegisterType hardcoding causes data loss during round-trip conversion.

The Designer XML format supports two accumulation register types: "Balance" (остатки) and "Turnovers" (обороты). The converter hardcodes accumulationRegisterTypeBalance() at line 54, ignoring the actual registerType value from source metadata. Test fixtures confirm both types exist (РегистрНакопления1.xml has "Balance", РегистрНакопления2.xml has "Turnovers"), but the AccumulationRegister model lacks a registerType field to preserve this information, making round-trip conversion lossy.

Add registerType field to AccumulationRegister and update the converter to use the actual value.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/github/_1c_syntax/bsl/mdclasses/jaxb/write/AccumulationRegisterToJaxbConverter.java`
at line 54, The converter currently hardcodes
JaxbWriteDefaults.accumulationRegisterTypeBalance() in
AccumulationRegisterToJaxbConverter, causing loss of the original registerType;
add a registerType field (enum or String matching Designer values, e.g.,
"Balance"/"Turnovers") to the AccumulationRegister model with getter/setter,
populate it when parsing, and then change AccumulationRegisterToJaxbConverter to
call p.setRegisterType(accumulationRegister.getRegisterType()) (or map the enum
to the correct JAXB value) instead of using the hardcoded
JaxbWriteDefaults.accumulationRegisterTypeBalance(); ensure any constructors,
equals/hashCode/serialization logic and tests are updated to account for the new
field.

p.setIncludeHelpInContents(false);
p.setHelp("");
p.setRecordSetModule("");
p.setManagerModule("");
p.setStandardAttributes(JaxbWriteDefaults.emptyStandardAttributeDescriptions());
p.setDataLockControlMode(JaxbWriteDefaults.defaultDataLockControlModeAutomatic());
p.setFullTextSearch(JaxbWriteDefaults.fullTextSearchDontUse());
p.setEnableTotalsSplitting(false);
p.setAggregates("");
p.setListPresentation(JaxbWriteDefaults.localStringType(""));
p.setExtendedListPresentation(JaxbWriteDefaults.localStringType(""));
p.setExplanation(JaxbWriteDefaults.localStringType(""));
p.setAdditionalIndexes("");
return p;
}

private static AccumulationRegisterChildObjects buildChildObjects(AccumulationRegister ar) {
AccumulationRegisterChildObjects co = FACTORY.createAccumulationRegisterChildObjects();
if (ar.getForms() != null) {
for (ObjectForm form : ar.getForms()) {
co.getForm().add(form.getName() != null ? form.getName() : "");
}
}
return co;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* This file is a part of MDClasses.
*
* Copyright (c) 2019 - 2026
* Tymko Oleg <olegtymko@yandex.ru>, Maximov Valery <maximovvalery@gmail.com> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
package com.github._1c_syntax.bsl.mdclasses.jaxb.write;

import com.github._1c_syntax.bsl.mdo.BusinessProcess;
import com.github._1c_syntax.bsl.mdo.children.ObjectForm;
import com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.MetaDataObject;
import com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.ObjectFactory;

/**
* Преобразует бизнес-процесс mdclasses в JAXB-DTO для записи Designer XML.
*/
public final class BusinessProcessToJaxbConverter {

private static final ObjectFactory FACTORY = new ObjectFactory();

private BusinessProcessToJaxbConverter() {
}

/**
* Собирает JAXB MetaDataObject из бизнес-процесса.
*
* @param bp бизнес-процесс из модели mdclasses
* @return корневой элемент для маршаллинга в Designer XML
*/
public static MetaDataObject toMetaDataObject(BusinessProcess bp) {
MetaDataObject root = FACTORY.createMetaDataObject();
root.setVersion(JaxbWriteDefaults.DEFAULT_FORMAT_VERSION);
com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.BusinessProcess inner = FACTORY.createBusinessProcess();
inner.setUuid(bp.getUuid() != null ? bp.getUuid() : "");
inner.setProperties(buildProperties(bp));
inner.setChildObjects(buildChildObjects(bp));
root.setBusinessProcess(inner);
return root;
}

private static com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.BusinessProcessProperties buildProperties(BusinessProcess bp) {
com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.BusinessProcessProperties p =
FACTORY.createBusinessProcessProperties();
p.setName(bp.getName());
p.setSynonym(JaxbWriteDefaults.localStringType(JaxbWriteUtils.contentForLocalString(bp.getSynonym())));
p.setComment(bp.getComment() != null ? bp.getComment() : "");
return p;
}

private static com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.BusinessProcessChildObjects buildChildObjects(BusinessProcess bp) {
com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.BusinessProcessChildObjects childObjects =
FACTORY.createBusinessProcessChildObjects();
if (bp.getForms() != null) {
for (ObjectForm form : bp.getForms()) {
childObjects.getForm().add(form.getName() != null ? form.getName() : "");
}
}
return childObjects;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
* This file is a part of MDClasses.
*
* Copyright (c) 2019 - 2026
* Tymko Oleg <olegtymko@yandex.ru>, Maximov Valery <maximovvalery@gmail.com> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
package com.github._1c_syntax.bsl.mdclasses.jaxb.write;

import com.github._1c_syntax.bsl.mdo.CalculationRegister;
import com.github._1c_syntax.bsl.mdo.children.ObjectForm;
import com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.CalculationRegisterChildObjects;
import com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.CalculationRegisterProperties;
import com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.MetaDataObject;
import com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.ObjectFactory;

/**
* Преобразует регистр расчёта mdclasses в JAXB-DTO для записи Designer XML.
*/
public final class CalculationRegisterToJaxbConverter {

private static final ObjectFactory FACTORY = new ObjectFactory();

private CalculationRegisterToJaxbConverter() {
}

/**
* Собирает JAXB MetaDataObject из регистра расчёта.
*
* @param cr регистр расчёта из модели mdclasses
* @return корневой элемент для маршаллинга в Designer XML
*/
public static MetaDataObject toMetaDataObject(CalculationRegister cr) {
MetaDataObject root = FACTORY.createMetaDataObject();
root.setVersion(JaxbWriteDefaults.DEFAULT_FORMAT_VERSION);
com.github._1c_syntax.bsl.mdclasses.jaxb.mdclasses.CalculationRegister inner = FACTORY.createCalculationRegister();
inner.setUuid(cr.getUuid() != null ? cr.getUuid() : "");
inner.setProperties(buildProperties(cr));
inner.setChildObjects(buildChildObjects(cr));
root.setCalculationRegister(inner);
return root;
}

private static CalculationRegisterProperties buildProperties(CalculationRegister cr) {
CalculationRegisterProperties p = FACTORY.createCalculationRegisterProperties();
p.setName(cr.getName());
p.setSynonym(JaxbWriteDefaults.localStringType(JaxbWriteUtils.contentForLocalString(cr.getSynonym())));
p.setComment(cr.getComment() != null ? cr.getComment() : "");
p.setObjectBelonging(JaxbWriteDefaults.objectBelongingNative());
p.setUseStandardCommands(false);
p.setDefaultListForm("");
p.setAuxiliaryListForm("");
p.setPeriodicity(JaxbWriteDefaults.calculationRegisterPeriodicityYear());
p.setActionPeriod(false);
p.setBasePeriod(false);
p.setSchedule("");
p.setScheduleValue("");
p.setScheduleDate("");
p.setChartOfCalculationTypes("");
p.setRecordSetModule("");
p.setManagerModule("");
p.setIncludeHelpInContents(false);
p.setHelp("");
p.setStandardAttributes(JaxbWriteDefaults.emptyStandardAttributeDescriptions());
p.setDataLockControlMode(JaxbWriteDefaults.defaultDataLockControlModeAutomatic());
p.setFullTextSearch(JaxbWriteDefaults.fullTextSearchDontUse());
p.setListPresentation(JaxbWriteDefaults.localStringType(""));
p.setExtendedListPresentation(JaxbWriteDefaults.localStringType(""));
p.setExplanation(JaxbWriteDefaults.localStringType(""));
p.setAdditionalIndexes("");
return p;
}

private static CalculationRegisterChildObjects buildChildObjects(CalculationRegister cr) {
CalculationRegisterChildObjects co = FACTORY.createCalculationRegisterChildObjects();
if (cr.getForms() != null) {
for (ObjectForm form : cr.getForms()) {
co.getForm().add(form.getName() != null ? form.getName() : "");
}
}
return co;
}
}
Loading
Loading