Class AddWebResourceRule
java.lang.Object
com.foreach.across.modules.web.resource.rules.AddWebResourceRule
- All Implemented Interfaces:
WebResourceRule
A rule which specifies that a
ViewElementBuilder
must be added to a specific bucket of a WebResourceRegistry
.
Allows specifying key and order related properties of the resulting WebResourceRegistry
.
Unlike directly calling WebResourceRegistry.addResourceToBucket(WebResourceReference, String)
using this rule will
not replace a previously registered resource with the same key, unless replaceIfPresent(boolean)
has explicitly
been set to true
.- Since:
- 3.2.0
- Author:
- Marc Vanbrabant
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyTo
(WebResourceRegistry webResourceRegistry) getAfter()
getKey()
getOrder()
boolean
of
(@NonNull ViewElementBuilder viewElementBuilder) order
(int order) replaceIfPresent
(boolean replaceIfPresent) Should the web resource be replaced if it is already present (based on the key).
-
Constructor Details
-
AddWebResourceRule
public AddWebResourceRule()
-
-
Method Details
-
withKey
-
toBucket
-
before
-
after
-
order
-
replaceIfPresent
Should the web resource be replaced if it is already present (based on the key). Defaults tofalse
.- Parameters:
replaceIfPresent
- true if any previously registered resource with that key should be replaced- Returns:
- rule
-
of
-
applyTo
- Specified by:
applyTo
in interfaceWebResourceRule
-
getViewElementBuilder
-
getAfter
-
getBefore
-
getOrder
-
getKey
-
getBucket
-
isReplaceIfPresent
public boolean isReplaceIfPresent()
-