NotRenderCondition.java 1.22 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  javax.servlet.ServletException
 *  org.apache.sling.api.SlingHttpServletRequest
 *  org.apache.sling.api.SlingHttpServletResponse
 *  org.apache.sling.api.resource.Resource
 */
package com.adobe.granite.ui.components.rendercondition;

import com.adobe.granite.ui.components.rendercondition.AbstractCompositeRenderCondition;
import com.adobe.granite.ui.components.rendercondition.RenderCondition;
import java.io.IOException;
import java.util.Iterator;
import javax.servlet.ServletException;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.resource.Resource;

public class NotRenderCondition
extends AbstractCompositeRenderCondition {
    public NotRenderCondition(SlingHttpServletRequest request, SlingHttpServletResponse response, Resource resource) {
        super(request, response, resource);
    }

    public boolean check() throws ServletException, IOException {
        Iterator it = this.resource.listChildren();
        while (it.hasNext()) {
            if (!this.call((Resource)it.next()).check()) continue;
            return false;
        }
        return true;
    }
}