org.apache.tapestry5.internal.webresources

## Class LessResourceTransformer

- java.lang.Object
- - org.apache.tapestry5.internal.webresources.LessResourceTransformer

- All Implemented Interfaces:
    ResourceTransformer

      public class LessResourceTransformer
      extends Object
      implements ResourceTransformer

  Direct wrapper around the LessCompiler, so that Less source files may use `@import`, which isn't supported by the normal WRO4J processor.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LessResourceTransformer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected com.github.sommeri.less4j.LessCompiler.CompilationResult` | `compile(com.github.sommeri.less4j.LessCompiler compiler, com.github.sommeri.less4j.LessSource lessSource)` Invoked from `transform(org.apache.tapestry5.ioc.Resource, org.apache.tapestry5.services.assets.ResourceDependencies)` to perform the actual work of compiling a `Resource` which has been wrapped as a `LessSource`.
    `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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LessResourceTransformer

          public LessResourceTransformer()

  - ### Method Detail

    - #### getTransformedContentType

          public ContentType getTransformedContentType()

      Description copied from interface: `ResourceTransformer`
      Returns the MIME type of a transformed stream.
      Specified by:
        `getTransformedContentType` in interface `ResourceTransformer`

    - #### transform

          public InputStream transform(Resource source,
                              ResourceDependencies dependencies)
                                throws IOException

      Description copied from interface: `ResourceTransformer`
      Read the source input stream and provide a new input stream of the transformed content.
      Specified by:
        `transform` in interface `ResourceTransformer`
      Parameters:
        `source` - input content
        `dependencies` - allows additional dependencies of the source to be tracked
      Returns:
        stream of output content
      Throws:
        `IOException`

    - #### compile

          protected com.github.sommeri.less4j.LessCompiler.CompilationResult compile(com.github.sommeri.less4j.LessCompiler compiler,
                                                                         com.github.sommeri.less4j.LessSource lessSource)
                                                                              throws com.github.sommeri.less4j.Less4jException

      Invoked from `transform(org.apache.tapestry5.ioc.Resource, org.apache.tapestry5.services.assets.ResourceDependencies)` to perform the actual work of compiling a `Resource` which has been wrapped as a `LessSource`.
      Throws:
        `com.github.sommeri.less4j.Less4jException`

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