org.apache.tapestry5.services.assets

## Interface ResourceTransformer

- All Known Implementing Classes:
    CoffeeScriptCompiler, DelegatingResourceTransformer, LessResourceTransformer

      public interface ResourceTransformer

  A transformer is used to read a `Resource` and pass it through a transformation stage, to get a stream that can be used on the client side. Examples of this are languages that "compile" to JavaScript, or any of a few higher-level versions of CSS that are compiled to standard CSS. ResourceTransformers are contributed to the `StreamableResourceSource` service.
  Since:
    5.3
  See Also:
    `StreamableResourceSource`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ContentType` | `getTransformedContentType()` Returns the MIME type of a transformed stream.
    `InputStream` | `transform(Resource source, ResourceDependencies dependencies)` Read the source input stream and provide a new input stream of the transformed content.

- - ### Method Detail

    - #### getTransformedContentType

          ContentType getTransformedContentType()

      Returns the MIME type of a transformed stream.
      Since:
        5.4

    - #### transform

          InputStream transform(Resource source,
                                ResourceDependencies dependencies)
                         throws IOException

      Read the source input stream and provide a new input stream of the transformed content.
      Parameters:
        `source` - input content
        `dependencies` - allows additional dependencies of the source to be tracked
      Returns:
        stream of output content
      Throws:
        `IOException`

${project.version} - Copyright © 2003-2015 The Apache Software Foundation.