|
GWT 2.0.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResourceContext
Context object for ResourceGenerators. An instance of this type will be
provided by the resource generation framework to implementations of
ResourceGenerator via ResourceGenerator.init(com.google.gwt.core.ext.TreeLogger, com.google.gwt.resources.ext.ResourceContext)
. Because this interface
is not intended to be implemented by end-users, the API provided by this
interface may be extended in the future.
Depending on the optimizations made by the implementation of deploy(java.lang.String, java.lang.String, byte[], boolean)
,
the resulting URL may or may not be compatible with standard
RequestBuilder
/ XMLHttpRequest security
semantics. If the resource is intended to be used with XHR, the
xhrCompatible
paramater should be set to true
when
invoking deploy(java.lang.String, java.lang.String, byte[], boolean)
.
Method Summary | ||
---|---|---|
java.lang.String |
deploy(java.lang.String suggestedFileName,
java.lang.String mimeType,
byte[] data,
boolean xhrCompatible)
Cause a specific collection of bytes to be available in the program's compiled output. |
|
java.lang.String |
deploy(java.net.URL resource,
boolean xhrCompatible)
Cause a specific collection of bytes to be available in the program's compiled output. |
|
|
getCachedData(java.lang.String key,
java.lang.Class<T> clazz)
Retrieve data from the ResourceContext. |
|
JClassType |
getClientBundleType()
Return the interface type of the resource bundle being generated. |
|
GeneratorContext |
getGeneratorContext()
Return the GeneratorContext in which the overall resource generation framework is being run. |
|
java.lang.String |
getImplementationSimpleSourceName()
Returns the simple source name of the implementation of the bundle being generated. |
|
|
putCachedData(java.lang.String key,
T value)
Store data in the ResourceContext. |
|
boolean |
supportsDataUrls()
Indicates if the runtime context supports data: urls. |
Method Detail |
---|
java.lang.String deploy(java.lang.String suggestedFileName, java.lang.String mimeType, byte[] data, boolean xhrCompatible) throws UnableToCompleteException
suggestedFileName
- an unobfuscated filename to possibly use for the
resourcemimeType
- the MIME type of the data being provideddata
- the bytes to add to the outputxhrCompatible
- enforces compatibility with security restrictions if
the resource is intended to be accessed via an XMLHttpRequest.
UnableToCompleteException
java.lang.String deploy(java.net.URL resource, boolean xhrCompatible) throws UnableToCompleteException
resource
- the resource to add to the compiled outputxhrCompatible
- enforces compatibility with security restrictions if
the resource is intended to be accessed via an XMLHttpRequest.
UnableToCompleteException
<T> T getCachedData(java.lang.String key, java.lang.Class<T> clazz)
T
- the type of data to retrievekey
- the key value passed to getCachedData(java.lang.String, java.lang.Class)
clazz
- the type to which the cached value must be assignable
putCachedData(java.lang.String, T)
or
null
if the data was not found
java.lang.ClassCastException
- if the cached data is not assignable to the
specified typeJClassType getClientBundleType()
GeneratorContext getGeneratorContext()
deploy(java.lang.String, java.lang.String, byte[], boolean)
over GeneratorContext.tryCreateResource(com.google.gwt.core.ext.TreeLogger, java.lang.String)
in order to
take advantage of serving optimizations that can be performed by the bundle
architecture.
java.lang.String getImplementationSimpleSourceName() throws java.lang.IllegalStateException
SimpleSourceName.this
).
java.lang.IllegalStateException
- if this method is called during
ResourceGenerator.init(com.google.gwt.core.ext.TreeLogger, com.google.gwt.resources.ext.ResourceContext)
or
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)
methods.<T> boolean putCachedData(java.lang.String key, T value)
T
- the type of data being storedkey
- a string key to locate the datavalue
- the value to store
true
if the cache did not previously contain the
key-value pairboolean supportsDataUrls()
|
GWT 2.0.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |