Class RenderConditionHelper
java.lang.Object
com.adobe.granite.ui.components.rendercondition.RenderConditionHelper
A helper to get
RenderCondition of a resource.-
Constructor Summary
ConstructorsConstructorDescriptionRenderConditionHelper(SlingHttpServletRequest request, SlingHttpServletResponse response) -
Method Summary
Modifier and TypeMethodDescriptiongetRenderCondition(Resource resource) Returns the render condition of the given resource.getRenderCondition(Resource resource, boolean cache) Returns the render condition of the given resource.
-
Constructor Details
-
RenderConditionHelper
public RenderConditionHelper(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response)
-
-
Method Details
-
getRenderCondition
@Nonnull public RenderCondition getRenderCondition(@Nonnull Resource resource) throws ServletException, 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 includeIOException- When there's an I/O error during include
-
getRenderCondition
@Nonnull public RenderCondition getRenderCondition(@Nonnull Resource resource, boolean cache) throws ServletException, 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 includeIOException- When there's an I/O error during include
-