Record Class LanguageTaskDefaults

java.lang.Object
java.lang.Record
name.jurgenei.gradle.antlr.LanguageTaskDefaults

public record LanguageTaskDefaults(String grammar, String parserClassName, String lexerClassName, String startRule, List<String> includes, String targetExtension, String xirFormat) extends Record
Shared conventions for language-specific XmlAst task variants.

Language plugin modules use this type to reduce constructor boilerplate and keep task defaults consistent when adding new language integrations.

  • Constructor Details

    • LanguageTaskDefaults

      public LanguageTaskDefaults(String grammar, String parserClassName, String lexerClassName, String startRule, List<String> includes, String targetExtension, String xirFormat)
      Creates an instance of a LanguageTaskDefaults record class.
      Parameters:
      grammar - the value for the grammar record component
      parserClassName - the value for the parserClassName record component
      lexerClassName - the value for the lexerClassName record component
      startRule - the value for the startRule record component
      includes - the value for the includes record component
      targetExtension - the value for the targetExtension record component
      xirFormat - the value for the xirFormat record component
  • Method Details

    • of

      public static LanguageTaskDefaults of(String grammar, String parserClassName, String lexerClassName, String startRule, List<String> includes)
      Creates language defaults with XML output and compact S-expression rendering defaults.
    • of

      public static LanguageTaskDefaults of(String grammar, String parserClassName, String lexerClassName, String startRule, List<String> includes, String targetExtension, String xirFormat)
      Creates language defaults with explicit output extension and S-expression format.
    • applyTo

      public void applyTo(XmlAstGradleTask task)
      Applies defaults to a language-specific XmlAst task.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • grammar

      public String grammar()
      Returns the value of the grammar record component.
      Returns:
      the value of the grammar record component
    • parserClassName

      public String parserClassName()
      Returns the value of the parserClassName record component.
      Returns:
      the value of the parserClassName record component
    • lexerClassName

      public String lexerClassName()
      Returns the value of the lexerClassName record component.
      Returns:
      the value of the lexerClassName record component
    • startRule

      public String startRule()
      Returns the value of the startRule record component.
      Returns:
      the value of the startRule record component
    • includes

      public List<String> includes()
      Returns the value of the includes record component.
      Returns:
      the value of the includes record component
    • targetExtension

      public String targetExtension()
      Returns the value of the targetExtension record component.
      Returns:
      the value of the targetExtension record component
    • xirFormat

      public String xirFormat()
      Returns the value of the xirFormat record component.
      Returns:
      the value of the xirFormat record component