Interface RequiredResources
public interface RequiredResources
Interface for clients to require web resources.
- Since:
- v3.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionSpecifies that the given resources should be excluded from all future calls to drainIncludedResources().Exclude superbatch context.requireContext(ResourcePhase resourcePhase, 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.requireContext(String context) Specifies that resources for the given webresource context should be included on the next call to drainIncludedResources() withResourcePhase.defaultPhase().requirePage(ResourcePhase resourcePhase, String key) Includes all contexts and resources specified in the root-page into theWebResourceAssemblertaking into consideration the resource phase.requirePage(String key) Includes all contexts and resources specified in the root-page into theWebResourceAssemblerwithResourcePhase.defaultPhase().requireSuperbatch(ResourcePhase resourcePhase) Sets resource phase for superbatch context.requireWebResource(ResourcePhase resourcePhase, String moduleCompleteKey) Specifies that resources for the given module should be included on the next call to drainIncludedResources(), taking into consideration the resource phase.requireWebResource(String moduleCompleteKey) Specifies that resources for the given module should be included on the next call to drainIncludedResources() withResourcePhase.defaultPhase().
-
Method Details
-
requireWebResource
Specifies that resources for the given module should be included on the next call to drainIncludedResources() withResourcePhase.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 resourcePhasemoduleCompleteKey- key of webresource module- Returns:
- this, to support method chaining
- Since:
- 5.0.0
-
requireContext
Specifies that resources for the given webresource context should be included on the next call to drainIncludedResources() withResourcePhase.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 resourcePhasecontext- 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
Includes all contexts and resources specified in the root-page into the
WebResourceAssemblerwithResourcePhase.defaultPhase().- Parameters:
key- key of the root page- Returns:
- this, to support method chaining
- Since:
- 3.5.22
-
requirePage
Includes all contexts and resources specified in the root-page into the
WebResourceAssemblertaking into consideration the resource phase.- Parameters:
resourcePhase- The page resourcePhasekey- key of the root page- Returns:
- this, to support method chaining
- Since:
- 5.0.0
-
excludeSuperbatch
Exclude superbatch context.- Returns:
- this, to support method chaining
- Since:
- 5.4.0
-
requireSuperbatch
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
-