Interface RequiredResources


public interface RequiredResources
Interface for clients to require web resources.
Since:
v3.0
See Also:
  • Method Details

    • requireWebResource

      @Nonnull RequiredResources requireWebResource(@Nonnull String moduleCompleteKey)
      Specifies that resources for the given module should be included on the next call to drainIncludedResources() with ResourcePhase.defaultPhase().
      Parameters:
      moduleCompleteKey - key of webresource module
      Returns:
      this, to support method chaining
    • requireWebResource

      @Nonnull RequiredResources requireWebResource(@Nonnull ResourcePhase resourcePhase, @Nonnull String moduleCompleteKey)
      Specifies that resources for the given module should be included on the next call to drainIncludedResources(), taking into consideration the resource phase.
      Parameters:
      resourcePhase - The module resourcePhase
      moduleCompleteKey - key of webresource module
      Returns:
      this, to support method chaining
      Since:
      5.0.0
    • requireContext

      @Nonnull RequiredResources requireContext(@Nonnull String context)
      Specifies that resources for the given webresource context should be included on the next call to drainIncludedResources() with ResourcePhase.defaultPhase().
      Parameters:
      context - webresource context to include
      Returns:
      this, to support method chaining
    • requireContext

      @Nonnull RequiredResources requireContext(@Nonnull ResourcePhase resourcePhase, @Nonnull String context)
      Specifies that resources for the given webresource context should be included on the next call to drainIncludedResources(), taking into consideration the resource phase.
      Parameters:
      resourcePhase - The context resourcePhase
      context - webresource context to include
      Returns:
      this, to support method chaining
      Since:
      5.0.0
    • exclude

      @Nonnull RequiredResources exclude(@Nullable Set<String> webResources, @Nullable Set<String> contexts)
      Specifies that the given resources should be excluded from all future calls to drainIncludedResources(). This is equivalent to requiring the given webresources and contexts then calling drain().

      Any currently un-drained resources/contexts will remain and be included in the next drain.

      If this WebResourceAssembler includes implicit resources (e.g. "superbatch"), this call will also exclude all such implicit resources from future calls to drainIncludedResources().

      Parameters:
      webResources - webresource keys to exclude.
      contexts - contexts to exclude.
      Returns:
      this, to support method chaining
    • requirePage

      @Nonnull RequiredResources requirePage(@Nonnull String key)

      Includes all contexts and resources specified in the root-page into the WebResourceAssembler with ResourcePhase.defaultPhase().

      Parameters:
      key - key of the root page
      Returns:
      this, to support method chaining
      Since:
      3.5.22
    • requirePage

      @Nonnull RequiredResources requirePage(@Nonnull ResourcePhase resourcePhase, @Nonnull String key)

      Includes all contexts and resources specified in the root-page into the WebResourceAssembler taking into consideration the resource phase.

      Parameters:
      resourcePhase - The page resourcePhase
      key - key of the root page
      Returns:
      this, to support method chaining
      Since:
      5.0.0
    • excludeSuperbatch

      @Nonnull RequiredResources excludeSuperbatch()
      Exclude superbatch context.
      Returns:
      this, to support method chaining
      Since:
      5.4.0
    • requireSuperbatch

      @Nonnull RequiredResources requireSuperbatch(@Nonnull ResourcePhase resourcePhase)

      Sets resource phase for superbatch context. Keep in mind that if superbatch is disabled globally this function does not have an effect.

      Parameters:
      resourcePhase - The superbatch resourcePhase
      Returns:
      this, to support method chaining
      Since:
      5.4.0