Interface Template

All Known Implementing Classes:
Template.Default, Templates

public interface Template
模板接口
Author:
Maning
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Template默认实现
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    函数默认优先级最高
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    模板名称,一般不需要,返回null即可,内置模板会有名称,方便被方言覆写
    static Template
    of(String template)
    从字符串获取模板
    default int
    优先级,越大越优先,作用于操作符
    模板内容,使用{}代表参数占位
  • Field Details

    • FUNCTION_PRECEDENCE

      static final int FUNCTION_PRECEDENCE
      函数默认优先级最高
      See Also:
  • Method Details

    • of

      static Template of(String template)
      从字符串获取模板
      Parameters:
      template - 模板
      Returns:
      模板
    • name

      default String name()
      模板名称,一般不需要,返回null即可,内置模板会有名称,方便被方言覆写
      Returns:
      模板名称
    • precedence

      default int precedence()
      优先级,越大越优先,作用于操作符
      Returns:
      优先级
    • template

      String template()
      模板内容,使用{}代表参数占位
      Returns:
      模板