TransformerWrapper.java
3.11 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
85
86
87
88
89
90
91
92
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.sling.rewriter.ProcessingComponentConfiguration
* org.apache.sling.rewriter.ProcessingContext
* org.apache.sling.rewriter.Transformer
* org.osgi.service.component.ComponentInstance
*/
package com.day.cq.rewriter.processor.impl;
import com.day.cq.rewriter.pipeline.Transformer;
import com.day.cq.rewriter.processor.ProcessingComponentConfiguration;
import com.day.cq.rewriter.processor.ProcessingContext;
import com.day.cq.rewriter.processor.impl.ProcessingComponentConfigurationWrapper;
import com.day.cq.rewriter.processor.impl.ProcessingContextWrapper;
import java.io.IOException;
import org.osgi.service.component.ComponentInstance;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
public class TransformerWrapper
implements org.apache.sling.rewriter.Transformer {
private final Transformer delegate;
private final ComponentInstance instance;
public TransformerWrapper(Transformer t, ComponentInstance cI) {
this.delegate = t;
this.instance = cI;
}
public void characters(char[] ch, int start, int length) throws SAXException {
this.delegate.characters(ch, start, length);
}
public void endDocument() throws SAXException {
this.delegate.endDocument();
}
public void endElement(String uri, String localName, String name) throws SAXException {
this.delegate.endElement(uri, localName, name);
}
public void endPrefixMapping(String prefix) throws SAXException {
this.delegate.endPrefixMapping(prefix);
}
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
this.delegate.ignorableWhitespace(ch, start, length);
}
public void processingInstruction(String target, String data) throws SAXException {
this.delegate.processingInstruction(target, data);
}
public void setDocumentLocator(Locator locator) {
this.delegate.setDocumentLocator(locator);
}
public void skippedEntity(String name) throws SAXException {
this.delegate.skippedEntity(name);
}
public void startDocument() throws SAXException {
this.delegate.startDocument();
}
public void startElement(String uri, String localName, String name, Attributes atts) throws SAXException {
this.delegate.startElement(uri, localName, name, atts);
}
public void startPrefixMapping(String prefix, String uri) throws SAXException {
this.delegate.startPrefixMapping(prefix, uri);
}
public void init(org.apache.sling.rewriter.ProcessingContext context, org.apache.sling.rewriter.ProcessingComponentConfiguration config) throws IOException {
this.delegate.init(new ProcessingContextWrapper(context), new ProcessingComponentConfigurationWrapper(config));
}
public void setContentHandler(ContentHandler handler) {
this.delegate.setContentHandler(handler);
}
public void dispose() {
if (this.instance != null) {
this.instance.dispose();
}
}
}