Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 07cf72bd

Přidáno uživatelem Jan Havlíček před asi 4 roky(ů)

re #7891 formatting dictionaries removed

Zobrazit rozdíly:

project/Deserializer/src/Converter.java
31 31
	// Input.
32 32
	private File inputFile;
33 33
	private DB_Messenger query;
34
	
35
	// Key as enum?
36
	private HashMap<String, String> htmlFormatting = new HashMap<String, String>();
37
	private HashMap<String, String> jsonFormatting = new HashMap<String, String>();
38 34

  
39 35
	public Converter(IConversionResults ui) {
40 36
		this.ui = ui;
41 37
		active = new AtomicBoolean(true);
42 38
		entryLock = new ReentrantLock();
43 39
		inputAvailable = new Semaphore(0);
44
		fillInTestingDictionaries();
45
	}
46

  
47
	private void fillInTestingDictionaries() {
48
		htmlFormatting.put("indent", "<span style=\"margin-left:2em;\">");
49
		htmlFormatting.put("lineBreak", "<br/>");
50
		htmlFormatting.put("classCol", "<span style=\"color:blue;font-weight:bold;\">");
51
		htmlFormatting.put("fieldCol", "<span style=\"color:purple;\">");
52
		htmlFormatting.put("valCol", "<span style=\"color:orange;\">");
53
		htmlFormatting.put("keywordCol", "<span style=\"color:green;\">");
54
		htmlFormatting.put("closeTagCol", "</span>");
55

  
56
		jsonFormatting.put("indent", "\t");
57
		jsonFormatting.put("lineBreak", "\n");
58
		jsonFormatting.put("classCol", "");
59
		jsonFormatting.put("fieldCol", "");
60
		jsonFormatting.put("valCol", "");
61
		jsonFormatting.put("keywordCol", "");
62
		jsonFormatting.put("closeTagCol", "");
63 40
	}
64 41

  
65 42
	public void end() {
......
166 143
			if (cnt != null) {
167 144
				// Parametrizovany toJson pomoci dictionary
168 145
				// Ciste HTML / Cisty JSON
169
				json.append(cnt.toJson("", null, this.jsonFormatting, false));
170
				html.append(cnt.toJson("", null, this.htmlFormatting, false));
146
				json.append(cnt.toJson("", null, false));
147
				html.append(cnt.toJson("", null, false));
171 148
			}
172 149
		}
173 150
	}

Také k dispozici: Unified diff