FacetValueChild.java
2.6 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
* Decompiled with CFR 0_118.
*/
package com.day.cq.searchpromote.xml.result;
import com.day.cq.searchpromote.xml.result.AbstractResultEntity;
import com.day.cq.searchpromote.xml.result.ResultParser;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.events.StartElement;
import javax.xml.stream.events.XMLEvent;
public class FacetValueChild
extends AbstractResultEntity {
private static final String SELECTED_NODE = "selected";
private static final String UNDOLINK_NODE = "undolink";
private static final String COUNT_NODE = "count";
private static final String LABEL_NODE = "label";
private static final String LINK_NODE = "link";
private boolean selected;
private String undoLink;
private String label;
private String link;
private Long count;
@Override
public void parse(XMLEventReader reader) throws Exception {
XMLEvent nextEvent;
while (reader.hasNext() && !(nextEvent = ResultParser.getNextEvent(reader)).isEndElement()) {
String data;
StartElement element = nextEvent.asStartElement();
String localPart = element.getName().getLocalPart();
if ("selected".equals(localPart)) {
data = this.readData(reader);
this.selected = ResultParser.strToBool(data);
ResultParser.getNextEvent(reader);
continue;
}
if ("undolink".equals(localPart)) {
this.undoLink = this.readData(reader);
ResultParser.getNextEvent(reader);
continue;
}
if ("count".equals(localPart)) {
data = this.readData(reader);
this.count = ResultParser.strToLong(data);
ResultParser.getNextEvent(reader);
continue;
}
if ("label".equals(localPart)) {
this.label = this.readData(reader);
ResultParser.getNextEvent(reader);
continue;
}
if ("link".equals(localPart)) {
this.link = this.readData(reader);
ResultParser.getNextEvent(reader);
continue;
}
ResultParser.parseUnknownTag(reader);
}
}
public boolean isSelected() {
return this.selected;
}
public String getUndoLink() {
return this.undoLink;
}
public String getLabel() {
return this.label;
}
public String getLink() {
return this.link;
}
public Long getCount() {
return this.count;
}
}