Package org.thymeleaf.engine
Class Comment
- java.lang.Object
-
- org.thymeleaf.engine.AbstractTemplateEvent
-
- org.thymeleaf.engine.AbstractTextualTemplateEvent
-
- org.thymeleaf.engine.Comment
-
- All Implemented Interfaces:
java.lang.CharSequence,IEngineTemplateEvent,IComment,ITemplateEvent
final class Comment extends AbstractTextualTemplateEvent implements IComment
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringCOMMENT_PREFIXprivate static java.lang.StringCOMMENT_SUFFIXprivate java.lang.StringcomputedCommentStr(package private) java.lang.Stringprefix(package private) java.lang.Stringsuffix-
Fields inherited from class org.thymeleaf.engine.AbstractTemplateEvent
col, line, templateName
-
-
Constructor Summary
Constructors Constructor Description Comment(java.lang.CharSequence content)Comment(java.lang.CharSequence content, java.lang.String templateName, int line, int col)Comment(java.lang.String prefix, java.lang.CharSequence content, java.lang.String suffix)Comment(java.lang.String prefix, java.lang.CharSequence content, java.lang.String suffix, java.lang.String templateName, int line, int col)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(IModelVisitor visitor)Accept a visitor, implementation ofIModelVisitor.(package private) static CommentasEngineComment(IComment comment)voidbeHandled(ITemplateHandler handler)charcharAt(int index)java.lang.StringgetComment()Returns the whole Comment, including the<!--...-->prefix and suffix.java.lang.StringgetContent()Returns the content of the Comment, without the prefix or suffix.intlength()java.lang.CharSequencesubSequence(int start, int end)java.lang.StringtoString()voidwrite(java.io.Writer writer)Writes this event to the specifiedWriter.-
Methods inherited from class org.thymeleaf.engine.AbstractTextualTemplateEvent
charAtContent, contentSubSequence, getContentLength, getContentText, isInlineable, isWhitespace, writeContent
-
Methods inherited from class org.thymeleaf.engine.AbstractTemplateEvent
getCol, getLine, getTemplateName, hasLocation
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.thymeleaf.model.ITemplateEvent
getCol, getLine, getTemplateName, hasLocation
-
-
-
-
Field Detail
-
COMMENT_PREFIX
private static final java.lang.String COMMENT_PREFIX
- See Also:
- Constant Field Values
-
COMMENT_SUFFIX
private static final java.lang.String COMMENT_SUFFIX
- See Also:
- Constant Field Values
-
prefix
final java.lang.String prefix
-
suffix
final java.lang.String suffix
-
computedCommentStr
private volatile java.lang.String computedCommentStr
-
-
Constructor Detail
-
Comment
Comment(java.lang.CharSequence content)
-
Comment
Comment(java.lang.String prefix, java.lang.CharSequence content, java.lang.String suffix)
-
Comment
Comment(java.lang.CharSequence content, java.lang.String templateName, int line, int col)
-
Comment
Comment(java.lang.String prefix, java.lang.CharSequence content, java.lang.String suffix, java.lang.String templateName, int line, int col)
-
-
Method Detail
-
getComment
public java.lang.String getComment()
Description copied from interface:ICommentReturns the whole Comment, including the
<!--...-->prefix and suffix.- Specified by:
getCommentin interfaceIComment- Returns:
- the Comment.
-
getContent
public java.lang.String getContent()
Description copied from interface:ICommentReturns the content of the Comment, without the prefix or suffix.
- Specified by:
getContentin interfaceIComment- Returns:
- the content of the Comment.
-
length
public int length()
- Specified by:
lengthin interfacejava.lang.CharSequence
-
charAt
public char charAt(int index)
- Specified by:
charAtin interfacejava.lang.CharSequence
-
subSequence
public java.lang.CharSequence subSequence(int start, int end)- Specified by:
subSequencein interfacejava.lang.CharSequence
-
accept
public void accept(IModelVisitor visitor)
Description copied from interface:ITemplateEventAccept a visitor, implementation of
IModelVisitor.- Specified by:
acceptin interfaceITemplateEvent- Parameters:
visitor- the visitor.
-
write
public void write(java.io.Writer writer) throws java.io.IOExceptionDescription copied from interface:ITemplateEventWrites this event to the specified
Writer.Template output performed at
OutputTemplateHandleris done by calling these methods at each of the events resulting from template processing.- Specified by:
writein interfaceITemplateEvent- Parameters:
writer- the writer this event should be written to.- Throws:
java.io.IOException- if an input/output exception occurs.
-
beHandled
public void beHandled(ITemplateHandler handler)
- Specified by:
beHandledin interfaceIEngineTemplateEvent
-
toString
public java.lang.String toString()
- Specified by:
toStringin interfacejava.lang.CharSequence- Overrides:
toStringin classAbstractTextualTemplateEvent
-
-