Class GeneratorTemplate

java.lang.Object
net.mcreator.generator.GeneratorTemplate
Direct Known Subclasses:
ListTemplate

public class GeneratorTemplate extends Object
  • Method Details

    • getFile

      public File getFile()
      Returns:
      File where this GeneratorTemplate should be generated into
    • getTemplateIdentifier

      public String getTemplateIdentifier()
      Used to determine what template belongs to what file. Same GeneratorTemplate file of different MEs can belong to the same template entry in element definition that was used to generate said file.

      Currently used to determine which files to copy to which files when duplicating ME with locked code.

      Returns:
      String that is equal for all GeneratorTemplate generated for the same template entry in element definition
    • isHidden

      public boolean isHidden()
      Returns:
      true if this template should be visually hidden in the UI
    • getUsercodeComment

      public String getUsercodeComment()
      Returns:
      usercode comment format for this template
    • getDataModel

      public Map<String,Object> getDataModel()
      Returns:
      Data model that is used to generate this GeneratorTemplate (data accessible in FTL templates)
    • addDataModelEntry

      public void addDataModelEntry(String key, Object value)
    • toGeneratorFile

      public GeneratorFile toGeneratorFile(String code)
    • shouldBeSkippedBasedOnCondition

      public boolean shouldBeSkippedBasedOnCondition(Generator generator, Object conditionData)
    • getTemplateDefinition

      public Map<?,?> getTemplateDefinition()
      Returns:
      Map defining the template properties that generator uses
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object