Class RenderConditionHelper
- java.lang.Object
-
- com.adobe.granite.ui.components.rendercondition.RenderConditionHelper
-
public class RenderConditionHelper extends java.lang.Object
A helper to getRenderCondition
of a resource.
-
-
Constructor Summary
Constructors Constructor Description RenderConditionHelper(SlingHttpServletRequest request, SlingHttpServletResponse response)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RenderCondition
getRenderCondition(Resource resource)
Returns the render condition of the given resource.RenderCondition
getRenderCondition(Resource resource, boolean cache)
Returns the render condition of the given resource.
-
-
-
Constructor Detail
-
RenderConditionHelper
public RenderConditionHelper(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response)
-
-
Method Detail
-
getRenderCondition
@Nonnull public RenderCondition getRenderCondition(@Nonnull Resource resource) throws ServletException, java.io.IOException
Returns the render condition of the given resource. This method is an overload ofgetRenderCondition(Resource, boolean)
with cache = false.- Parameters:
resource
- The resource whose render condition needs to be fetched- Returns:
- The render condition
- Throws:
ServletException
- When there's a servlet error during includejava.io.IOException
- When there's an I/O error during include
-
getRenderCondition
@Nonnull public RenderCondition getRenderCondition(@Nonnull Resource resource, boolean cache) throws ServletException, java.io.IOException
Returns the render condition of the given resource. The render condition is specified bygranite:rendercondition
subresource. If there is no such subresource,SimpleRenderCondition.TRUE
is returned.- Parameters:
resource
- The resource whose render condition needs to be fetchedcache
-true
to cache the result; Use it when checking render condition of other resource (typically the item resource) so that the render condition is only resolved once.- Returns:
- The render condition
- Throws:
ServletException
- When there's a servlet error during includejava.io.IOException
- When there's an I/O error during include
-
-