Class BundledUnitManagerImpl
- All Implemented Interfaces:
BundledUnitManager
BundledRenderUnit
instance and perform dependency resolution based on their availability in
the Bindings
maps passed to the HTL Script Engine.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@Nullable ClassLoader
getBundledRenderUnitClassloader
(Bindings bindings) Given aBindings
map, this method will check if thebindings
contain a value for theBundledRenderUnit.VARIABLE
property and if the object provided byBundledRenderUnit.getUnit()
is an instance of aRenderUnit
.@Nullable RenderUnit
getRenderUnit
(@NotNull Bindings bindings) Given aBindings
map, this method will check if thebindings
contain a value for theBundledRenderUnit.VARIABLE
property and return the object provided byBundledRenderUnit.getUnit()
if this is an instance of aRenderUnit
.@Nullable RenderUnit
getRenderUnit
(@NotNull Bindings bindings, @NotNull String identifier) Given aBindings
map, this method will check if thebindings
contain a value for theBundledRenderUnit.VARIABLE
property and if the object provided byBundledRenderUnit.getUnit()
is an instance of aRenderUnit
.@Nullable URL
Given aBindings
map, this method will check if thebindings
contain a value for theBundledRenderUnit.VARIABLE
property and, if aBundledRenderUnit
is found, attempt to return the URL of dependency that theBundledRenderUnit
needs to load.<T> T
getServiceForBundledRenderUnit
(Bindings bindings, Class<T> clazz) Given aBindings
map, this method will check if thebindings
contain a value for theBundledRenderUnit.VARIABLE
property and if the object provided byBundledRenderUnit.getUnit()
is an instance of aRenderUnit
.
-
Constructor Details
-
BundledUnitManagerImpl
public BundledUnitManagerImpl()
-
-
Method Details
-
getRenderUnit
Given aBindings
map, this method will check if thebindings
contain a value for theBundledRenderUnit.VARIABLE
property and return the object provided byBundledRenderUnit.getUnit()
if this is an instance of aRenderUnit
.- Parameters:
bindings
- the bindings passed initially to the HTL Script Engine- Returns:
- a
RenderUnit
if one is found,null
otherwise
-
getRenderUnit
@Nullable public @Nullable RenderUnit getRenderUnit(@NotNull @NotNull Bindings bindings, @NotNull @NotNull String identifier) Given a
Bindings
map, this method will check if thebindings
contain a value for theBundledRenderUnit.VARIABLE
property and if the object provided byBundledRenderUnit.getUnit()
is an instance of aRenderUnit
. If so, this service will try to locate anotherRenderUnit
based on the passedidentifier
and the coordinates of theRenderUnit
found in thebindings
map.This method is suited for finding template libraries (collections of templates provided by the same
RenderUnit
).- Parameters:
bindings
- the bindings passed initially to the HTL Script Engineidentifier
- the identifier of theRenderUnit
that has to be retrieved and returned- Returns:
- a
RenderUnit
if one is found,null
otherwise
-
getScript
Description copied from interface:BundledUnitManager
Given aBindings
map, this method will check if thebindings
contain a value for theBundledRenderUnit.VARIABLE
property and, if aBundledRenderUnit
is found, attempt to return the URL of dependency that theBundledRenderUnit
needs to load. This will take into account the bundle wirings of the unit's providing bundle (seeBundledRenderUnit.getBundle()
).- Specified by:
getScript
in interfaceBundledUnitManager
- Parameters:
bindings
- the bindings passed initially to the HTL Script Engineidentifier
- the identifier of the dependency that aBundledRenderUnit
from theBindings
needs to load- Returns:
- the URL of the
identifier
dependency, if one was found
-
getBundledRenderUnitClassloader
Given a
Bindings
map, this method will check if thebindings
contain a value for theBundledRenderUnit.VARIABLE
property and if the object provided byBundledRenderUnit.getUnit()
is an instance of aRenderUnit
. If so, this service will return theClassLoader
of theBundle
providing theBundledRenderUnit
.- Specified by:
getBundledRenderUnitClassloader
in interfaceBundledUnitManager
- Parameters:
bindings
- the bindings passed initially to the HTL Script Engine- Returns:
- the
BundledRenderUnit
's classloader if one is found,null
otherwise
-
getServiceForBundledRenderUnit
Given a
Bindings
map, this method will check if thebindings
contain a value for theBundledRenderUnit.VARIABLE
property and if the object provided byBundledRenderUnit.getUnit()
is an instance of aRenderUnit
. If so, this service will try to get a reference to a service of typeclazz
and return the service object. The service will be retrieved using the bundle context of theBundledRenderUnit
found in thebindings
map.- Type Parameters:
T
- the service type- Parameters:
bindings
- the bindings passed initially to the HTL Script Engineclazz
- the class identifying the type of the service- Returns:
- a service object, if one is found,
null
otherwise
-