Skip to content

Commit 6fd557b

Browse files
authored
Merge pull request #461 from 1c-syntax/feature/458
Обработка отсутствия элементов перечислений
2 parents 4c4b6fd + 3ad3010 commit 6fd557b

35 files changed

+847
-403
lines changed

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

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
/*
2-
* This file is a part of MDClasses.
3-
*
4-
* Copyright (c) 2019 - 2024
5-
* Tymko Oleg <olegtymko@yandex.ru>, Maximov Valery <maximovvalery@gmail.com> and contributors
6-
*
7-
* SPDX-License-Identifier: LGPL-3.0-or-later
8-
*
9-
* MDClasses is free software; you can redistribute it and/or
10-
* modify it under the terms of the GNU Lesser General Public
11-
* License as published by the Free Software Foundation; either
12-
* version 3.0 of the License, or (at your option) any later version.
13-
*
14-
* MDClasses is distributed in the hope that it will be useful,
15-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17-
* Lesser General Public License for more details.
18-
*
19-
* You should have received a copy of the GNU Lesser General Public
20-
* License along with MDClasses.
21-
*/
22-
package com.github._1c_syntax.bsl.mdo.support;
1+
/*
2+
* This file is a part of MDClasses.
3+
*
4+
* Copyright (c) 2019 - 2024
5+
* Tymko Oleg <olegtymko@yandex.ru>, Maximov Valery <maximovvalery@gmail.com> and contributors
6+
*
7+
* SPDX-License-Identifier: LGPL-3.0-or-later
8+
*
9+
* MDClasses is free software; you can redistribute it and/or
10+
* modify it under the terms of the GNU Lesser General Public
11+
* License as published by the Free Software Foundation; either
12+
* version 3.0 of the License, or (at your option) any later version.
13+
*
14+
* MDClasses is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17+
* Lesser General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Lesser General Public
20+
* License along with MDClasses.
21+
*/
22+
package com.github._1c_syntax.bsl.mdo.support;
2323

2424
import lombok.AllArgsConstructor;
2525
import lombok.Getter;
@@ -34,7 +34,13 @@
3434
public enum ApplicationRunMode implements EnumWithValue {
3535
AUTO("Auto"),
3636
MANAGED_APPLICATION("ManagedApplication"),
37-
ORDINARY_APPLICATION("OrdinaryApplication");
37+
ORDINARY_APPLICATION("OrdinaryApplication"),
38+
UNKNOWN("unknown") {
39+
@Override
40+
public boolean isUnknown() {
41+
return true;
42+
}
43+
};
3844

3945
@Accessors(fluent = true)
4046
private final String value;

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

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,26 @@
2020
* License along with MDClasses.
2121
*/
2222
package com.github._1c_syntax.bsl.mdo.support;
23-
24-
import lombok.AllArgsConstructor;
25-
import lombok.Getter;
26-
import lombok.experimental.Accessors;
27-
28-
/**
29-
* Типы авторегистрации в плане обмена
30-
*/
31-
@AllArgsConstructor
32-
@Getter
33-
public enum AutoRecordType implements EnumWithValue {
34-
ALLOW("Allow"),
35-
DENY("Deny");
36-
37-
@Accessors(fluent = true)
38-
private final String value;
39-
}
23+
24+
import lombok.AllArgsConstructor;
25+
import lombok.Getter;
26+
import lombok.experimental.Accessors;
27+
28+
/**
29+
* Типы авторегистрации в плане обмена
30+
*/
31+
@AllArgsConstructor
32+
@Getter
33+
public enum AutoRecordType implements EnumWithValue {
34+
ALLOW("Allow"),
35+
DENY("Deny"),
36+
UNKNOWN("unknown") {
37+
@Override
38+
public boolean isUnknown() {
39+
return true;
40+
}
41+
};
42+
43+
@Accessors(fluent = true)
44+
private final String value;
45+
}

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

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,28 @@
2020
* License along with MDClasses.
2121
*/
2222
package com.github._1c_syntax.bsl.mdo.support;
23-
24-
import lombok.AllArgsConstructor;
25-
import lombok.Getter;
26-
import lombok.experimental.Accessors;
27-
28-
/**
29-
* Возможные виды расширений
30-
*/
31-
@AllArgsConstructor
32-
@Getter
33-
public enum ConfigurationExtensionPurpose implements EnumWithValue {
34-
CUSTOMIZATION("Customization"),
35-
ADD_ON("AddOn"),
36-
PATCH("Patch"),
37-
UNDEFINED("Undefined");
38-
39-
@Accessors(fluent = true)
40-
private final String value;
41-
}
23+
24+
import lombok.AllArgsConstructor;
25+
import lombok.Getter;
26+
import lombok.experimental.Accessors;
27+
28+
/**
29+
* Возможные виды расширений
30+
*/
31+
@AllArgsConstructor
32+
@Getter
33+
public enum ConfigurationExtensionPurpose implements EnumWithValue {
34+
CUSTOMIZATION("Customization"),
35+
ADD_ON("AddOn"),
36+
PATCH("Patch"),
37+
UNDEFINED("Undefined"),
38+
UNKNOWN("unknown") {
39+
@Override
40+
public boolean isUnknown() {
41+
return true;
42+
}
43+
};
44+
45+
@Accessors(fluent = true)
46+
private final String value;
47+
}

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

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,27 @@
2020
* License along with MDClasses.
2121
*/
2222
package com.github._1c_syntax.bsl.mdo.support;
23-
24-
import lombok.AllArgsConstructor;
25-
import lombok.Getter;
26-
import lombok.experimental.Accessors;
27-
28-
/**
29-
* Возможные варианты режима блокировки
30-
*/
31-
@AllArgsConstructor
32-
@Getter
33-
public enum DataLockControlMode implements EnumWithValue {
34-
AUTOMATIC("Automatic"),
35-
MANAGED("Managed"),
36-
AUTOMATIC_AND_MANAGED("AutomaticAndManaged");
37-
38-
@Accessors(fluent = true)
39-
private final String value;
40-
}
23+
24+
import lombok.AllArgsConstructor;
25+
import lombok.Getter;
26+
import lombok.experimental.Accessors;
27+
28+
/**
29+
* Возможные варианты режима блокировки
30+
*/
31+
@AllArgsConstructor
32+
@Getter
33+
public enum DataLockControlMode implements EnumWithValue {
34+
AUTOMATIC("Automatic"),
35+
MANAGED("Managed"),
36+
AUTOMATIC_AND_MANAGED("AutomaticAndManaged"),
37+
UNKNOWN("unknown") {
38+
@Override
39+
public boolean isUnknown() {
40+
return true;
41+
}
42+
};
43+
44+
@Accessors(fluent = true)
45+
private final String value;
46+
}

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

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,26 @@
2020
* License along with MDClasses.
2121
*/
2222
package com.github._1c_syntax.bsl.mdo.support;
23-
24-
import lombok.AllArgsConstructor;
25-
import lombok.Getter;
26-
import lombok.experimental.Accessors;
27-
28-
/**
29-
* Возможные варианты свойства `Разделение данных`
30-
*/
31-
@AllArgsConstructor
32-
@Getter
33-
public enum DataSeparation implements EnumWithValue {
34-
DONT_USE("DontUse"),
35-
SEPARATE("Separate");
36-
37-
@Accessors(fluent = true)
38-
private final String value;
39-
}
23+
24+
import lombok.AllArgsConstructor;
25+
import lombok.Getter;
26+
import lombok.experimental.Accessors;
27+
28+
/**
29+
* Возможные варианты свойства `Разделение данных`
30+
*/
31+
@AllArgsConstructor
32+
@Getter
33+
public enum DataSeparation implements EnumWithValue {
34+
DONT_USE("DontUse"),
35+
SEPARATE("Separate"),
36+
UNKNOWN("unknown") {
37+
@Override
38+
public boolean isUnknown() {
39+
return true;
40+
}
41+
};
42+
43+
@Accessors(fluent = true)
44+
private final String value;
45+
}

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

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
/*
2-
* This file is a part of MDClasses.
3-
*
4-
* Copyright (c) 2019 - 2024
5-
* Tymko Oleg <olegtymko@yandex.ru>, Maximov Valery <maximovvalery@gmail.com> and contributors
6-
*
7-
* SPDX-License-Identifier: LGPL-3.0-or-later
8-
*
9-
* MDClasses is free software; you can redistribute it and/or
10-
* modify it under the terms of the GNU Lesser General Public
11-
* License as published by the Free Software Foundation; either
12-
* version 3.0 of the License, or (at your option) any later version.
13-
*
14-
* MDClasses is distributed in the hope that it will be useful,
15-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17-
* Lesser General Public License for more details.
18-
*
19-
* You should have received a copy of the GNU Lesser General Public
20-
* License along with MDClasses.
21-
*/
22-
package com.github._1c_syntax.bsl.mdo.support;
1+
/*
2+
* This file is a part of MDClasses.
3+
*
4+
* Copyright (c) 2019 - 2024
5+
* Tymko Oleg <olegtymko@yandex.ru>, Maximov Valery <maximovvalery@gmail.com> and contributors
6+
*
7+
* SPDX-License-Identifier: LGPL-3.0-or-later
8+
*
9+
* MDClasses is free software; you can redistribute it and/or
10+
* modify it under the terms of the GNU Lesser General Public
11+
* License as published by the Free Software Foundation; either
12+
* version 3.0 of the License, or (at your option) any later version.
13+
*
14+
* MDClasses is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17+
* Lesser General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Lesser General Public
20+
* License along with MDClasses.
21+
*/
22+
package com.github._1c_syntax.bsl.mdo.support;
2323

2424
import lombok.AllArgsConstructor;
2525
import lombok.Getter;
@@ -30,7 +30,13 @@
3030
public enum DataSetType implements EnumWithValue {
3131
DATA_SET_QUERY("DataSetQuery"),
3232
DATA_SET_UNION("DataSetUnion"),
33-
DATA_SET_OBJECT("DataSetObject");
33+
DATA_SET_OBJECT("DataSetObject"),
34+
UNKNOWN("unknown") {
35+
@Override
36+
public boolean isUnknown() {
37+
return true;
38+
}
39+
};
3440

3541
@Accessors(fluent = true)
3642
private final String value;

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

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,22 @@
2020
* License along with MDClasses.
2121
*/
2222
package com.github._1c_syntax.bsl.mdo.support;
23-
24-
/**
25-
* Расширение для перечислений, необходимое для использования в анмаршалинге
26-
* автор идеи: alkoleft (https://github.com/alkoleft)
27-
*/
28-
public interface EnumWithValue {
29-
/**
30-
* Возвращает значение перечисления
31-
*
32-
* @return Строковое значение перечисления
33-
*/
34-
String value();
35-
}
23+
24+
/**
25+
* Расширение для перечислений, необходимое для использования в анмаршалинге
26+
*/
27+
public interface EnumWithValue {
28+
/**
29+
* Возвращает значение перечисления
30+
*
31+
* @return Строковое значение перечисления
32+
*/
33+
String value();
34+
35+
/**
36+
* Признак того, что значение используется как значение для неизвестных
37+
*/
38+
default boolean isUnknown() {
39+
return false;
40+
}
41+
}

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

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,26 @@
2020
* License along with MDClasses.
2121
*/
2222
package com.github._1c_syntax.bsl.mdo.support;
23-
24-
import lombok.AllArgsConstructor;
25-
import lombok.Getter;
26-
import lombok.experimental.Accessors;
27-
28-
/**
29-
* Тип формы (обычная или управляемая)
30-
*/
31-
@AllArgsConstructor
32-
@Getter
33-
public enum FormType implements EnumWithValue {
34-
ORDINARY("Ordinary"),
35-
MANAGED("Managed");
36-
37-
@Accessors(fluent = true)
38-
private final String value;
39-
}
23+
24+
import lombok.AllArgsConstructor;
25+
import lombok.Getter;
26+
import lombok.experimental.Accessors;
27+
28+
/**
29+
* Тип формы (обычная или управляемая)
30+
*/
31+
@AllArgsConstructor
32+
@Getter
33+
public enum FormType implements EnumWithValue {
34+
ORDINARY("Ordinary"),
35+
MANAGED("Managed"),
36+
UNKNOWN("unknown") {
37+
@Override
38+
public boolean isUnknown() {
39+
return true;
40+
}
41+
};
42+
43+
@Accessors(fluent = true)
44+
private final String value;
45+
}

0 commit comments

Comments
 (0)