Class RenderConditionHelper


  • public class RenderConditionHelper
    extends java.lang.Object
    A helper to get RenderCondition of a resource.
    • 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 of getRenderCondition(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 include
        java.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 by granite:rendercondition subresource. If there is no such subresource, SimpleRenderCondition.TRUE is returned.
        Parameters:
        resource - The resource whose render condition needs to be fetched
        cache - 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 include
        java.io.IOException - When there's an I/O error during include