public class ScriptTagProxy<C> extends Object implements DataProxy<C,JavaScriptObject>
DataProxy
that reads a data from a URL which may be in a
domain other than the originating domain of the running page.
Note that if you are retrieving data from a page that is in a domain that is
NOT the same as the originating domain of the running page, you must use this
class, rather than HttpProxy.
When using a load config object that implements LoadConfig
or
ModelData
, all properties and property values will be sent as
request parameters in the load request.HttpProxy
Constructor and Description |
---|
ScriptTagProxy(String url)
Creates a script tag proxy that reads data from a URL that may be in a
domain other than the originating domain of the running page.
|
Modifier and Type | Method and Description |
---|---|
DataWriter<C,String> |
getWriter()
Returns the data writer for this proxy.
|
void |
load(C loadConfig,
Callback<JavaScriptObject,Throwable> callback)
Data should be retrieved using the specified load config.
|
void |
setUrl(String url)
Sets the proxy's url.
|
void |
setWriter(DataWriter<C,String> writer)
Sets the data writer for this proxy.
|
public ScriptTagProxy(String url)
url
- the URL representing the data to retrievepublic DataWriter<C,String> getWriter()
public void load(C loadConfig, Callback<JavaScriptObject,Throwable> callback)
DataProxy
DataReader
can be used to "process" the raw data.load
in interface DataProxy<C,JavaScriptObject>
loadConfig
- the load config object to be passed to servercallback
- the data callbackpublic void setUrl(String url)
url
- the urlpublic void setWriter(DataWriter<C,String> writer)
writer
- the data writerCopyright © 2015. All rights reserved.