ro.isdc.wro.extensions.processor.js
Class CJsonProcessor
java.lang.Object
ro.isdc.wro.extensions.processor.js.CJsonProcessor
- All Implemented Interfaces:
- ResourcePostProcessor, ResourcePreProcessor
@Minimize
@SupportedResourceType(value=JS)
public class CJsonProcessor
- extends Object
- implements ResourcePreProcessor, ResourcePostProcessor
A processor using cjson compression algorithm: http://stevehanov.ca/blog/index.php?id=104.
- Since:
- 1.3.8
- Author:
- Alex Objelean
|
Constructor Summary |
CJsonProcessor(boolean pack)
Private constructor, prevent instantiation. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ALIAS_PACK
public static final String ALIAS_PACK
- See Also:
- Constant Field Values
ALIAS_UNPACK
public static final String ALIAS_UNPACK
- See Also:
- Constant Field Values
CJsonProcessor
public CJsonProcessor(boolean pack)
- Private constructor, prevent instantiation.
packProcessor
public static CJsonProcessor packProcessor()
unpackProcessor
public static CJsonProcessor unpackProcessor()
process
public void process(Resource resource,
Reader reader,
Writer writer)
throws IOException
-
- Specified by:
process in interface ResourcePreProcessor
- Throws:
IOException
onException
protected void onException(WroRuntimeException e)
- Invoked when a processing exception occurs.
newEngine
protected CJson newEngine()
- Returns:
- the
CJson engine implementation. Override it to provide a different version of the json.hpack.js
library. Useful for upgrading the processor outside the wro4j release.
process
public void process(Reader reader,
Writer writer)
throws IOException
-
- Specified by:
process in interface ResourcePostProcessor
- Throws:
IOException
Copyright © 2008-2012. All Rights Reserved.