Package org.thymeleaf.engine
Class AbstractTemplateEvent
java.lang.Object
org.thymeleaf.engine.AbstractTemplateEvent
- All Implemented Interfaces:
ITemplateEvent
- Direct Known Subclasses:
AbstractElementTag,AbstractTextualTemplateEvent,DocType,ProcessingInstruction,TemplateEnd,TemplateStart,XMLDeclaration
- Since:
- 3.0.0
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final int(package private) final int(package private) final String -
Constructor Summary
ConstructorsConstructorDescriptionAbstractTemplateEvent(String templateName, int line, int col) AbstractTemplateEvent(AbstractTemplateEvent original) -
Method Summary
Modifier and TypeMethodDescriptionfinal intgetCol()Returns the column at which this event can be found in the template specified byITemplateEvent.getTemplateName().final intgetLine()Returns the line at which this event can be found in the template specified byITemplateEvent.getTemplateName().final StringReturns the name of the template from which parsing this event was originally created.final booleanChecks whether this event contains location information (template name, line and column).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.thymeleaf.model.ITemplateEvent
accept, write
-
Field Details
-
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:ITemplateEventChecks 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:
hasLocationin interfaceITemplateEvent- Returns:
- whether the event contains location data or not.
-
getTemplateName
Description copied from interface:ITemplateEventReturns the name of the template from which parsing this event was originally created.
- Specified by:
getTemplateNamein interfaceITemplateEvent- Returns:
- the name of the template
-
getLine
public final int getLine()Description copied from interface:ITemplateEventReturns the line at which this event can be found in the template specified by
ITemplateEvent.getTemplateName().- Specified by:
getLinein interfaceITemplateEvent- Returns:
- the line number, starting in 1.
-
getCol
public final int getCol()Description copied from interface:ITemplateEventReturns the column at which this event can be found in the template specified by
ITemplateEvent.getTemplateName().- Specified by:
getColin interfaceITemplateEvent- Returns:
- the column number, starting in 1.
-