ro.isdc.wro.extensions.http.handler
Class ResourceSerializer
java.lang.Object
ro.isdc.wro.extensions.http.handler.ResourceSerializer
- All Implemented Interfaces:
- com.google.gson.JsonSerializer<Resource>
public class ResourceSerializer
- extends Object
- implements com.google.gson.JsonSerializer<Resource>
Serializes Resource
to json. It transforms the resources to a jsonElement which also provide a proxyUri
which the user can use do download the specific resource. If the resource is external
(eg. http://www.site.com/style.css) no proxyUri is provided.
Example JSON produced by this serializer:
{
"type": "CSS",
"uri": "/static/css/style.css",
"proxyUri": "/wro/wroResources?id=/static/css/style.css"
}
- Since:
- 1.4.7
- Author:
- Ivar Conradi Ă˜sthus
Method Summary |
com.google.gson.JsonElement |
serialize(Resource resource,
Type type,
com.google.gson.JsonSerializationContext context)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResourceSerializer
public ResourceSerializer(String requestURI)
serialize
public com.google.gson.JsonElement serialize(Resource resource,
Type type,
com.google.gson.JsonSerializationContext context)
-
- Specified by:
serialize
in interface com.google.gson.JsonSerializer<Resource>
Copyright © 2008-2013. All Rights Reserved.