Skip to content

Method: ConfigParam(String, int, String)

1: /**
2: * Copyright (C) 2020 Czech Technical University in Prague
3: *
4: * This program is free software: you can redistribute it and/or modify it under
5: * the terms of the GNU General Public License as published by the Free Software
6: * Foundation, either version 3 of the License, or (at your option) any
7: * later version.
8: *
9: * This program is distributed in the hope that it will be useful, but WITHOUT
10: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12: * details. You should have received a copy of the GNU General Public License
13: * along with this program. If not, see <http://www.gnu.org/licenses/>.
14: */
15: package cz.cvut.kbss.jsonld;
16:
17: /**
18: * Configuration parameters.
19: */
20: public enum ConfigParam {
21:
22: /**
23: * Whether to ignore unknown properties when deserializing JSON-LD.
24: * <p>
25: * If set to {@code false}, an exception will be thrown when unknown property is encountered.
26: */
27: IGNORE_UNKNOWN_PROPERTIES("ignoreUnknownProperties"),
28:
29: /**
30: * Package in which to look for mapped classes.
31: * <p>
32: * The scan is important for support for polymorphism in object deserialization.
33: */
34: SCAN_PACKAGE("scanPackage"),
35:
36: /**
37: * Whether to require an identifier when serializing an object.
38: * <p>
39: * If set to {@code true} and no identifier is found (either there is no identifier field or its value is {@code
40: * null}), an exception will be thrown. If configured to {@code false}, a blank node identifier is generated if no
41: * id is present.
42: */
43: REQUIRE_ID("requireId"),
44:
45: /**
46: * Allows assuming target type from the provided Java type when no types are specified in JSON-LD.
47: * <p>
48: * If set to {@code true}, JB4JSON-LD will attempt to use the provided Java type as the target type when
49: * deserializing a JSON-LD object which has no types declared.
50: * <p>
51: * Defaults to {@code false}, in which case an exception is thrown for a typeless JSON-LD object.
52: */
53: ASSUME_TARGET_TYPE("assumeTargetType");
54:
55: private final String name;
56:
57: ConfigParam(String name) {
58: this.name = name;
59: }
60:
61: public String getName() {
62: return name;
63: }
64: }