Class TemplatingCompiler

java.lang.Object
com.fluxtion.generator.util.TemplatingCompiler

public class TemplatingCompiler
extends java.lang.Object
Utility for generating and compiling a class built from a velocity template.
Author:
V12 Technology Ltd.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  TemplatingCompiler.TemplateKeys  
  • Constructor Summary

    Constructors 
    Constructor Description
    TemplatingCompiler()  
  • Method Summary

    Modifier and Type Method Description
    static void deleteGeneratedClass​(com.fluxtion.builder.generation.GenerationContext generationConfig, java.lang.String generatedClassName)  
    static <T> java.lang.Class<T> generateAndCompile​(T node, java.lang.String templateFile, com.fluxtion.builder.generation.GenerationContext generationConfig, org.apache.velocity.context.Context ctx)  
    static void initVelocity()  
    static java.lang.String writeSourceFile​(java.lang.Object node, java.lang.String templateFile, com.fluxtion.builder.generation.GenerationContext generationConfig, org.apache.velocity.context.Context ctx)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • generateAndCompile

      public static <T> java.lang.Class<T> generateAndCompile​(T node, java.lang.String templateFile, com.fluxtion.builder.generation.GenerationContext generationConfig, org.apache.velocity.context.Context ctx) throws java.io.IOException, org.apache.velocity.exception.MethodInvocationException, org.apache.velocity.exception.ParseErrorException, org.apache.velocity.exception.ResourceNotFoundException, java.lang.ClassNotFoundException
      Throws:
      java.io.IOException
      org.apache.velocity.exception.MethodInvocationException
      org.apache.velocity.exception.ParseErrorException
      org.apache.velocity.exception.ResourceNotFoundException
      java.lang.ClassNotFoundException
    • writeSourceFile

      public static java.lang.String writeSourceFile​(java.lang.Object node, java.lang.String templateFile, com.fluxtion.builder.generation.GenerationContext generationConfig, org.apache.velocity.context.Context ctx) throws java.io.IOException, org.apache.velocity.exception.MethodInvocationException, org.apache.velocity.exception.ParseErrorException, org.apache.velocity.exception.ResourceNotFoundException
      Throws:
      java.io.IOException
      org.apache.velocity.exception.MethodInvocationException
      org.apache.velocity.exception.ParseErrorException
      org.apache.velocity.exception.ResourceNotFoundException
    • deleteGeneratedClass

      public static void deleteGeneratedClass​(com.fluxtion.builder.generation.GenerationContext generationConfig, java.lang.String generatedClassName)
    • initVelocity

      public static void initVelocity() throws java.lang.RuntimeException
      Throws:
      java.lang.RuntimeException