HTMLParsingTransformerFactory.java
1.42 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.felix.scr.annotations.Component
* org.apache.felix.scr.annotations.Property
* org.apache.felix.scr.annotations.Reference
* org.apache.felix.scr.annotations.Service
* org.apache.sling.commons.html.HtmlParser
* org.apache.sling.rewriter.Transformer
* org.apache.sling.rewriter.TransformerFactory
*/
package com.day.cq.rewriter.xml;
import com.day.cq.rewriter.xml.HTMLParsingTransformer;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.commons.html.HtmlParser;
import org.apache.sling.rewriter.Transformer;
import org.apache.sling.rewriter.TransformerFactory;
@Component
@Service(value={TransformerFactory.class})
@Property(name="pipeline.type", value={"htmlparser"})
public class HTMLParsingTransformerFactory
implements TransformerFactory {
@Reference
private HtmlParser htmlParser;
public Transformer createTransformer() {
return new HTMLParsingTransformer(this.htmlParser);
}
protected void bindHtmlParser(HtmlParser htmlParser) {
this.htmlParser = htmlParser;
}
protected void unbindHtmlParser(HtmlParser htmlParser) {
if (this.htmlParser == htmlParser) {
this.htmlParser = null;
}
}
}