public class TextModuleBuilder extends Object implements IModuleBuilder
Modifier and Type | Field and Description |
---|---|
protected static List<ICacheKeyGenerator> |
s_cacheKeyGenerators |
Constructor and Description |
---|
TextModuleBuilder() |
Modifier and Type | Method and Description |
---|---|
ModuleBuild |
build(String mid,
IResource resource,
javax.servlet.http.HttpServletRequest request,
List<ICacheKeyGenerator> keyGens)
Returns the compiler input source for the text module as the text stream
wrapped in an AMD define() function.
|
List<ICacheKeyGenerator> |
getCacheKeyGenerators(IAggregator aggregator)
This method may be called, before
IModuleBuilder.build(String, IResource, HttpServletRequest, List)
is called by a separate worker thread, to obtain a cache key generator
for this builder. |
protected Reader |
getContentReader(String mid,
IResource resource,
javax.servlet.http.HttpServletRequest request,
List<ICacheKeyGenerator> keyGens) |
boolean |
handles(String mid,
IResource resource)
Returns true if this module builder handles the specified resource
|
boolean |
isScript(javax.servlet.http.HttpServletRequest request) |
protected static final List<ICacheKeyGenerator> s_cacheKeyGenerators
public ModuleBuild build(String mid, IResource resource, javax.servlet.http.HttpServletRequest request, List<ICacheKeyGenerator> keyGens) throws Exception
build
in interface IModuleBuilder
mid
- The module idresource
- The resource object for the source module.request
- The HTTP request objectkeyGens
- List of cache key generators for this module that was
obtained by a previous call to this method or
IModuleBuilder.getCacheKeyGenerators(IAggregator)
. If null,
then the ModuleBuild
returned by this method must
specify a new list of non-provisional cache key generators,
otherwise, this method may return a ModuleBuild
object
that specifies keyGen
for the cache key generator.ModuleBuild
objectException
protected Reader getContentReader(String mid, IResource resource, javax.servlet.http.HttpServletRequest request, List<ICacheKeyGenerator> keyGens) throws IOException
IOException
public List<ICacheKeyGenerator> getCacheKeyGenerators(IAggregator aggregator)
IModuleBuilder
IModuleBuilder.build(String, IResource, HttpServletRequest, List)
is called by a separate worker thread, to obtain a cache key generator
for this builder. If cache keys for this builder depend on module
content, then this method should return a provisional cache key
generator, which generates cache keys based on information in the request
only. Provisional cache keys may be more exclusive than non-provisional
cache keys in matching requests to module builds.
If this method returns a provisional cache key generator, then
IModuleBuilder.build(String, IResource, HttpServletRequest, List)
will be called with a null cache key generator list and that method
MUST return a
ModuleBuild
object with a new immutable list of non-provisional cache key
generators when subsequently called for the same request.
getCacheKeyGenerators
in interface IModuleBuilder
aggregator
- The aggregator instancepublic boolean handles(String mid, IResource resource)
IModuleBuilder
handles
in interface IModuleBuilder
mid
- the module idresource
- the resource for the module idpublic boolean isScript(javax.servlet.http.HttpServletRequest request)
isScript
in interface IModuleBuilder
request
- the request objectCopyright © 2011-2015 IBM. All Rights Reserved.