public interface CtComment extends CtStatement
int x = 0;
// a comment
Modifier and Type | Interface and Description |
---|---|
static class |
CtComment.CommentType |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LINE_SEPARATOR
This line separator is used in comments returned by
getContent() . |
Modifier and Type | Method and Description |
---|---|
CtJavaDoc |
asJavaDoc()
Utility method to for casting the object, throws an exception if not of the correct type
|
CtComment |
clone()
Clone the element which calls this method in a new object.
|
CtComment.CommentType |
getCommentType()
Get the type of the comment
|
java.lang.String |
getContent()
Get the content of the comment
|
java.lang.String |
getRawContent() |
<E extends CtComment> |
setCommentType(CtComment.CommentType commentType) |
<E extends CtComment> |
setContent(java.lang.String content) |
comment, getLabel, insertAfter, insertAfter, insertBefore, insertBefore, setLabel
partiallyEvaluate
addAnnotation, addComment, asIterable, delete, descendantIterator, getAllMetadata, getAnnotatedChildren, getAnnotation, getAnnotation, getAnnotations, getComments, getDirectChildren, getDocComment, getElements, getMetadata, getMetadataKeys, getOriginalSourceFragment, getParent, getParent, getParent, getPath, getPosition, getReferencedTypes, getRoleInParent, getShortRepresentation, getValueByRole, hasAnnotation, hasParent, isImplicit, isParentInitialized, prettyprint, putMetadata, removeAnnotation, removeComment, replace, replace, setAllMetadata, setAnnotations, setComments, setDocComment, setImplicit, setParent, setPosition, setPositions, setValueByRole, toString, toStringDebug, updateAllParentsBelow
getFactory, setFactory
accept
filterChildren, map, map
static final java.lang.String LINE_SEPARATOR
getContent()
.
It is OS independent.
It has no influence to pretty printed comments, which uses by default OS dependent line separatorjava.lang.String getContent()
<E extends CtComment> E setContent(java.lang.String content)
java.lang.String getRawContent()
setContent(String)
doesn't influence the returned value, only the value of the position object.CtComment.CommentType getCommentType()
<E extends CtComment> E setCommentType(CtComment.CommentType commentType)
CtComment clone()
CtElement
Refactoring.copyType(CtType)
and Refactoring.copyMethod(CtMethod)
instead which does additional work beyond cloning.clone
in interface CtCodeElement
clone
in interface CtElement
clone
in interface CtStatement
CtJavaDoc asJavaDoc()
Copyright © 2007–2021 Inria. All rights reserved.