org.apache.torque.generator.template.velocity

## Class VelocityTemplateFilter

- java.lang.Object
- - org.apache.torque.generator.template.velocity.VelocityTemplateFilter

- All Implemented Interfaces:
    TemplateFilter

      public class VelocityTemplateFilter
      extends Object
      implements TemplateFilter

  A Filter for velocity templates. It has the effect of beautifying the output of the velocity outlet.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `VelocityTemplateFilter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `InputStream` | `filter(InputStream resource, String encoding)` This method filters the template and replaces some unwanted characters.

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

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

- - ### Constructor Detail

    - #### VelocityTemplateFilter

          public VelocityTemplateFilter()

  - ### Method Detail

    - #### filter

          public InputStream filter(InputStream resource,
                                    String encoding)
                             throws IOException

      This method filters the template and replaces some unwanted characters. For example it removes leading spaces in front of velocity commands and replaces tabs with spaces to prevent bounces in different code editors with different tab-width-setting.
      Specified by:
        `filter` in interface `TemplateFilter`
      Parameters:
        `resource` - the input stream to filter.
        `encoding` - the encoding to use, or null for the system encoding.
      Returns:
        the filtered input stream.
      Throws:
        `IOException` - if creating, reading or writing to a stream fails.

Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.