diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index a176339ca..fda1ad2e0 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -12,5 +12,6 @@
+
\ No newline at end of file
diff --git a/build.gradle.kts b/build.gradle.kts
index a4bb56e14..6935c421f 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -55,9 +55,9 @@ dependencies {
// прочее
implementation("commons-io", "commons-io", "2.8.0")
- implementation("com.github.1c-syntax", "utils", "0.5.1")
+ implementation("io.github.1c-syntax", "utils", "0.6.0")
implementation("io.github.1c-syntax", "bsl-common-library", "0.5.1")
- implementation("io.github.1c-syntax", "supportconf", "0.13.1") {
+ implementation("io.github.1c-syntax", "supportconf", "0.14.0") {
exclude("io.github.1c-syntax", "bsl-common-library")
}
diff --git a/src/main/java/com/github/_1c_syntax/bsl/mdclasses/CF.java b/src/main/java/com/github/_1c_syntax/bsl/mdclasses/CF.java
index 9021466bd..dd494960c 100644
--- a/src/main/java/com/github/_1c_syntax/bsl/mdclasses/CF.java
+++ b/src/main/java/com/github/_1c_syntax/bsl/mdclasses/CF.java
@@ -1,32 +1,30 @@
-/*
- * This file is a part of MDClasses.
- *
- * Copyright (c) 2019 - 2024
- * Tymko Oleg , Maximov Valery and contributors
- *
- * SPDX-License-Identifier: LGPL-3.0-or-later
- *
- * MDClasses is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3.0 of the License, or (at your option) any later version.
- *
- * MDClasses is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with MDClasses.
- */
-package com.github._1c_syntax.bsl.mdclasses;
-
-import com.github._1c_syntax.bsl.mdo.CommonModule;
+/*
+ * This file is a part of MDClasses.
+ *
+ * Copyright (c) 2019 - 2024
+ * Tymko Oleg , Maximov Valery and contributors
+ *
+ * SPDX-License-Identifier: LGPL-3.0-or-later
+ *
+ * MDClasses is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3.0 of the License, or (at your option) any later version.
+ *
+ * MDClasses is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with MDClasses.
+ */
+package com.github._1c_syntax.bsl.mdclasses;
+
import com.github._1c_syntax.bsl.mdo.MD;
import com.github._1c_syntax.bsl.mdo.Module;
import com.github._1c_syntax.bsl.mdo.ModuleOwner;
import com.github._1c_syntax.bsl.mdo.Subsystem;
-import com.github._1c_syntax.bsl.mdo.children.ObjectModule;
import com.github._1c_syntax.bsl.mdo.support.ApplicationRunMode;
import com.github._1c_syntax.bsl.mdo.support.ScriptVariant;
import com.github._1c_syntax.bsl.mdo.support.UsePurposes;
@@ -38,7 +36,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
-import java.util.stream.Collectors;
+import java.util.Optional;
public interface CF extends MDClass, ConfigurationTree {
@@ -85,24 +83,12 @@ public interface CF extends MDClass, ConfigurationTree {
/**
* Возвращает соответствие пути к модулю его типу
*/
- default Map getModulesByType() {
- return getAllModules().stream().collect(Collectors.toMap(Module::getUri, Module::getModuleType));
- }
+ Map getModulesByType();
/**
- * Возвращает соответствие типов модулей их путям к файлам сгруппированные по представлению ссылки объекта-владельца
+ * Возвращает соответствие пути к модулю к нему самому
*/
- default Map> modulesByMDORef() {
- return getPlainChildren().stream()
- .filter(ModuleOwner.class::isInstance)
- .map(ModuleOwner.class::cast)
- .collect(Collectors.toMap(
- (MD md) -> md.getMdoReference().getMdoRef(),
- md -> md.getModules().stream()
- .collect(Collectors.toMap(Module::getModuleType, Module::getUri))
- )
- );
- }
+ Map getModulesByURI();
/**
* Возвращает соответствие типов модулей их путям к файлам для дочернего объекта
@@ -126,15 +112,7 @@ default Map mdoModuleTypes(String mdoRef) {
/**
* Возвращает соответствие пути файла модуля ссылке его владельца
*/
- default Map modulesByObject() {
- return getAllModules().stream().collect(Collectors.toMap(Module::getUri, (Module module) -> {
- if (module instanceof ObjectModule objectModule) {
- return objectModule.getOwner();
- } else {
- return ((CommonModule) module).getMdoReference();
- }
- }));
- }
+ Map getModulesByObject();
/**
* Возвращает список подсистем, в состав которых входит объект метаданных
@@ -165,4 +143,19 @@ default List includedSubsystems(MdoReference mdoReference, boolean ad
.flatMap(subsystem -> subsystem.included(mdoReference, addParentSubsystem).stream())
.toList();
}
+
+ @Override
+ default ModuleType getModuleTypeByURI(URI uri) {
+ return getModulesByType().getOrDefault(uri, ModuleType.UNKNOWN);
+ }
+
+ @Override
+ default Optional getModuleByUri(URI uri) {
+ return Optional.ofNullable(getModulesByURI().get(uri));
+ }
+
+ @Override
+ default Optional findChild(URI uri) {
+ return Optional.ofNullable(getModulesByObject().get(uri));
+ }
}
diff --git a/src/main/java/com/github/_1c_syntax/bsl/mdclasses/Configuration.java b/src/main/java/com/github/_1c_syntax/bsl/mdclasses/Configuration.java
index 3424f69f5..ffe7f10fe 100644
--- a/src/main/java/com/github/_1c_syntax/bsl/mdclasses/Configuration.java
+++ b/src/main/java/com/github/_1c_syntax/bsl/mdclasses/Configuration.java
@@ -1,25 +1,25 @@
-/*
- * This file is a part of MDClasses.
- *
- * Copyright (c) 2019 - 2024
- * Tymko Oleg , Maximov Valery and contributors
- *
- * SPDX-License-Identifier: LGPL-3.0-or-later
- *
- * MDClasses is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3.0 of the License, or (at your option) any later version.
- *
- * MDClasses is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with MDClasses.
- */
-package com.github._1c_syntax.bsl.mdclasses;
+/*
+ * This file is a part of MDClasses.
+ *
+ * Copyright (c) 2019 - 2024
+ * Tymko Oleg , Maximov Valery and contributors
+ *
+ * SPDX-License-Identifier: LGPL-3.0-or-later
+ *
+ * MDClasses is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3.0 of the License, or (at your option) any later version.
+ *
+ * MDClasses is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with MDClasses.
+ */
+package com.github._1c_syntax.bsl.mdclasses;
import com.github._1c_syntax.bsl.mdo.AccountingRegister;
import com.github._1c_syntax.bsl.mdo.AccumulationRegister;
@@ -77,10 +77,13 @@
import com.github._1c_syntax.bsl.mdo.support.ScriptVariant;
import com.github._1c_syntax.bsl.mdo.support.UseMode;
import com.github._1c_syntax.bsl.mdo.support.UsePurposes;
+import com.github._1c_syntax.bsl.mdo.utils.LazyLoader;
import com.github._1c_syntax.bsl.support.CompatibilityMode;
import com.github._1c_syntax.bsl.support.SupportVariant;
import com.github._1c_syntax.bsl.types.ConfigurationSource;
import com.github._1c_syntax.bsl.types.MdoReference;
+import com.github._1c_syntax.bsl.types.ModuleType;
+import com.github._1c_syntax.utils.Lazy;
import lombok.Builder;
import lombok.Builder.Default;
import lombok.EqualsAndHashCode;
@@ -89,8 +92,10 @@
import lombok.ToString;
import lombok.Value;
+import java.net.URI;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
/**
* Корневой класс конфигурации 1с
@@ -139,6 +144,7 @@ public class Configuration implements CF {
ApplicationRunMode defaultRunMode = ApplicationRunMode.AUTO;
@Default
List modules = Collections.emptyList();
+ Lazy> allModules = new Lazy<>(this::computeAllModules);
@Default
String vendor = "";
@Default
@@ -243,6 +249,11 @@ public class Configuration implements CF {
@Singular
List children;
+ Lazy> plainChildren = new Lazy<>(this::computePlainChildren);
+
+ Lazy> modulesByType = new Lazy<>(this::computeModulesByType);
+ Lazy> modulesByURI = new Lazy<>(this::computeModulesByURI);
+ Lazy> modulesByObject = new Lazy<>(this::computeModulesByObject);
/*
* Свое
@@ -306,6 +317,51 @@ public class Configuration implements CF {
@Default
MultiLanguageString briefInformation = MultiLanguageString.EMPTY;
+ @Override
+ public List getAllModules() {
+ return allModules.getOrCompute();
+ }
+
+ @Override
+ public List getPlainChildren() {
+ return plainChildren.getOrCompute();
+ }
+
+ @Override
+ public Map getModulesByType() {
+ return modulesByType.getOrCompute();
+ }
+
+ @Override
+ public Map getModulesByObject() {
+ return modulesByObject.getOrCompute();
+ }
+
+ @Override
+ public Map getModulesByURI() {
+ return modulesByURI.getOrCompute();
+ }
+
+ private List computePlainChildren() {
+ return LazyLoader.computePlainChildren(this);
+ }
+
+ private Map computeModulesByType() {
+ return LazyLoader.computeModulesByType(this);
+ }
+
+ private Map computeModulesByObject() {
+ return LazyLoader.computeModulesByObject(this);
+ }
+
+ private List computeAllModules() {
+ return LazyLoader.computeAllModules(this);
+ }
+
+ private Map computeModulesByURI() {
+ return LazyLoader.computeModulesByURI(this);
+ }
+
private static Configuration createEmptyConfiguration() {
var emptyString = "empty";
diff --git a/src/main/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationExtension.java b/src/main/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationExtension.java
index 97be217e9..77faffb5f 100644
--- a/src/main/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationExtension.java
+++ b/src/main/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationExtension.java
@@ -1,25 +1,25 @@
-/*
- * This file is a part of MDClasses.
- *
- * Copyright (c) 2019 - 2024
- * Tymko Oleg , Maximov Valery and contributors
- *
- * SPDX-License-Identifier: LGPL-3.0-or-later
- *
- * MDClasses is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3.0 of the License, or (at your option) any later version.
- *
- * MDClasses is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with MDClasses.
- */
-package com.github._1c_syntax.bsl.mdclasses;
+/*
+ * This file is a part of MDClasses.
+ *
+ * Copyright (c) 2019 - 2024
+ * Tymko Oleg , Maximov Valery and contributors
+ *
+ * SPDX-License-Identifier: LGPL-3.0-or-later
+ *
+ * MDClasses is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3.0 of the License, or (at your option) any later version.
+ *
+ * MDClasses is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with MDClasses.
+ */
+package com.github._1c_syntax.bsl.mdclasses;
import com.github._1c_syntax.bsl.mdo.AccountingRegister;
import com.github._1c_syntax.bsl.mdo.AccumulationRegister;
@@ -76,10 +76,13 @@
import com.github._1c_syntax.bsl.mdo.support.ObjectBelonging;
import com.github._1c_syntax.bsl.mdo.support.ScriptVariant;
import com.github._1c_syntax.bsl.mdo.support.UsePurposes;
+import com.github._1c_syntax.bsl.mdo.utils.LazyLoader;
import com.github._1c_syntax.bsl.support.CompatibilityMode;
import com.github._1c_syntax.bsl.support.SupportVariant;
import com.github._1c_syntax.bsl.types.ConfigurationSource;
import com.github._1c_syntax.bsl.types.MdoReference;
+import com.github._1c_syntax.bsl.types.ModuleType;
+import com.github._1c_syntax.utils.Lazy;
import lombok.Builder;
import lombok.Builder.Default;
import lombok.EqualsAndHashCode;
@@ -87,8 +90,10 @@
import lombok.ToString;
import lombok.Value;
+import java.net.URI;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
/**
* Класс расширения конфигурации 1с
@@ -132,6 +137,7 @@ public class ConfigurationExtension implements CF {
ApplicationRunMode defaultRunMode = ApplicationRunMode.AUTO;
@Default
List modules = Collections.emptyList();
+ Lazy> allModules = new Lazy<>(this::computeAllModules);
@Default
String vendor = "";
@Default
@@ -236,6 +242,11 @@ public class ConfigurationExtension implements CF {
@Singular
List children;
+ Lazy> plainChildren = new Lazy<>(this::computePlainChildren);
+
+ Lazy> modulesByType = new Lazy<>(this::computeModulesByType);
+ Lazy> modulesByObject = new Lazy<>(this::computeModulesByObject);
+ Lazy> modulesByURI = new Lazy<>(this::computeModulesByURI);
/*
* Свое
@@ -253,4 +264,50 @@ public class ConfigurationExtension implements CF {
@Default
String namePrefix = "";
+ @Override
+ public List getAllModules() {
+ return allModules.getOrCompute();
+ }
+
+ @Override
+ public List getPlainChildren() {
+ return plainChildren.getOrCompute();
+ }
+
+ @Override
+ public Map getModulesByType() {
+ return modulesByType.getOrCompute();
+ }
+
+ @Override
+ public Map getModulesByObject() {
+ return modulesByObject.getOrCompute();
+ }
+
+ @Override
+ public Map getModulesByURI() {
+ return modulesByURI.getOrCompute();
+ }
+
+ private List computePlainChildren() {
+ return LazyLoader.computePlainChildren(this);
+ }
+
+ private Map computeModulesByType() {
+ return LazyLoader.computeModulesByType(this);
+ }
+
+ private Map computeModulesByObject() {
+ return LazyLoader.computeModulesByObject(this);
+ }
+
+
+ private List computeAllModules() {
+ return LazyLoader.computeAllModules(this);
+ }
+
+ private Map computeModulesByURI() {
+ return LazyLoader.computeModulesByURI(this);
+ }
+
}
diff --git a/src/main/java/com/github/_1c_syntax/bsl/mdclasses/ExternalDataProcessor.java b/src/main/java/com/github/_1c_syntax/bsl/mdclasses/ExternalDataProcessor.java
index 5b530efee..b8df8e5e9 100644
--- a/src/main/java/com/github/_1c_syntax/bsl/mdclasses/ExternalDataProcessor.java
+++ b/src/main/java/com/github/_1c_syntax/bsl/mdclasses/ExternalDataProcessor.java
@@ -1,35 +1,38 @@
-/*
- * This file is a part of MDClasses.
- *
- * Copyright (c) 2019 - 2024
- * Tymko Oleg , Maximov Valery and contributors
- *
- * SPDX-License-Identifier: LGPL-3.0-or-later
- *
- * MDClasses is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3.0 of the License, or (at your option) any later version.
- *
- * MDClasses is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with MDClasses.
- */
-package com.github._1c_syntax.bsl.mdclasses;
+/*
+ * This file is a part of MDClasses.
+ *
+ * Copyright (c) 2019 - 2024
+ * Tymko Oleg , Maximov Valery and contributors
+ *
+ * SPDX-License-Identifier: LGPL-3.0-or-later
+ *
+ * MDClasses is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3.0 of the License, or (at your option) any later version.
+ *
+ * MDClasses is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with MDClasses.
+ */
+package com.github._1c_syntax.bsl.mdclasses;
import com.github._1c_syntax.bsl.mdo.Attribute;
+import com.github._1c_syntax.bsl.mdo.MD;
import com.github._1c_syntax.bsl.mdo.Module;
import com.github._1c_syntax.bsl.mdo.TabularSection;
import com.github._1c_syntax.bsl.mdo.children.ObjectCommand;
import com.github._1c_syntax.bsl.mdo.children.ObjectForm;
import com.github._1c_syntax.bsl.mdo.children.ObjectTemplate;
import com.github._1c_syntax.bsl.mdo.support.MultiLanguageString;
+import com.github._1c_syntax.bsl.mdo.utils.LazyLoader;
import com.github._1c_syntax.bsl.types.ConfigurationSource;
import com.github._1c_syntax.bsl.types.MdoReference;
+import com.github._1c_syntax.utils.Lazy;
import lombok.Builder;
import lombok.Builder.Default;
import lombok.EqualsAndHashCode;
@@ -62,6 +65,7 @@ public class ExternalDataProcessor implements ExternalSource {
@Default
List modules = Collections.emptyList();
+ Lazy> allModules = new Lazy<>(this::computeAllModules);
@Default
ConfigurationSource configurationSource = ConfigurationSource.EMPTY;
@@ -75,9 +79,61 @@ public class ExternalDataProcessor implements ExternalSource {
@Singular
List tabularSections;
+ Lazy> storageFields = new Lazy<>(this::computeStorageFields);
+ Lazy> plainStorageFields = new Lazy<>(this::computePlainStorageFields);
+
@Singular
List forms;
@Singular
List templates;
+
+ Lazy> children = new Lazy<>(this::computeChildren);
+ Lazy> plainChildren = new Lazy<>(this::computePlainChildren);
+
+ @Override
+ public List getChildren() {
+ return children.getOrCompute();
+ }
+
+ @Override
+ public List getPlainChildren() {
+ return plainChildren.getOrCompute();
+ }
+
+ @Override
+ public List getStorageFields() {
+ return storageFields.getOrCompute();
+ }
+
+ @Override
+ public List getPlainStorageFields() {
+ return plainStorageFields.getOrCompute();
+ }
+
+ @Override
+ public List getAllModules() {
+ return allModules.getOrCompute();
+ }
+
+ private List computeChildren() {
+ return LazyLoader.computeChildren(this);
+ }
+
+ private List computePlainChildren() {
+ return LazyLoader.computePlainChildren(this);
+ }
+
+ private List computeStorageFields() {
+ return LazyLoader.computeStorageFields(this);
+ }
+
+ private List computePlainStorageFields() {
+ return LazyLoader.computePlainStorageFields(this);
+ }
+
+ private List computeAllModules() {
+ return LazyLoader.computeAllModules(this);
+ }
+
}
diff --git a/src/main/java/com/github/_1c_syntax/bsl/mdclasses/ExternalReport.java b/src/main/java/com/github/_1c_syntax/bsl/mdclasses/ExternalReport.java
index c6c17a42c..a44313123 100644
--- a/src/main/java/com/github/_1c_syntax/bsl/mdclasses/ExternalReport.java
+++ b/src/main/java/com/github/_1c_syntax/bsl/mdclasses/ExternalReport.java
@@ -1,35 +1,38 @@
-/*
- * This file is a part of MDClasses.
- *
- * Copyright (c) 2019 - 2024
- * Tymko Oleg , Maximov Valery and contributors
- *
- * SPDX-License-Identifier: LGPL-3.0-or-later
- *
- * MDClasses is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3.0 of the License, or (at your option) any later version.
- *
- * MDClasses is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with MDClasses.
- */
-package com.github._1c_syntax.bsl.mdclasses;
+/*
+ * This file is a part of MDClasses.
+ *
+ * Copyright (c) 2019 - 2024
+ * Tymko Oleg , Maximov Valery and contributors
+ *
+ * SPDX-License-Identifier: LGPL-3.0-or-later
+ *
+ * MDClasses is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3.0 of the License, or (at your option) any later version.
+ *
+ * MDClasses is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with MDClasses.
+ */
+package com.github._1c_syntax.bsl.mdclasses;
import com.github._1c_syntax.bsl.mdo.Attribute;
+import com.github._1c_syntax.bsl.mdo.MD;
import com.github._1c_syntax.bsl.mdo.Module;
import com.github._1c_syntax.bsl.mdo.TabularSection;
import com.github._1c_syntax.bsl.mdo.children.ObjectCommand;
import com.github._1c_syntax.bsl.mdo.children.ObjectForm;
import com.github._1c_syntax.bsl.mdo.children.ObjectTemplate;
import com.github._1c_syntax.bsl.mdo.support.MultiLanguageString;
+import com.github._1c_syntax.bsl.mdo.utils.LazyLoader;
import com.github._1c_syntax.bsl.types.ConfigurationSource;
import com.github._1c_syntax.bsl.types.MdoReference;
+import com.github._1c_syntax.utils.Lazy;
import lombok.Builder;
import lombok.Builder.Default;
import lombok.EqualsAndHashCode;
@@ -67,6 +70,7 @@ public class ExternalReport implements ExternalSource {
@Default
List modules = Collections.emptyList();
+ Lazy> allModules = new Lazy<>(this::computeAllModules);
@Default
ConfigurationSource configurationSource = ConfigurationSource.EMPTY;
@@ -80,12 +84,63 @@ public class ExternalReport implements ExternalSource {
@Singular
List tabularSections;
+ Lazy> storageFields = new Lazy<>(this::computeStorageFields);
+ Lazy> plainStorageFields = new Lazy<>(this::computePlainStorageFields);
+
@Singular
List forms;
@Singular
List templates;
+ Lazy> children = new Lazy<>(this::computeChildren);
+ Lazy> plainChildren = new Lazy<>(this::computePlainChildren);
+
+ @Override
+ public List getChildren() {
+ return children.getOrCompute();
+ }
+
+ @Override
+ public List getPlainChildren() {
+ return plainChildren.getOrCompute();
+ }
+
+ @Override
+ public List getStorageFields() {
+ return storageFields.getOrCompute();
+ }
+
+ @Override
+ public List getPlainStorageFields() {
+ return plainStorageFields.getOrCompute();
+ }
+
+ @Override
+ public List getAllModules() {
+ return allModules.getOrCompute();
+ }
+
+ private List computeChildren() {
+ return LazyLoader.computeChildren(this);
+ }
+
+ private List computePlainChildren() {
+ return LazyLoader.computePlainChildren(this);
+ }
+
+ private List computeStorageFields() {
+ return LazyLoader.computeStorageFields(this);
+ }
+
+ private List computePlainStorageFields() {
+ return LazyLoader.computePlainStorageFields(this);
+ }
+
+ private List computeAllModules() {
+ return LazyLoader.computeAllModules(this);
+ }
+
private static ExternalReport createEmptyExternalReport() {
var emptyString = "empty";
diff --git a/src/main/java/com/github/_1c_syntax/bsl/mdclasses/package-info.java b/src/main/java/com/github/_1c_syntax/bsl/mdclasses/package-info.java
index bf2092cda..0baeb4d7f 100644
--- a/src/main/java/com/github/_1c_syntax/bsl/mdclasses/package-info.java
+++ b/src/main/java/com/github/_1c_syntax/bsl/mdclasses/package-info.java
@@ -20,11 +20,14 @@
* License along with MDClasses.
*/
/**
- * Данных пакет предназначен для данных контейнеров метаданных (Конфигурация, Расширение,
- * Внешние обработки и отчеты), и предоставления точек входа в библиотеку
- */
-
-@ParametersAreNonnullByDefault
-package com.github._1c_syntax.bsl.mdclasses;
-
-import javax.annotation.ParametersAreNonnullByDefault;
+ * Данных пакет предназначен для данных контейнеров метаданных (Конфигурация, Расширение,
+ * Внешние обработки и отчеты), и предоставления точек входа в библиотеку
+ */
+
+@ParametersAreNonnullByDefault
+@ReturnValuesAreNonnullByDefault
+package com.github._1c_syntax.bsl.mdclasses;
+
+import edu.umd.cs.findbugs.annotations.ReturnValuesAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/src/main/java/com/github/_1c_syntax/bsl/mdo/AccountingRegister.java b/src/main/java/com/github/_1c_syntax/bsl/mdo/AccountingRegister.java
index 1bf8465ac..6a7038578 100644
--- a/src/main/java/com/github/_1c_syntax/bsl/mdo/AccountingRegister.java
+++ b/src/main/java/com/github/_1c_syntax/bsl/mdo/AccountingRegister.java
@@ -28,8 +28,10 @@
import com.github._1c_syntax.bsl.mdo.children.Resource;
import com.github._1c_syntax.bsl.mdo.support.MultiLanguageString;
import com.github._1c_syntax.bsl.mdo.support.ObjectBelonging;
+import com.github._1c_syntax.bsl.mdo.utils.LazyLoader;
import com.github._1c_syntax.bsl.support.SupportVariant;
import com.github._1c_syntax.bsl.types.MdoReference;
+import com.github._1c_syntax.utils.Lazy;
import lombok.Builder;
import lombok.Builder.Default;
import lombok.EqualsAndHashCode;
@@ -67,6 +69,7 @@ public class AccountingRegister implements Register {
@Default
List modules = Collections.emptyList();
+ Lazy> allModules = new Lazy<>(this::computeAllModules);
@Singular
List commands;
@@ -77,6 +80,7 @@ public class AccountingRegister implements Register {
List resources;
@Singular
List dimensions;
+ Lazy> allAttributes = new Lazy<>(this::computeAllAttributes);
@Singular
List forms;
@@ -84,6 +88,8 @@ public class AccountingRegister implements Register {
@Singular
List templates;
+ Lazy> children = new Lazy<>(this::computeChildren);
+
/*
* Свое
*/
@@ -94,4 +100,31 @@ public class AccountingRegister implements Register {
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;
+ @Override
+ public List getChildren() {
+ return children.getOrCompute();
+ }
+
+ @Override
+ public List getAllAttributes() {
+ return allAttributes.getOrCompute();
+ }
+
+ @Override
+ public List getAllModules() {
+ return allModules.getOrCompute();
+ }
+
+ private List computeChildren() {
+ return LazyLoader.computeChildren(this);
+ }
+
+ private List computeAllAttributes() {
+ return LazyLoader.computeAllAttributes(this);
+ }
+
+ private List computeAllModules() {
+ return LazyLoader.computeAllModules(this);
+ }
+
}
diff --git a/src/main/java/com/github/_1c_syntax/bsl/mdo/AccumulationRegister.java b/src/main/java/com/github/_1c_syntax/bsl/mdo/AccumulationRegister.java
index 718d4e27e..a2595c7d4 100644
--- a/src/main/java/com/github/_1c_syntax/bsl/mdo/AccumulationRegister.java
+++ b/src/main/java/com/github/_1c_syntax/bsl/mdo/AccumulationRegister.java
@@ -28,8 +28,10 @@
import com.github._1c_syntax.bsl.mdo.children.Resource;
import com.github._1c_syntax.bsl.mdo.support.MultiLanguageString;
import com.github._1c_syntax.bsl.mdo.support.ObjectBelonging;
+import com.github._1c_syntax.bsl.mdo.utils.LazyLoader;
import com.github._1c_syntax.bsl.support.SupportVariant;
import com.github._1c_syntax.bsl.types.MdoReference;
+import com.github._1c_syntax.utils.Lazy;
import lombok.Builder;
import lombok.Builder.Default;
import lombok.EqualsAndHashCode;
@@ -67,6 +69,7 @@ public class AccumulationRegister implements Register {
@Default
List modules = Collections.emptyList();
+ Lazy> allModules = new Lazy<>(this::computeAllModules);
@Singular
List commands;
@@ -77,6 +80,7 @@ public class AccumulationRegister implements Register {
List resources;
@Singular
List dimensions;
+ Lazy> allAttributes = new Lazy<>(this::computeAllAttributes);
@Singular
List forms;
@@ -84,6 +88,8 @@ public class AccumulationRegister implements Register {
@Singular
List templates;
+ Lazy> children = new Lazy<>(this::computeChildren);
+
/*
* Свое
*/
@@ -94,6 +100,32 @@ public class AccumulationRegister implements Register {
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;
+ @Override
+ public List getChildren() {
+ return children.getOrCompute();
+ }
+
+ @Override
+ public List getAllAttributes() {
+ return allAttributes.getOrCompute();
+ }
+
+ @Override
+ public List getAllModules() {
+ return allModules.getOrCompute();
+ }
+
+ private List computeChildren() {
+ return LazyLoader.computeChildren(this);
+ }
+
+ private List computeAllAttributes() {
+ return LazyLoader.computeAllAttributes(this);
+ }
+
+ private List computeAllModules() {
+ return LazyLoader.computeAllModules(this);
+ }
}
diff --git a/src/main/java/com/github/_1c_syntax/bsl/mdo/AttributeOwner.java b/src/main/java/com/github/_1c_syntax/bsl/mdo/AttributeOwner.java
index 1c3a18818..8fd2eb11b 100644
--- a/src/main/java/com/github/_1c_syntax/bsl/mdo/AttributeOwner.java
+++ b/src/main/java/com/github/_1c_syntax/bsl/mdo/AttributeOwner.java
@@ -20,15 +20,30 @@
* License along with MDClasses.
*/
package com.github._1c_syntax.bsl.mdo;
-
-import java.util.List;
-
-/**
- * Расширение - Владелец реквизитов реквизиты
- */
-public interface AttributeOwner extends ChildrenOwner {
- /**
- * Список реквизитов объекта
- */
- List getAllAttributes();
-}
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Расширение - Владелец реквизитов реквизиты
+ */
+public interface AttributeOwner extends ChildrenOwner {
+ /**
+ * Список реквизитов объекта
+ */
+ List getAllAttributes();
+
+ /**
+ * Возвращает все дочерние элементы объекта, являющиеся атрибутами или ТЧ
+ */
+ default List getStorageFields() {
+ return Collections.unmodifiableList(getAllAttributes());
+ }
+
+ /**
+ * Возвращает дочерние элементы объекта плоским списком.
+ */
+ default List getPlainStorageFields() {
+ return getStorageFields();
+ }
+}
diff --git a/src/main/java/com/github/_1c_syntax/bsl/mdo/BusinessProcess.java b/src/main/java/com/github/_1c_syntax/bsl/mdo/BusinessProcess.java
index ba47c0963..b1dde44ec 100644
--- a/src/main/java/com/github/_1c_syntax/bsl/mdo/BusinessProcess.java
+++ b/src/main/java/com/github/_1c_syntax/bsl/mdo/BusinessProcess.java
@@ -26,8 +26,10 @@
import com.github._1c_syntax.bsl.mdo.children.ObjectTemplate;
import com.github._1c_syntax.bsl.mdo.support.MultiLanguageString;
import com.github._1c_syntax.bsl.mdo.support.ObjectBelonging;
+import com.github._1c_syntax.bsl.mdo.utils.LazyLoader;
import com.github._1c_syntax.bsl.support.SupportVariant;
import com.github._1c_syntax.bsl.types.MdoReference;
+import com.github._1c_syntax.utils.Lazy;
import lombok.Builder;
import lombok.Builder.Default;
import lombok.EqualsAndHashCode;
@@ -64,6 +66,7 @@ public class BusinessProcess implements ReferenceObject {
@Default
List modules = Collections.emptyList();
+ Lazy> allModules = new Lazy<>(this::computeAllModules);
@Singular
List commands;
@@ -74,12 +77,18 @@ public class BusinessProcess implements ReferenceObject {
@Singular
List tabularSections;
+ Lazy> storageFields = new Lazy<>(this::computeStorageFields);
+ Lazy> plainStorageFields = new Lazy<>(this::computePlainStorageFields);
+
@Singular
List forms;
@Singular
List templates;
+ Lazy> children = new Lazy<>(this::computeChildren);
+ Lazy> plainChildren = new Lazy<>(this::computePlainChildren);
+
/*
* Свое
*/
@@ -90,5 +99,48 @@ public class BusinessProcess implements ReferenceObject {
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;
+ @Override
+ public List getChildren() {
+ return children.getOrCompute();
+ }
+
+ @Override
+ public List getPlainChildren() {
+ return plainChildren.getOrCompute();
+ }
+
+ @Override
+ public List getStorageFields() {
+ return storageFields.getOrCompute();
+ }
+
+ @Override
+ public List getPlainStorageFields() {
+ return plainStorageFields.getOrCompute();
+ }
+
+ @Override
+ public List getAllModules() {
+ return allModules.getOrCompute();
+ }
+
+ private List computeChildren() {
+ return LazyLoader.computeChildren(this);
+ }
+
+ private List computePlainChildren() {
+ return LazyLoader.computePlainChildren(this);
+ }
+
+ private List computeStorageFields() {
+ return LazyLoader.computeStorageFields(this);
+ }
+
+ private List computePlainStorageFields() {
+ return LazyLoader.computePlainStorageFields(this);
+ }
+ private List computeAllModules() {
+ return LazyLoader.computeAllModules(this);
+ }
}
diff --git a/src/main/java/com/github/_1c_syntax/bsl/mdo/CalculationRegister.java b/src/main/java/com/github/_1c_syntax/bsl/mdo/CalculationRegister.java
index d20c4d4b7..6fe84e2ca 100644
--- a/src/main/java/com/github/_1c_syntax/bsl/mdo/CalculationRegister.java
+++ b/src/main/java/com/github/_1c_syntax/bsl/mdo/CalculationRegister.java
@@ -29,12 +29,13 @@
import com.github._1c_syntax.bsl.mdo.children.Resource;
import com.github._1c_syntax.bsl.mdo.support.MultiLanguageString;
import com.github._1c_syntax.bsl.mdo.support.ObjectBelonging;
+import com.github._1c_syntax.bsl.mdo.utils.LazyLoader;
import com.github._1c_syntax.bsl.support.SupportVariant;
import com.github._1c_syntax.bsl.types.MdoReference;
+import com.github._1c_syntax.utils.Lazy;
import lombok.Builder;
import lombok.Builder.Default;
import lombok.EqualsAndHashCode;
-import lombok.NonNull;
import lombok.Singular;
import lombok.ToString;
import lombok.Value;
@@ -69,6 +70,7 @@ public class CalculationRegister implements Register {
@Default
List modules = Collections.emptyList();
+ Lazy> allModules = new Lazy<>(this::computeAllModules);
@Singular
List commands;
@@ -79,6 +81,7 @@ public class CalculationRegister implements Register {
List resources;
@Singular
List dimensions;
+ Lazy> allAttributes = new Lazy<>(this::computeAllAttributes);
@Singular
List forms;
@@ -86,6 +89,8 @@ public class CalculationRegister implements Register {
@Singular
List templates;
+ Lazy> children = new Lazy<>(this::computeChildren);
+
/*
* Свое
*/
@@ -100,10 +105,30 @@ public class CalculationRegister implements Register {
MultiLanguageString explanation = MultiLanguageString.EMPTY;
@Override
- @NonNull
public List getChildren() {
- var children = Register.super.getChildren();
- children.addAll(recalculations);
- return children;
+ return children.getOrCompute();
+ }
+
+ @Override
+ public List getAllAttributes() {
+ return allAttributes.getOrCompute();
+ }
+
+ @Override
+ public List getAllModules() {
+ return allModules.getOrCompute();
}
+
+ private List computeChildren() {
+ return LazyLoader.computeChildren(this);
+ }
+
+ private List computeAllAttributes() {
+ return LazyLoader.computeAllAttributes(this);
+ }
+
+ private List computeAllModules() {
+ return LazyLoader.computeAllModules(this);
+ }
+
}
diff --git a/src/main/java/com/github/_1c_syntax/bsl/mdo/Catalog.java b/src/main/java/com/github/_1c_syntax/bsl/mdo/Catalog.java
index fd7d73d94..382df3336 100644
--- a/src/main/java/com/github/_1c_syntax/bsl/mdo/Catalog.java
+++ b/src/main/java/com/github/_1c_syntax/bsl/mdo/Catalog.java
@@ -26,8 +26,10 @@
import com.github._1c_syntax.bsl.mdo.children.ObjectTemplate;
import com.github._1c_syntax.bsl.mdo.support.MultiLanguageString;
import com.github._1c_syntax.bsl.mdo.support.ObjectBelonging;
+import com.github._1c_syntax.bsl.mdo.utils.LazyLoader;
import com.github._1c_syntax.bsl.support.SupportVariant;
import com.github._1c_syntax.bsl.types.MdoReference;
+import com.github._1c_syntax.utils.Lazy;
import lombok.Builder;
import lombok.Builder.Default;
import lombok.EqualsAndHashCode;
@@ -65,6 +67,7 @@ public class Catalog implements ReferenceObject {
@Default
List modules = Collections.emptyList();
+ Lazy> allModules = new Lazy<>(this::computeAllModules);
@Singular
List commands;
@@ -75,12 +78,18 @@ public class Catalog implements ReferenceObject {
@Singular
List tabularSections;
+ Lazy> storageFields = new Lazy<>(this::computeStorageFields);
+ Lazy> plainStorageFields = new Lazy<>(this::computePlainStorageFields);
+
@Singular
List forms;
@Singular
List templates;
+ Lazy> children = new Lazy<>(this::computeChildren);
+ Lazy> plainChildren = new Lazy<>(this::computePlainChildren);
+
/*
* Свое
*/
@@ -91,4 +100,50 @@ public class Catalog implements ReferenceObject {
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;
+
+ @Override
+ public List getChildren() {
+ return children.getOrCompute();
+ }
+
+ @Override
+ public List getPlainChildren() {
+ return plainChildren.getOrCompute();
+ }
+
+ @Override
+ public List getStorageFields() {
+ return storageFields.getOrCompute();
+ }
+
+ @Override
+ public List getPlainStorageFields() {
+ return plainStorageFields.getOrCompute();
+ }
+
+ @Override
+ public List getAllModules() {
+ return allModules.getOrCompute();
+ }
+
+ private List computeChildren() {
+ return LazyLoader.computeChildren(this);
+ }
+
+ private List computePlainChildren() {
+ return LazyLoader.computePlainChildren(this);
+ }
+
+ private List computeStorageFields() {
+ return LazyLoader.computeStorageFields(this);
+ }
+
+ private List computePlainStorageFields() {
+ return LazyLoader.computePlainStorageFields(this);
+ }
+
+ private List computeAllModules() {
+ return LazyLoader.computeAllModules(this);
+ }
+
}
diff --git a/src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccounts.java b/src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccounts.java
index 9e8c328f7..eb979e24d 100644
--- a/src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccounts.java
+++ b/src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccounts.java
@@ -28,17 +28,17 @@
import com.github._1c_syntax.bsl.mdo.children.ObjectTemplate;
import com.github._1c_syntax.bsl.mdo.support.MultiLanguageString;
import com.github._1c_syntax.bsl.mdo.support.ObjectBelonging;
+import com.github._1c_syntax.bsl.mdo.utils.LazyLoader;
import com.github._1c_syntax.bsl.support.SupportVariant;
import com.github._1c_syntax.bsl.types.MdoReference;
+import com.github._1c_syntax.utils.Lazy;
import lombok.Builder;
import lombok.Builder.Default;
import lombok.EqualsAndHashCode;
-import lombok.NonNull;
import lombok.Singular;
import lombok.ToString;
import lombok.Value;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -69,22 +69,30 @@ public class ChartOfAccounts implements ReferenceObject {
@Default
List modules = Collections.emptyList();
+ Lazy> allModules = new Lazy<>(this::computeAllModules);
@Singular
List commands;
@Singular
List attributes;
+ Lazy> allAttributes = new Lazy<>(this::computeAllAttributes);
@Singular
List tabularSections;
+ Lazy> storageFields = new Lazy<>(this::computeStorageFields);
+ Lazy> plainStorageFields = new Lazy<>(this::computePlainStorageFields);
+
@Singular
List forms;
@Singular
List templates;
+ Lazy> children = new Lazy<>(this::computeChildren);
+ Lazy> plainChildren = new Lazy<>(this::computePlainChildren);
+
/*
* Свое
*/
@@ -108,10 +116,57 @@ public class ChartOfAccounts implements ReferenceObject {
MultiLanguageString explanation = MultiLanguageString.EMPTY;
@Override
- public @NonNull List getAllAttributes() {
- var allAttributes = new ArrayList<>(ReferenceObject.super.getAllAttributes());
- allAttributes.addAll(accountingFlags);
- allAttributes.addAll(extDimensionAccountingFlags);
- return allAttributes;
+ public List getChildren() {
+ return children.getOrCompute();
+ }
+
+ @Override
+ public List getAllAttributes() {
+ return allAttributes.getOrCompute();
+ }
+
+ @Override
+ public List getPlainChildren() {
+ return plainChildren.getOrCompute();
+ }
+
+ @Override
+ public List getStorageFields() {
+ return storageFields.getOrCompute();
+ }
+
+ @Override
+ public List getPlainStorageFields() {
+ return plainStorageFields.getOrCompute();
+ }
+
+ @Override
+ public List getAllModules() {
+ return allModules.getOrCompute();
+ }
+
+ private List computeChildren() {
+ return LazyLoader.computeChildren(this);
+ }
+
+ private List computePlainChildren() {
+ return LazyLoader.computePlainChildren(this);
+ }
+
+ private List computeStorageFields() {
+ return LazyLoader.computeStorageFields(this);
}
+
+ private List computePlainStorageFields() {
+ return LazyLoader.computePlainStorageFields(this);
+ }
+
+ private List computeAllAttributes() {
+ return LazyLoader.computeAllAttributes(this);
+ }
+
+ private List computeAllModules() {
+ return LazyLoader.computeAllModules(this);
+ }
+
}
diff --git a/src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCalculationTypes.java b/src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCalculationTypes.java
index 55b78cc3d..fee2b4fd9 100644
--- a/src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCalculationTypes.java
+++ b/src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCalculationTypes.java
@@ -26,8 +26,10 @@
import com.github._1c_syntax.bsl.mdo.children.ObjectTemplate;
import com.github._1c_syntax.bsl.mdo.support.MultiLanguageString;
import com.github._1c_syntax.bsl.mdo.support.ObjectBelonging;
+import com.github._1c_syntax.bsl.mdo.utils.LazyLoader;
import com.github._1c_syntax.bsl.support.SupportVariant;
import com.github._1c_syntax.bsl.types.MdoReference;
+import com.github._1c_syntax.utils.Lazy;
import lombok.Builder;
import lombok.Builder.Default;
import lombok.EqualsAndHashCode;
@@ -65,6 +67,7 @@ public class ChartOfCalculationTypes implements ReferenceObject {
@Default
List modules = Collections.emptyList();
+ Lazy> allModules = new Lazy<>(this::computeAllModules);
@Singular
List commands;
@@ -75,12 +78,18 @@ public class ChartOfCalculationTypes implements ReferenceObject {
@Singular
List tabularSections;
+ Lazy> storageFields = new Lazy<>(this::computeStorageFields);
+ Lazy> plainStorageFields = new Lazy<>(this::computePlainStorageFields);
+
@Singular
List forms;
@Singular
List templates;
+ Lazy> children = new Lazy<>(this::computeChildren);
+ Lazy> plainChildren = new Lazy<>(this::computePlainChildren);
+
/*
* Свое
*/
@@ -91,4 +100,49 @@ public class ChartOfCalculationTypes implements ReferenceObject {
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;
+ @Override
+ public List getChildren() {
+ return children.getOrCompute();
+ }
+
+ @Override
+ public List getPlainChildren() {
+ return plainChildren.getOrCompute();
+ }
+
+ @Override
+ public List getStorageFields() {
+ return storageFields.getOrCompute();
+ }
+
+ @Override
+ public List getPlainStorageFields() {
+ return plainStorageFields.getOrCompute();
+ }
+
+ @Override
+ public List getAllModules() {
+ return allModules.getOrCompute();
+ }
+
+ private List computeChildren() {
+ return LazyLoader.computeChildren(this);
+ }
+
+ private List computePlainChildren() {
+ return LazyLoader.computePlainChildren(this);
+ }
+
+ private List computeStorageFields() {
+ return LazyLoader.computeStorageFields(this);
+ }
+
+ private List computePlainStorageFields() {
+ return LazyLoader.computePlainStorageFields(this);
+ }
+
+ private List computeAllModules() {
+ return LazyLoader.computeAllModules(this);
+ }
+
}
diff --git a/src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java b/src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java
index fa30988b2..1b99878e3 100644
--- a/src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java
+++ b/src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java
@@ -26,8 +26,10 @@
import com.github._1c_syntax.bsl.mdo.children.ObjectTemplate;
import com.github._1c_syntax.bsl.mdo.support.MultiLanguageString;
import com.github._1c_syntax.bsl.mdo.support.ObjectBelonging;
+import com.github._1c_syntax.bsl.mdo.utils.LazyLoader;
import com.github._1c_syntax.bsl.support.SupportVariant;
import com.github._1c_syntax.bsl.types.MdoReference;
+import com.github._1c_syntax.utils.Lazy;
import lombok.Builder;
import lombok.Builder.Default;
import lombok.EqualsAndHashCode;
@@ -65,6 +67,7 @@ public class ChartOfCharacteristicTypes implements ReferenceObject {
@Default
List modules = Collections.emptyList();
+ Lazy> allModules = new Lazy<>(this::computeAllModules);
@Singular
List commands;
@@ -75,12 +78,18 @@ public class ChartOfCharacteristicTypes implements ReferenceObject {
@Singular
List tabularSections;
+ Lazy> storageFields = new Lazy<>(this::computeStorageFields);
+ Lazy> plainStorageFields = new Lazy<>(this::computePlainStorageFields);
+
@Singular
List forms;
@Singular
List templates;
+ Lazy> children = new Lazy<>(this::computeChildren);
+ Lazy> plainChildren = new Lazy<>(this::computePlainChildren);
+
/*
* Свое
*/
@@ -91,4 +100,50 @@ public class ChartOfCharacteristicTypes implements ReferenceObject {
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;
+
+ @Override
+ public List getChildren() {
+ return children.getOrCompute();
+ }
+
+ @Override
+ public List getPlainChildren() {
+ return plainChildren.getOrCompute();
+ }
+
+ @Override
+ public List getStorageFields() {
+ return storageFields.getOrCompute();
+ }
+
+ @Override
+ public List getPlainStorageFields() {
+ return plainStorageFields.getOrCompute();
+ }
+
+ @Override
+ public List getAllModules() {
+ return allModules.getOrCompute();
+ }
+
+ private List computeChildren() {
+ return LazyLoader.computeChildren(this);
+ }
+
+ private List computePlainChildren() {
+ return LazyLoader.computePlainChildren(this);
+ }
+
+ private List computeStorageFields() {
+ return LazyLoader.computeStorageFields(this);
+ }
+
+ private List