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
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable ClassLoadergetBundledRenderUnitClassloader(Bindings bindings) Given aBindingsmap, this method will check if thebindingscontain a value for theBundledRenderUnit.VARIABLEproperty and if the object provided byBundledRenderUnit.getUnit()is an instance of aRenderUnit.@Nullable RenderUnitgetRenderUnit(@NotNull Bindings bindings) Given aBindingsmap, this method will check if thebindingscontain a value for theBundledRenderUnit.VARIABLEproperty and return the object provided byBundledRenderUnit.getUnit()if this is an instance of aRenderUnit.@Nullable RenderUnitgetRenderUnit(@NotNull Bindings bindings, @NotNull String identifier) Given aBindingsmap, this method will check if thebindingscontain a value for theBundledRenderUnit.VARIABLEproperty and if the object provided byBundledRenderUnit.getUnit()is an instance of aRenderUnit.@Nullable URLGiven aBindingsmap, this method will check if thebindingscontain a value for theBundledRenderUnit.VARIABLEproperty and, if aBundledRenderUnitis found, attempt to return the URL of dependency that theBundledRenderUnitneeds to load.<T> TgetServiceForBundledRenderUnit(Bindings bindings, Class<T> clazz) Given aBindingsmap, this method will check if thebindingscontain a value for theBundledRenderUnit.VARIABLEproperty and if the object provided byBundledRenderUnit.getUnit()is an instance of aRenderUnit.
-
Constructor Details
-
BundledUnitManagerImpl
public BundledUnitManagerImpl()
-
-
Method Details
-
getRenderUnit
Given aBindingsmap, this method will check if thebindingscontain a value for theBundledRenderUnit.VARIABLEproperty 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
RenderUnitif one is found,nullotherwise
-
getRenderUnit
@Nullable public @Nullable RenderUnit getRenderUnit(@NotNull @NotNull Bindings bindings, @NotNull @NotNull String identifier) Given a
Bindingsmap, this method will check if thebindingscontain a value for theBundledRenderUnit.VARIABLEproperty and if the object provided byBundledRenderUnit.getUnit()is an instance of aRenderUnit. If so, this service will try to locate anotherRenderUnitbased on the passedidentifierand the coordinates of theRenderUnitfound in thebindingsmap.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 theRenderUnitthat has to be retrieved and returned- Returns:
- a
RenderUnitif one is found,nullotherwise
-
getScript
Description copied from interface:BundledUnitManagerGiven aBindingsmap, this method will check if thebindingscontain a value for theBundledRenderUnit.VARIABLEproperty and, if aBundledRenderUnitis found, attempt to return the URL of dependency that theBundledRenderUnitneeds to load. This will take into account the bundle wirings of the unit's providing bundle (seeBundledRenderUnit.getBundle()).- Specified by:
getScriptin interfaceBundledUnitManager- Parameters:
bindings- the bindings passed initially to the HTL Script Engineidentifier- the identifier of the dependency that aBundledRenderUnitfrom theBindingsneeds to load- Returns:
- the URL of the
identifierdependency, if one was found
-
getBundledRenderUnitClassloader
Given a
Bindingsmap, this method will check if thebindingscontain a value for theBundledRenderUnit.VARIABLEproperty and if the object provided byBundledRenderUnit.getUnit()is an instance of aRenderUnit. If so, this service will return theClassLoaderof theBundleproviding theBundledRenderUnit.- Specified by:
getBundledRenderUnitClassloaderin interfaceBundledUnitManager- Parameters:
bindings- the bindings passed initially to the HTL Script Engine- Returns:
- the
BundledRenderUnit's classloader if one is found,nullotherwise
-
getServiceForBundledRenderUnit
Given a
Bindingsmap, this method will check if thebindingscontain a value for theBundledRenderUnit.VARIABLEproperty 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 typeclazzand return the service object. The service will be retrieved using the bundle context of theBundledRenderUnitfound in thebindingsmap.- 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,
nullotherwise
-