Class RenderConditionHelper
- java.lang.Object
-
- com.adobe.granite.ui.components.rendercondition.RenderConditionHelper
-
public class RenderConditionHelper extends java.lang.ObjectA helper to getRenderConditionof 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 RenderConditiongetRenderCondition(Resource resource)Returns the render condition of the given resource.RenderConditiongetRenderCondition(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:renderconditionsubresource. If there is no such subresource,SimpleRenderCondition.TRUEis returned.- Parameters:
resource- The resource whose render condition needs to be fetchedcache-trueto 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
-
-