Class GeneratorTemplateContentLocator

    • Constructor Detail

      • GeneratorTemplateContentLocator

        public GeneratorTemplateContentLocator​(CodegenConfig codegenConfig)
        Constructs a new instance of GeneratorTemplateContentLocator for the provided CodegenConfig
        Parameters:
        codegenConfig - A generator's configuration used for determining template file location.
    • Method Detail

      • embeddedTemplateExists

        public boolean embeddedTemplateExists​(String name)
        Determines whether an embedded file with the specified name exists.
        Parameters:
        name - The name of the file (i.e. relative to resource root)
        Returns:
        true if file is an embedded resource, false if it does not exist
      • getFullTemplatePath

        public String getFullTemplatePath​(String relativeTemplateFile)
        Get the template file path with template dir prepended, and use the library template if exists. Precedence: 1) (template dir)/libraries/(library) 2) (template dir) 3) (embedded template dir)/libraries/(library) 4) (embedded template dir) Where "template dir" may be user defined and "embedded template dir" are the built-in templates for the given generator.
        Specified by:
        getFullTemplatePath in interface TemplatePathLocator
        Parameters:
        relativeTemplateFile - Template file
        Returns:
        String Full template file path