com.google.gwt.libideas.resources.rebind
Interface ResourceContext

All Known Implementing Classes:
AbstractResourceContext

public interface ResourceContext

Context object for ResourceGenerators.

Depending on the optimizations made by the implementation of the ResourceContext, the resultant URL may or may not be compatible with standard XMLHttpRequest security semantics. If the resource is intended to be used with XHR, the xhrCompatible paramater should be set to true when invoking addToOutput(URL, boolean).


Method Summary
 java.lang.String addToOutput(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 addToOutput(java.net.URL resource, boolean xhrCompatible)
          Cause a specific collection of bytes to be available in the program's compiled output.
 com.google.gwt.core.ext.GeneratorContext getGeneratorContext()
          Return the GeneratorContext in which the overall resource generation framework is being run.
 com.google.gwt.core.ext.typeinfo.JClassType getResourceBundleType()
          Return the type of the resource bundle being generated.
 com.google.gwt.user.rebind.SourceWriter getSourceWriter()
          Return a SourceWriter which can be used to add to the concrete implementation of the type.
 

Method Detail

addToOutput

java.lang.String addToOutput(java.net.URL resource,
                             boolean xhrCompatible)
                             throws com.google.gwt.core.ext.UnableToCompleteException
Cause a specific collection of bytes to be available in the program's compiled output.

Parameters:
resource - the resource to add to the compiled output
xhrCompatible - enforces compatibility with security restrictions if the resource is intended to be accessed via an XMLHttpRequest.
Returns:
a Java expression which will evaluate to the location of the provided resource at runtime.
Throws:
com.google.gwt.core.ext.UnableToCompleteException

addToOutput

java.lang.String addToOutput(java.lang.String suggestedFileName,
                             java.lang.String mimeType,
                             byte[] data,
                             boolean xhrCompatible)
                             throws com.google.gwt.core.ext.UnableToCompleteException
Cause a specific collection of bytes to be available in the program's compiled output.

Parameters:
suggestedFileName - an unobfuscated filename to possibly use for the resource
mimeType - the MIME type of the data being provided
data - the bytes to add to the output
xhrCompatible - enforces compatibility with security restrictions if the resource is intended to be accessed via an XMLHttpRequest.
Returns:
a Java expression which will evaluate to the location of the provided resource at runtime.
Throws:
com.google.gwt.core.ext.UnableToCompleteException

getGeneratorContext

com.google.gwt.core.ext.GeneratorContext getGeneratorContext()
Return the GeneratorContext in which the overall resource generation framework is being run.


getResourceBundleType

com.google.gwt.core.ext.typeinfo.JClassType getResourceBundleType()
Return the type of the resource bundle being generated.


getSourceWriter

com.google.gwt.user.rebind.SourceWriter getSourceWriter()
Return a SourceWriter which can be used to add to the concrete implementation of the type.

Returns: