ProcessorConfigurationWrapper.java 1.91 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  org.apache.sling.api.SlingHttpServletRequest
 *  org.apache.sling.api.SlingHttpServletResponse
 *  org.apache.sling.rewriter.ProcessingContext
 *  org.apache.sling.rewriter.ProcessorConfiguration
 */
package com.day.cq.rewriter.processor.impl;

import com.day.cq.rewriter.processor.ProcessingContext;
import com.day.cq.rewriter.processor.ProcessorConfiguration;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Map;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;

public class ProcessorConfigurationWrapper
implements ProcessorConfiguration {
    private final org.apache.sling.rewriter.ProcessorConfiguration delegatee;

    public ProcessorConfigurationWrapper(org.apache.sling.rewriter.ProcessorConfiguration pc) {
        this.delegatee = pc;
    }

    @Override
    public Map<String, Object> getConfiguration() {
        return this.delegatee.getConfiguration();
    }

    @Override
    public String getType() {
        return this.delegatee.getType();
    }

    @Override
    public boolean match(final ProcessingContext context) {
        return this.delegatee.match(new org.apache.sling.rewriter.ProcessingContext(){

            public String getContentType() {
                return context.getContentType();
            }

            public OutputStream getOutputStream() throws IOException {
                return context.getOutputStream();
            }

            public SlingHttpServletRequest getRequest() {
                return context.getRequest();
            }

            public SlingHttpServletResponse getResponse() {
                return context.getResponse();
            }

            public PrintWriter getWriter() throws IOException {
                return context.getWriter();
            }
        });
    }

}