|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ro.isdc.wro.extensions.processor.js.CJsonProcessor
@Minimize @SupportedResourceType(value=JS) public class CJsonProcessor
A processor using cjson compression algorithm: http://stevehanov.ca/blog/index.php?id=104
.
Field Summary | |
---|---|
static String |
ALIAS_PACK
|
static String |
ALIAS_UNPACK
|
Constructor Summary | |
---|---|
CJsonProcessor(boolean pack)
Private constructor, prevent instantiation. |
Method Summary | |
---|---|
protected CJson |
newEngine()
|
protected void |
onException(WroRuntimeException e)
Invoked when a processing exception occurs. |
static CJsonProcessor |
packProcessor()
|
void |
process(Reader reader,
Writer writer)
Perform actual resource processing. |
void |
process(Resource resource,
Reader reader,
Writer writer)
Process a content supplied by a reader and perform some sort of processing. |
static CJsonProcessor |
unpackProcessor()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ALIAS_PACK
public static final String ALIAS_UNPACK
Constructor Detail |
---|
public CJsonProcessor(boolean pack)
Method Detail |
---|
public static CJsonProcessor packProcessor()
public static CJsonProcessor unpackProcessor()
public void process(Resource resource, Reader reader, Writer writer) throws IOException
Resource
, because
this way you can ignore the other preProcessors from the chain.RuntimeException
and the processing chain is interrupted (by default)WroConfiguration.isIgnoreFailingProcessor()
is true)
process
in interface ResourcePreProcessor
resource
- the original resource as it found in the model.reader
- Reader
used to read processed resource content.writer
- Writer
where used to write processed results.
IOException
- when an exception occurs. The future version will change the exception type to Exception
, because
any exception may occur during processing. The processing failure will be handled based on value of
WroConfiguration.isIgnoreFailingProcessor()
configuration flag.protected void onException(WroRuntimeException e)
protected CJson newEngine()
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.public void process(Reader reader, Writer writer) throws IOException
process
in interface ResourcePostProcessor
reader
- source stream.writer
- destination stream.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |