- java.lang.Object
-
- gg.jte.compiler.kotlin.KotlinCodeGenerator
-
- All Implemented Interfaces:
CodeGenerator
,TemplateParserVisitor
public class KotlinCodeGenerator extends Object implements CodeGenerator
-
-
Constructor Summary
Constructors Constructor Description KotlinCodeGenerator(TemplateCompiler compiler, gg.jte.TemplateConfig config, ConcurrentHashMap<String,List<ParamInfo>> paramOrder, gg.jte.runtime.ClassInfo classInfo, LinkedHashSet<ClassDefinition> classDefinitions, LinkedHashSet<String> templateDependencies)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<byte[]>
getBinaryTextParts()
String
getCode()
void
onCodePart(int depth, String codePart)
void
onCodeStatement(int depth, String codePart)
void
onComplete()
void
onConditionElse(int depth)
void
onConditionElse(int depth, String condition)
void
onConditionEnd(int depth)
void
onConditionStart(int depth, String condition)
void
onError(String message)
void
onForLoopEnd(int depth)
void
onForLoopStart(int depth, String codePart)
void
onHtmlAttributeOutput(int depth, TemplateParser.HtmlTag currentHtmlTag, TemplateParser.HtmlAttribute htmlAttribute)
void
onHtmlTagAttributeCodePart(int depth, String codePart, String tagName, String attributeName)
void
onHtmlTagBodyCodePart(int depth, String codePart, String tagName)
void
onImport(String importClass)
void
onInterceptHtmlAttributeStarted(int depth, TemplateParser.HtmlTag currentHtmlTag, TemplateParser.HtmlAttribute htmlAttribute)
void
onInterceptHtmlTagClosed(int depth, TemplateParser.HtmlTag htmlTag)
void
onInterceptHtmlTagOpened(int depth, TemplateParser.HtmlTag htmlTag)
void
onLineFinished()
void
onParam(String parameter)
void
onParamsComplete()
void
onTag(int depth, gg.jte.runtime.TemplateType type, String name, List<String> params)
void
onTextPart(int depth, String textPart)
void
onUnsafeCodePart(int depth, String codePart)
-
-
-
Constructor Detail
-
KotlinCodeGenerator
public KotlinCodeGenerator(TemplateCompiler compiler, gg.jte.TemplateConfig config, ConcurrentHashMap<String,List<ParamInfo>> paramOrder, gg.jte.runtime.ClassInfo classInfo, LinkedHashSet<ClassDefinition> classDefinitions, LinkedHashSet<String> templateDependencies)
-
-
Method Detail
-
onImport
public void onImport(String importClass)
- Specified by:
onImport
in interfaceTemplateParserVisitor
-
onParam
public void onParam(String parameter)
- Specified by:
onParam
in interfaceTemplateParserVisitor
-
onParamsComplete
public void onParamsComplete()
- Specified by:
onParamsComplete
in interfaceTemplateParserVisitor
-
onLineFinished
public void onLineFinished()
- Specified by:
onLineFinished
in interfaceTemplateParserVisitor
-
onComplete
public void onComplete()
- Specified by:
onComplete
in interfaceTemplateParserVisitor
-
onError
public void onError(String message)
- Specified by:
onError
in interfaceTemplateParserVisitor
-
onTextPart
public void onTextPart(int depth, String textPart)
- Specified by:
onTextPart
in interfaceTemplateParserVisitor
-
onCodePart
public void onCodePart(int depth, String codePart)
- Specified by:
onCodePart
in interfaceTemplateParserVisitor
-
onHtmlTagBodyCodePart
public void onHtmlTagBodyCodePart(int depth, String codePart, String tagName)
- Specified by:
onHtmlTagBodyCodePart
in interfaceTemplateParserVisitor
-
onHtmlTagAttributeCodePart
public void onHtmlTagAttributeCodePart(int depth, String codePart, String tagName, String attributeName)
- Specified by:
onHtmlTagAttributeCodePart
in interfaceTemplateParserVisitor
-
onUnsafeCodePart
public void onUnsafeCodePart(int depth, String codePart)
- Specified by:
onUnsafeCodePart
in interfaceTemplateParserVisitor
-
onCodeStatement
public void onCodeStatement(int depth, String codePart)
- Specified by:
onCodeStatement
in interfaceTemplateParserVisitor
-
onConditionStart
public void onConditionStart(int depth, String condition)
- Specified by:
onConditionStart
in interfaceTemplateParserVisitor
-
onConditionElse
public void onConditionElse(int depth, String condition)
- Specified by:
onConditionElse
in interfaceTemplateParserVisitor
-
onConditionElse
public void onConditionElse(int depth)
- Specified by:
onConditionElse
in interfaceTemplateParserVisitor
-
onConditionEnd
public void onConditionEnd(int depth)
- Specified by:
onConditionEnd
in interfaceTemplateParserVisitor
-
onForLoopStart
public void onForLoopStart(int depth, String codePart)
- Specified by:
onForLoopStart
in interfaceTemplateParserVisitor
-
onForLoopEnd
public void onForLoopEnd(int depth)
- Specified by:
onForLoopEnd
in interfaceTemplateParserVisitor
-
onTag
public void onTag(int depth, gg.jte.runtime.TemplateType type, String name, List<String> params)
- Specified by:
onTag
in interfaceTemplateParserVisitor
-
onInterceptHtmlTagOpened
public void onInterceptHtmlTagOpened(int depth, TemplateParser.HtmlTag htmlTag)
- Specified by:
onInterceptHtmlTagOpened
in interfaceTemplateParserVisitor
-
onInterceptHtmlAttributeStarted
public void onInterceptHtmlAttributeStarted(int depth, TemplateParser.HtmlTag currentHtmlTag, TemplateParser.HtmlAttribute htmlAttribute)
- Specified by:
onInterceptHtmlAttributeStarted
in interfaceTemplateParserVisitor
-
onInterceptHtmlTagClosed
public void onInterceptHtmlTagClosed(int depth, TemplateParser.HtmlTag htmlTag)
- Specified by:
onInterceptHtmlTagClosed
in interfaceTemplateParserVisitor
-
onHtmlAttributeOutput
public void onHtmlAttributeOutput(int depth, TemplateParser.HtmlTag currentHtmlTag, TemplateParser.HtmlAttribute htmlAttribute)
- Specified by:
onHtmlAttributeOutput
in interfaceTemplateParserVisitor
-
getCode
public String getCode()
- Specified by:
getCode
in interfaceCodeGenerator
-
getBinaryTextParts
public List<byte[]> getBinaryTextParts()
- Specified by:
getBinaryTextParts
in interfaceCodeGenerator
-
-