EmptyGeneratorFactory.java
1.78 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
/*
* 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.Service
* org.apache.sling.rewriter.Generator
* org.apache.sling.rewriter.GeneratorFactory
* org.apache.sling.rewriter.ProcessingComponentConfiguration
* org.apache.sling.rewriter.ProcessingContext
*/
package com.day.cq.rewriter.xml;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.Writer;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.rewriter.Generator;
import org.apache.sling.rewriter.GeneratorFactory;
import org.apache.sling.rewriter.ProcessingComponentConfiguration;
import org.apache.sling.rewriter.ProcessingContext;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
@Component
@Service(value={GeneratorFactory.class})
@Property(name="pipeline.type", value={"empty-generator"})
public class EmptyGeneratorFactory
implements GeneratorFactory {
public Generator createGenerator() {
return new EmptyGenerator();
}
public static final class EmptyGenerator
implements Generator {
private final StringWriter writer = new StringWriter();
public void finished() throws IOException, SAXException {
}
public PrintWriter getWriter() {
return new PrintWriter(this.writer);
}
public void init(ProcessingContext context, ProcessingComponentConfiguration config) throws IOException {
}
public void setContentHandler(ContentHandler handler) {
}
public void dispose() {
}
}
}