public final class LazyProcessorDecorator extends AbstractDecorator<LazyInitializer<ResourcePreProcessor>> implements ResourceProcessorAware
LazyInitializer which creates a processor. Allows defer the initialization of the decorated
processor, making it unnecessary dependency unless it is really used.| Constructor and Description |
|---|
LazyProcessorDecorator(LazyInitializer<ResourcePreProcessor> processor) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy this object or any other internal state created during initialization.
|
SupportedResourceType |
getSupportedResourceType() |
boolean |
isImportAware() |
boolean |
isMinimize() |
boolean |
isSupported() |
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.
|
String |
toString() |
getDecoratedObject, getOriginalDecoratedObject, getOriginalDecoratedObjectpublic LazyProcessorDecorator(LazyInitializer<ResourcePreProcessor> processor)
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 ResourcePreProcessorresource - 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.public void process(Reader reader, Writer writer) throws IOException
process in interface ResourcePostProcessorreader - source stream.writer - destination stream.IOExceptionpublic SupportedResourceType getSupportedResourceType()
getSupportedResourceType in interface SupportedResourceTypeAwareSupportedResourceType to be used by processor.public boolean isMinimize()
isMinimize in interface MinimizeAwarepublic boolean isSupported()
isSupported in interface SupportAwarepublic boolean isImportAware()
isImportAware in interface ImportAwarepublic void destroy()
throws Exception
destroy in interface DestroyableException - if the destroy operation failed.public String toString()
toString in class AbstractDecorator<LazyInitializer<ResourcePreProcessor>>Copyright © 2008-2014. All Rights Reserved.