FvctxNodeRequestBuilder.java 2.08 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.scene7.is.util.error.ApplicationException
 *  org.jetbrains.annotations.NotNull
 */
package com.scene7.is.ps.provider.fvctx;

import com.scene7.is.ps.provider.Request;
import com.scene7.is.ps.provider.fvctx.FvctxImageProps;
import com.scene7.is.ps.provider.fvctx.FvctxNode;
import com.scene7.is.ps.provider.fvctx.FvctxNodeNull;
import com.scene7.is.ps.provider.fvctx.FvctxRequestBuilder;
import com.scene7.is.util.error.ApplicationException;
import org.jetbrains.annotations.NotNull;

class FvctxNodeRequestBuilder
extends FvctxNodeNull {
    @NotNull
    private final FvctxRequestBuilder requestBuilder;

    FvctxNodeRequestBuilder(@NotNull FvctxRequestBuilder requestBuilder, @NotNull FvctxNode next) {
        super(next);
        this.requestBuilder = requestBuilder;
    }

    @Override
    public void startFrame(@NotNull String netPath, @NotNull String query, Request parsedRequest, FvctxImageProps imageProps, boolean hasNestedFrame, boolean isMediaSetItem) throws ApplicationException {
        Request request = this.parseRequest(netPath, query);
        this.getNext().startFrame(netPath, query, request, imageProps, hasNestedFrame, isMediaSetItem);
    }

    @Override
    public void image(@NotNull String netPath, @NotNull String query, Request parsedRequest, FvctxImageProps imageProps) throws ApplicationException {
        Request request = this.parseRequest(netPath, query);
        this.getNext().image(netPath, query, request, imageProps);
    }

    @Override
    public void swatch(@NotNull String netPath, @NotNull String query, Request parsedRequest, FvctxImageProps imageProps, boolean hasNestedFrame, boolean isMediaItemSwatch) throws ApplicationException {
        Request request = this.parseRequest(netPath, query);
        this.getNext().swatch(netPath, query, request, imageProps, hasNestedFrame, isMediaItemSwatch);
    }

    private Request parseRequest(@NotNull String netPath, @NotNull String query) throws ApplicationException {
        return this.requestBuilder.buildRequest(netPath, query);
    }
}