@UsesOrderedConfiguration(value=StackExtension.class) public class ExtensibleJavaScriptStack extends Object implements JavaScriptStack
JavaScriptStack
that can be used as the implementation of a service.
The contributions to the service are used to supply the libraries, stylesheets, and initialization for a
JavaScriptStack, allowing the stack to be more dynamically configured. In practice, one will use
ServiceBinder.bind(Class, Class)
and ServiceBindingOptions.withMarker(Class...)
to construct the
service, then use the marker annotation to inject the service when contributing the service into to the
JavaScriptStackSource
.
A limitation of this implementation is that the contributed assets are not localized at all.StackExtension
Constructor and Description |
---|
ExtensibleJavaScriptStack(AssetSource assetSource,
List<StackExtension> configuration) |
Modifier and Type | Method and Description |
---|---|
String |
getInitialization()
Returns static JavaScript initialization for the stack.
|
JavaScriptAggregationStrategy |
getJavaScriptAggregationStrategy()
Identifies how to aggregate JavaScript within the stack.
|
List<Asset> |
getJavaScriptLibraries()
Returns a list of localized assets for JavaScript libraries that form the stack.
|
List<String> |
getModules()
Returns a list of modules to include with the stack, when aggregating the stack's JavaScript.
|
List<String> |
getStacks()
Returns a list of JavaScriptStack names that this stack depends on.
|
List<StylesheetLink> |
getStylesheets()
Returns a list of localized links for stylesheets that form the stack.
|
public ExtensibleJavaScriptStack(AssetSource assetSource, List<StackExtension> configuration)
public List<String> getStacks()
JavaScriptStack
getStacks
in interface JavaScriptStack
public List<Asset> getJavaScriptLibraries()
JavaScriptStack
getJavaScriptLibraries
in interface JavaScriptStack
public List<StylesheetLink> getStylesheets()
JavaScriptStack
getStylesheets
in interface JavaScriptStack
public String getInitialization()
JavaScriptStack
getInitialization
in interface JavaScriptStack
public List<String> getModules()
JavaScriptStack
getModules
in interface JavaScriptStack
ModuleManager
,
SymbolConstants.COMBINE_SCRIPTS
public JavaScriptAggregationStrategy getJavaScriptAggregationStrategy()
JavaScriptStack
JavaScriptAggregationStrategy.COMBINE_AND_MINIMIZE
.getJavaScriptAggregationStrategy
in interface JavaScriptStack
5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.