org.apache.tapestry5.internal.yuicompressor
Class AbstractMinimizer

java.lang.Object
  extended by org.apache.tapestry5.internal.yuicompressor.AbstractMinimizer
All Implemented Interfaces:
ResourceMinimizer
Direct Known Subclasses:
CSSResourceMinimizer, JavaScriptResourceMinimizer

public abstract class AbstractMinimizer
extends Object
implements ResourceMinimizer

Base class for resource minimizers.

Since:
5.3

Field Summary
protected  org.slf4j.Logger logger
           
protected  OperationTracker tracker
           
 
Constructor Summary
AbstractMinimizer(org.slf4j.Logger logger, OperationTracker tracker, String resourceType)
           
 
Method Summary
protected abstract  void doMinimize(StreamableResource resource, Writer output)
          Implemented in subclasses to do the actual work.
 StreamableResource minimize(StreamableResource input)
          Checks the content type of the resource and applies an appropriate minimization to it if possible.
protected  Reader toReader(StreamableResource input)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger

tracker

protected final OperationTracker tracker
Constructor Detail

AbstractMinimizer

public AbstractMinimizer(org.slf4j.Logger logger,
                         OperationTracker tracker,
                         String resourceType)
Method Detail

minimize

public StreamableResource minimize(StreamableResource input)
                            throws IOException
Description copied from interface: ResourceMinimizer
Checks the content type of the resource and applies an appropriate minimization to it if possible.

Specified by:
minimize in interface ResourceMinimizer
Parameters:
input - to minimize
Returns:
the same resource, or a minimized replacement for the resource
Throws:
IOException

toReader

protected Reader toReader(StreamableResource input)
                   throws IOException
Throws:
IOException

doMinimize

protected abstract void doMinimize(StreamableResource resource,
                                   Writer output)
                            throws IOException
Implemented in subclasses to do the actual work.

Parameters:
resource - content to minimize
output - writer for minimized version of input
Throws:
IOException


Copyright © 2003-2012 The Apache Software Foundation.