Class AbstractTemplateEvent

java.lang.Object
org.thymeleaf.engine.AbstractTemplateEvent
All Implemented Interfaces:
ITemplateEvent
Direct Known Subclasses:
AbstractElementTag, AbstractTextualTemplateEvent, DocType, ProcessingInstruction, TemplateEnd, TemplateStart, XMLDeclaration

abstract class AbstractTemplateEvent extends Object implements ITemplateEvent
Since:
3.0.0
  • Field Details

    • templateName

      final String templateName
    • line

      final int line
    • col

      final int col
  • Constructor Details

    • AbstractTemplateEvent

      AbstractTemplateEvent()
    • AbstractTemplateEvent

      AbstractTemplateEvent(String templateName, int line, int col)
    • AbstractTemplateEvent

      AbstractTemplateEvent(AbstractTemplateEvent original)
  • Method Details

    • hasLocation

      public final boolean hasLocation()
      Description copied from interface: ITemplateEvent

      Checks whether this event contains location information (template name, line and column).

      Only events that are generated during the parsing of templates contain location info, locating them in their original template. All events generated during template processing and not originally present at the template do not contain this location data.

      Specified by:
      hasLocation in interface ITemplateEvent
      Returns:
      whether the event contains location data or not.
    • getTemplateName

      public final String getTemplateName()
      Description copied from interface: ITemplateEvent

      Returns the name of the template from which parsing this event was originally created.

      Specified by:
      getTemplateName in interface ITemplateEvent
      Returns:
      the name of the template
    • getLine

      public final int getLine()
      Description copied from interface: ITemplateEvent

      Returns the line at which this event can be found in the template specified by ITemplateEvent.getTemplateName().

      Specified by:
      getLine in interface ITemplateEvent
      Returns:
      the line number, starting in 1.
    • getCol

      public final int getCol()
      Description copied from interface: ITemplateEvent

      Returns the column at which this event can be found in the template specified by ITemplateEvent.getTemplateName().

      Specified by:
      getCol in interface ITemplateEvent
      Returns:
      the column number, starting in 1.