-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParserOptionsValueContainer.java
More file actions
51 lines (44 loc) · 1.67 KB
/
ParserOptionsValueContainer.java
File metadata and controls
51 lines (44 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*******************************************************************************
* Copyright (c) 2021, Martin Armbruster
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Martin Armbruster
* - Initial implementation
******************************************************************************/
package tools.mdsd.jamopp.options;
import java.util.EnumMap;
/**
* A container for values of ParserOptions.
*
* @author Martin Armbruster
*/
public final class ParserOptionsValueContainer {
private static ParserOptionsValueContainer instance;
private EnumMap<ParserOptions, Object> values;
private ParserOptionsValueContainer() {
values = new EnumMap<>(ParserOptions.class);
}
public Object getValue(ParserOptions option) {
return values.get(option);
}
public void setValue(ParserOptions option, Object value) {
values.put(option, value);
}
public static ParserOptionsValueContainer getInstance() {
if (instance == null) {
var localInstance = new ParserOptionsValueContainer();
localInstance.setValue(ParserOptions.RESOLVE_ALL_BINDINGS, Boolean.TRUE);
localInstance.setValue(ParserOptions.RESOLVE_BINDINGS, Boolean.TRUE);
localInstance.setValue(ParserOptions.RESOLVE_BINDINGS_OF_INFERABLE_TYPES, Boolean.TRUE);
localInstance.setValue(ParserOptions.CREATE_LAYOUT_INFORMATION, Boolean.TRUE);
localInstance.setValue(ParserOptions.PREFER_BINDING_CONVERSION, Boolean.TRUE);
instance = localInstance;
}
return instance;
}
}