Interface ClientBundleRequirements
ResourceGenerator.prepare(com.google.gwt.core.ext.TreeLogger, com.google.gwt.resources.ext.ResourceContext, com.google.gwt.resources.ext.ClientBundleRequirements, com.google.gwt.core.ext.typeinfo.JMethod)
method.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addConfigurationProperty
(String propertyName) Indicates that the ResourcePrototype implementation generated by a ResourceGenerator is sensitive to the values of the specified configuration property.void
addPermutationAxis
(String propertyName) Indicates that the ResourcePrototype implementation generated by a ResourceGenerator is sensitive to the value of the specified deferred-binding property.void
addResolvedResource
(String partialPath, URL resolvedResourceUrl) Indicates that the ResourcePrototype implementation generated by a ResourceGenerator is sensitive to a dependent resource.void
addTypeHierarchy
(JClassType type) Indicates that the ResourcePrototype implementation generated by a ResourceGenerator is sensitive to structural changes to the given type, as well as any of it's super type hierarchy.
-
Method Details
-
addConfigurationProperty
Indicates that the ResourcePrototype implementation generated by a ResourceGenerator is sensitive to the values of the specified configuration property.- Parameters:
propertyName
- the name of the configuration property- Throws:
BadPropertyValueException
-
addPermutationAxis
Indicates that the ResourcePrototype implementation generated by a ResourceGenerator is sensitive to the value of the specified deferred-binding property. This method should be called when the behavior of the ResourcePrototype must differ between permutations of the compiled output. For example, some resource implementations may be sensitive to theuser.agent
deferred-binding property, and would call this method with the literal stringuser.agent
.If a deferred-binding property does not exist, an attempt is made to check whether a configuration property by the same name exists.
- Parameters:
propertyName
- the name of the deferred-binding property- Throws:
BadPropertyValueException
- ifpropertyName
is neither a valid deferred-binding property nor a valid configuration property.
-
addResolvedResource
Indicates that the ResourcePrototype implementation generated by a ResourceGenerator is sensitive to a dependent resource. This method takes both an unresolved partialPath and a located resolvedResourceUrl, since the resolved location of a resource can change dynamically at run time. So, by calling this method, the requirement is being declared for both the resolution of the resource's URL, as well as its content.The implementation for resolving a resource url from a partial path is contained in
ResourceGeneratorUtil
, and is based on an ordered set of 'locator' implementations, which are tried in sequence. Example 'locator' implementations include looking up a resource file by name, which usually amounts to a freshly generated temporary file (seeResourceGeneratorUtil.addNamedFile(java.lang.String, java.io.File)
), or by using the partial path as a classpath resource used by a class loader, which can be affected by classpath shadowing.The current resolution for a resource partial path can be checked via
ResourceGeneratorUtil.tryFindResource(com.google.gwt.core.ext.TreeLogger, com.google.gwt.core.ext.GeneratorContext, com.google.gwt.resources.ext.ResourceContext, java.lang.String)
.- Parameters:
partialPath
- a partial path representing a dependent resource.resolvedResourceUrl
- a located resolved URL for a dependent resource.
-
addTypeHierarchy
Indicates that the ResourcePrototype implementation generated by a ResourceGenerator is sensitive to structural changes to the given type, as well as any of it's super type hierarchy.- Parameters:
type
- a type
-