public class BundledUnitManagerImpl extends Object implements BundledUnitManager
BundledRenderUnit instance and perform dependency resolution based on their availability in
the Bindings maps passed to the HTL Script Engine.| Constructor and Description |
|---|
BundledUnitManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
@Nullable ClassLoader |
getBundledRenderUnitClassloader(Bindings bindings)
Given a
Bindings map, this method will check if the bindings contain a value for the BundledRenderUnit.VARIABLE property and if the object provided by BundledRenderUnit.getUnit() is an instance of a RenderUnit. |
@Nullable org.apache.sling.scripting.sightly.render.RenderUnit |
getRenderUnit(@NotNull Bindings bindings)
Given a
Bindings map, this method will check if the bindings contain a value for the BundledRenderUnit.VARIABLE property and return the object provided by BundledRenderUnit.getUnit() if this is an instance of
a RenderUnit. |
@Nullable org.apache.sling.scripting.sightly.render.RenderUnit |
getRenderUnit(@NotNull Bindings bindings,
@NotNull String identifier)
Given a
Bindings map, this method will check if the bindings contain a value for the BundledRenderUnit.VARIABLE property and if the object provided by BundledRenderUnit.getUnit() is an instance of a RenderUnit. |
@Nullable URL |
getScript(Bindings bindings,
String identifier)
Given a
Bindings map, this method will check if the bindings contain a value for the BundledRenderUnit.VARIABLE property and, if a BundledRenderUnit is found, attempt to return the URL of dependency that the
BundledRenderUnit needs to load. |
<T> T |
getServiceForBundledRenderUnit(Bindings bindings,
Class<T> clazz)
Given a
Bindings map, this method will check if the bindings contain a value for the BundledRenderUnit.VARIABLE property and if the object provided by BundledRenderUnit.getUnit() is an instance of a RenderUnit. |
@Nullable
public @Nullable org.apache.sling.scripting.sightly.render.RenderUnit getRenderUnit(@NotNull
@NotNull Bindings bindings)
Bindings map, this method will check if the bindings contain a value for the BundledRenderUnit.VARIABLE property and return the object provided by BundledRenderUnit.getUnit() if this is an instance of
a RenderUnit.bindings - the bindings passed initially to the HTL Script EngineRenderUnit if one is found, null otherwise@Nullable
public @Nullable org.apache.sling.scripting.sightly.render.RenderUnit getRenderUnit(@NotNull
@NotNull Bindings bindings,
@NotNull
@NotNull String identifier)
Given a Bindings map, this method will check if the bindings contain a value for the BundledRenderUnit.VARIABLE property and if the object provided by BundledRenderUnit.getUnit() is an instance of a RenderUnit. If so, this service will try to locate another RenderUnit based on the passed identifier and the
coordinates of the RenderUnit found in the bindings map.
This method is suited for finding template libraries (collections of templates provided by the same RenderUnit).
bindings - the bindings passed initially to the HTL Script Engineidentifier - the identifier of the RenderUnit that has to be retrieved and returnedRenderUnit if one is found, null otherwise@Nullable public @Nullable URL getScript(Bindings bindings, String identifier)
BundledUnitManagerBindings map, this method will check if the bindings contain a value for the BundledRenderUnit.VARIABLE property and, if a BundledRenderUnit is found, attempt to return the URL of dependency that the
BundledRenderUnit needs to load. This will take into account the bundle wirings of the unit's providing bundle (see BundledRenderUnit.getBundle()).getScript in interface BundledUnitManagerbindings - the bindings passed initially to the HTL Script Engineidentifier - the identifier of the dependency that a BundledRenderUnit from the Bindings needs to loadidentifier dependency, if one was found@Nullable public @Nullable ClassLoader getBundledRenderUnitClassloader(Bindings bindings)
Given a Bindings map, this method will check if the bindings contain a value for the BundledRenderUnit.VARIABLE property and if the object provided by BundledRenderUnit.getUnit() is an instance of a RenderUnit. If so, this service will return the ClassLoader of the Bundle providing the BundledRenderUnit.
getBundledRenderUnitClassloader in interface BundledUnitManagerbindings - the bindings passed initially to the HTL Script EngineBundledRenderUnit's classloader if one is found, null otherwise@Nullable public <T> T getServiceForBundledRenderUnit(Bindings bindings, Class<T> clazz)
Given a Bindings map, this method will check if the bindings contain a value for the BundledRenderUnit.VARIABLE property and if the object provided by BundledRenderUnit.getUnit() is an instance of a RenderUnit. If so, this service will try to get a reference to a service of type clazz and return the service object. The
service will be retrieved using the bundle context of the BundledRenderUnit found in the bindings map.
T - the service typebindings - the bindings passed initially to the HTL Script Engineclazz - the class identifying the type of the servicenull otherwiseCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.