com.togethersoft.openapi.sci
Interface SciComment


public interface SciComment
extends SciObject

Represents a comment in the source code.


Instances of SciComment are present in returned by SciContainer.objects()
for SciClass and SciFile. More implementations of SciContainer will support this feature in future versions.
It is possible to search for a particular comment around the given SciObject by a call to
SciLanguageHelper.getComment(SciObject obj, boolean before)


The getKind() method allows to determine the kind of comment - block comment, line comment,
or documentation comment (comment with specially formatted content, such as Javadoc comment). One of
3 constants (BLOCK, LINE, DOC) declared within this interface is returned.


Note that content of documentation comments is also available through SciElement.getTagsList()

Author:
TogetherSoft
Since: Together 6.0
See Also: SciContainer.objects(), SciLanguageHelper.getComment(com.togethersoft.openapi.sci.SciObject,boolean)

Field Summary
 final static intBLOCK
           
 final static intDOC
           
 final static intLINE
           

Method Summary
 booleancanSetContent(String content)
          Checks whether it is possible to replace the content of the comment with the given text.
 StringgetContent()
          Returns content of comment
 intgetKind()
           
 voidsetContent(String content)
          Replaces the content of the comment with the given text.

Methods inherited from interface com.togethersoft.openapi.sci.SciObject
canCut, canDelete, canReplace, copy, cut, delete, getContainingFile, getContainingScope, getLanguage, getPositions, getText, getUserProperty, isReadOnly, replace, setUserProperty

Field Detail

BLOCK

public final static int BLOCK

DOC

public final static int DOC

LINE

public final static int LINE
Method Detail

canSetContent

public boolean canSetContent(String content)
Checks whether it is possible to replace the content of the comment with the given text.

getContent

public String getContent()
Returns content of comment
Returns: content of comment

getKind

public int getKind()

setContent

public void setContent(String content)
Replaces the content of the comment with the given text.