Skip to content

Commit

Permalink
Merge pull request #440 from 1c-syntax/feature/Explanation
Browse files Browse the repository at this point in the history
Представление и описание
  • Loading branch information
theshadowco authored Jan 17, 2024
2 parents 70f005e + a5311a3 commit a8af664
Show file tree
Hide file tree
Showing 91 changed files with 1,214 additions and 736 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,10 @@ public class AccountingRegister implements Register {
* Свое
*/

/**
* Пояснение
*/
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;

}
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ public class AccumulationRegister implements Register {
* Свое
*/

/**
* Пояснение
*/
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;

}


Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,11 @@ public class BusinessProcess implements ReferenceObject {
* Свое
*/

/**
* Пояснение
*/
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;


}
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ public class CalculationRegister implements Register {
@Singular
List<Recalculation> recalculations;

/**
* Пояснение
*/
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;

@Override
@NonNull
public List<MD> getChildren() {
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/github/_1c_syntax/bsl/mdo/Catalog.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,11 @@ public class Catalog implements ReferenceObject {
/*
* Свое
*/

/**
* Пояснение
*/
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;

}
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ public class ChartOfAccounts implements ReferenceObject {
@Singular
List<ExtDimensionAccountingFlag> extDimensionAccountingFlags;

/**
* Пояснение
*/
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;

@Override
public @NonNull List<Attribute> getAllAttributes() {
var allAttributes = new ArrayList<>(ReferenceObject.super.getAllAttributes());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,10 @@ public class ChartOfCalculationTypes implements ReferenceObject {
* Свое
*/

/**
* Пояснение
*/
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;

}
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,10 @@ public class ChartOfCharacteristicTypes implements ReferenceObject {
* Свое
*/

/**
* Пояснение
*/
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;

}
6 changes: 6 additions & 0 deletions src/main/java/com/github/_1c_syntax/bsl/mdo/Constant.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,10 @@ public class Constant implements MDObject, ModuleOwner {
*/
boolean passwordMode;

/**
* Пояснение
*/
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;

}
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ public class DataProcessor implements MDObject, ModuleOwner, CommandOwner, Attri
* Свое
*/

/**
* Пояснение
*/
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;


@Override
@NonNull
public List<Attribute> getAllAttributes() {
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/github/_1c_syntax/bsl/mdo/Document.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,11 @@ public class Document implements ReferenceObject {
*/
@Singular("addRegisterRecords")
List<MdoReference> registerRecords;

/**
* Пояснение
*/
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;

}
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ public class DocumentJournal implements MDObject, ModuleOwner, CommandOwner, Att
@Singular("addRegisteredDocuments")
List<MdoReference> registeredDocuments;

/**
* Пояснение
*/
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;

@Override
@NonNull
public List<Attribute> getAllAttributes() {
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/com/github/_1c_syntax/bsl/mdo/Enum.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,18 @@ public class Enum implements MDObject, ModuleOwner, CommandOwner, FormOwner, Tem
* Свое
*/


/**
* Элементы перечисления
*/
@Singular
List<EnumValue> enumValues;

/**
* Пояснение
*/
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;

@Override
@NonNull
public List<MD> getChildren() {
Expand Down
50 changes: 28 additions & 22 deletions src/main/java/com/github/_1c_syntax/bsl/mdo/ExchangePlan.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
/*
* This file is a part of MDClasses.
*
* Copyright (c) 2019 - 2024
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> 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.mdo;
/*
* This file is a part of MDClasses.
*
* Copyright (c) 2019 - 2024
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> 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.mdo;

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

/**
* Пояснение
*/
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;

/**
* Проверяет наличие объекта в составе плана обмена (вне зависимости от режима авторегистрации)
*
Expand Down
50 changes: 28 additions & 22 deletions src/main/java/com/github/_1c_syntax/bsl/mdo/ExternalDataSource.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
/*
* This file is a part of MDClasses.
*
* Copyright (c) 2019 - 2024
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> 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.mdo;
/*
* This file is a part of MDClasses.
*
* Copyright (c) 2019 - 2024
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> 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.mdo;

import com.github._1c_syntax.bsl.mdo.children.ExternalDataSourceTable;
import com.github._1c_syntax.bsl.mdo.support.MultiLanguageString;
Expand Down Expand Up @@ -72,6 +72,12 @@ public class ExternalDataSource implements MDObject, ChildrenOwner {
@Singular
List<ExternalDataSourceTable> tables;

/**
* Пояснение
*/
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;

// todo сделать функции и кубы

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,10 @@ public class FilterCriterion implements MDObject, ModuleOwner, CommandOwner, For
* Свое
*/

/**
* Пояснение
*/
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;

}
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,11 @@ public class InformationRegister implements Register {
/*
* Свое
*/

/**
* Пояснение
*/
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;

}
29 changes: 29 additions & 0 deletions src/main/java/com/github/_1c_syntax/bsl/mdo/MD.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,33 @@ default MDOType getMdoType() {
*/
String getComment();

/**
* Представление объекта, формируемое на основании синонима для русского языка.
* Если синонима для русского нет, вернет иной синоним при его наличии. В противном случае вернет имя.
*/
default String getDescription() {
return getDescription("ru");
}

/**
* Представление объекта, формируемое на основании синонима для указанного языка.
* Если синонима для указанного языка нет, вернет иной синоним при его наличии. В противном случае вернет имя.
*
* @param code Код языка
*/
default String getDescription(String code) {
if (getSynonym().isEmpty()) {
return getName();
}
var description = getSynonym().get(code);
if (description.isEmpty()) {
description = getSynonym().getAny();
}

if (description.isEmpty()) {
description = getName();
}

return description;
}
}
6 changes: 6 additions & 0 deletions src/main/java/com/github/_1c_syntax/bsl/mdo/Report.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ public class Report implements MDObject, ModuleOwner, CommandOwner, AttributeOwn
* Свое
*/

/**
* Пояснение
*/
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;

@Override
@NonNull
public List<Attribute> getAllAttributes() {
Expand Down
Loading

0 comments on commit a8af664

Please sign in to comment.