org.apache.tiles.autotag.generate

## Class AbstractTemplateClassGenerator

- java.lang.Object
- - org.apache.tiles.autotag.generate.AbstractTemplateClassGenerator

- All Implemented Interfaces:
    TemplateClassGenerator
  Direct Known Subclasses:
    FMModelGenerator, TagClassGenerator, VelocityDirectiveGenerator

      public abstract class AbstractTemplateClassGenerator
      extends Object
      implements TemplateClassGenerator

  A base template class generator.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractTemplateClassGenerator(org.apache.velocity.app.VelocityEngine velocityEngine)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `generate(File directory, String packageName, TemplateSuite suite, TemplateClass clazz, Map<String,String> parameters, String runtimeClass, String requestClass)` Generates the code.
    `protected abstract String` | `getDirectoryName(File directory, String packageName, TemplateSuite suite, TemplateClass clazz, Map<String,String> parameters, String runtimeClass, String requestClass)` Calculates and returns the directory where the file will be written..
    `protected abstract String` | `getFilename(File directory, String packageName, TemplateSuite suite, TemplateClass clazz, Map<String,String> parameters, String runtimeClass, String requestClass)` Calculates and returns the filename of the generated file.
    `protected abstract String` | `getTemplatePath(File directory, String packageName, TemplateSuite suite, TemplateClass clazz, Map<String,String> parameters, String runtimeClass, String requestClass)` Calculates and returns the template path.

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

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

- - ### Constructor Detail

    - #### AbstractTemplateClassGenerator

          public AbstractTemplateClassGenerator(org.apache.velocity.app.VelocityEngine velocityEngine)

      Constructor.
      Parameters:
        `velocityEngine` - The Velocity engine.

  - ### Method Detail

    - #### generate

          public void generate(File directory,
                               String packageName,
                               TemplateSuite suite,
                               TemplateClass clazz,
                               Map<String,String> parameters,
                               String runtimeClass,
                               String requestClass)

      Description copied from interface: `TemplateClassGenerator`
      Generates the code.
      Specified by:
        `generate` in interface `TemplateClassGenerator`
      Parameters:
        `directory` - The base directory where the code will be put.
        `packageName` - The package name.
        `suite` - The template suite.
        `clazz` - The template class.
        `parameters` - Configuration parameters.
        `runtimeClass` - The RequestBuilder implementation.

    - #### getTemplatePath

          protected abstract String getTemplatePath(File directory,
                                                    String packageName,
                                                    TemplateSuite suite,
                                                    TemplateClass clazz,
                                                    Map<String,String> parameters,
                                                    String runtimeClass,
                                                    String requestClass)

      Calculates and returns the template path.
      Parameters:
        `directory` - The directory where the file will be written.
        `packageName` - The name of the package.
        `suite` - The template suite.
        `clazz` - The template class.
        `parameters` - The map of parameters.
      Returns:
        The template path.

    - #### getFilename

          protected abstract String getFilename(File directory,
                                                String packageName,
                                                TemplateSuite suite,
                                                TemplateClass clazz,
                                                Map<String,String> parameters,
                                                String runtimeClass,
                                                String requestClass)

      Calculates and returns the filename of the generated file.
      Parameters:
        `directory` - The directory where the file will be written.
        `packageName` - The name of the package.
        `suite` - The template suite.
        `clazz` - The template class.
        `parameters` - The map of parameters.
      Returns:
        The template path.

    - #### getDirectoryName

          protected abstract String getDirectoryName(File directory,
                                                     String packageName,
                                                     TemplateSuite suite,
                                                     TemplateClass clazz,
                                                     Map<String,String> parameters,
                                                     String runtimeClass,
                                                     String requestClass)

      Calculates and returns the directory where the file will be written..
      Parameters:
        `directory` - The directory where the file will be written.
        `packageName` - The name of the package.
        `suite` - The template suite.
        `clazz` - The template class.
        `parameters` - The map of parameters.
      Returns:
        The template path.

Copyright © 2000–2025 Apache Software Foundation. All rights reserved.