Package spoon.support.reflect.code
Class CtJavaDocImpl
- java.lang.Object
-
- spoon.support.reflect.declaration.CtElementImpl
-
- spoon.support.reflect.code.CtCodeElementImpl
-
- spoon.support.reflect.code.CtStatementImpl
-
- spoon.support.reflect.code.CtCommentImpl
-
- spoon.support.reflect.code.CtJavaDocImpl
-
- All Implemented Interfaces:
Serializable
,Cloneable
,FactoryAccessor
,CtCodeElement
,CtComment
,CtJavaDoc
,CtStatement
,SourcePositionHolder
,CtElement
,CtQueryable
,CtVisitable
public class CtJavaDocImpl extends CtCommentImpl implements CtJavaDoc
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface spoon.reflect.code.CtComment
CtComment.CommentType
-
-
Field Summary
-
Fields inherited from class spoon.support.reflect.code.CtCommentImpl
content
-
Fields inherited from class spoon.support.reflect.declaration.CtElementImpl
ERROR_MESSAGE_TO_STRING, factory, LOGGER, parent
-
Fields inherited from interface spoon.reflect.code.CtComment
LINE_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description CtJavaDocImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(CtVisitor visitor)
Accepts a visitor<E extends CtJavaDoc>
EaddTag(int index, CtJavaDocTag tag)
Add a new tag at the index position<E extends CtJavaDoc>
EaddTag(CtJavaDocTag tag)
Add a new tag at the end of the listCtJavaDoc
clone()
Clone the element which calls this method in a new object.List<JavadocDescriptionElement>
getJavadocElements()
Returns the list of parsed Javadoc elementsString
getLongDescription()
Get the long description of the javadocString
getShortDescription()
Get the short summary of the javadoc (first sentence of the javadoc)List<CtJavaDocTag>
getTags()
Get all the tag of the javadoc<E extends CtJavaDoc>
EremoveTag(int index)
Remove a tag from the index<E extends CtJavaDoc>
EremoveTag(CtJavaDocTag tag)
Remove a specific tag<E extends CtComment>
EsetContent(String content)
Parses the content string to split in two: the description and the Javadoc tags<E extends CtJavaDoc>
EsetTags(List<CtJavaDocTag> tags)
Define the list of tags-
Methods inherited from class spoon.support.reflect.code.CtCommentImpl
_setRawContent, asJavaDoc, equals, getCommentType, getContent, getRawContent, hashCode, setCommentType
-
Methods inherited from class spoon.support.reflect.code.CtStatementImpl
getLabel, insertAfter, insertAfter, insertAfter, insertAfter, insertBefore, insertBefore, insertBefore, insertBefore, setLabel
-
Methods inherited from class spoon.support.reflect.code.CtCodeElementImpl
partiallyEvaluate
-
Methods inherited from class spoon.support.reflect.declaration.CtElementImpl
addAnnotation, addComment, asIterable, comment, delete, descendantIterator, emptyList, emptySet, filterChildren, getAllMetadata, getAnnotatedChildren, getAnnotation, getAnnotation, getAnnotations, getComments, getDirectChildren, getDocComment, getElements, getFactory, getMetadata, getMetadataKeys, getOriginalSourceFragment, getParent, getParent, getParent, getPath, getPosition, getReferencedTypes, getRoleInParent, getShortRepresentation, getValueByRole, hasAnnotation, hasParent, isImplicit, isParentInitialized, map, map, prettyprint, putMetadata, removeAnnotation, removeComment, replace, replace, setAllMetadata, setAnnotations, setComments, setDocComment, setFactory, setImplicit, setParent, setPosition, setPositions, setValueByRole, toString, toStringDebug, unmodifiableList, updateAllParentsBelow
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface spoon.reflect.code.CtCodeElement
partiallyEvaluate
-
Methods inherited from interface spoon.reflect.code.CtComment
asJavaDoc, getCommentType, getContent, getRawContent, setCommentType
-
Methods inherited from interface spoon.reflect.declaration.CtElement
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
-
Methods inherited from interface spoon.reflect.visitor.chain.CtQueryable
filterChildren, map, map
-
Methods inherited from interface spoon.reflect.code.CtStatement
comment, getLabel, insertAfter, insertAfter, insertBefore, insertBefore, setLabel
-
Methods inherited from interface spoon.processing.FactoryAccessor
getFactory, setFactory
-
-
-
-
Method Detail
-
getTags
public List<CtJavaDocTag> getTags()
Description copied from interface:CtJavaDoc
Get all the tag of the javadoc
-
setTags
public <E extends CtJavaDoc> E setTags(List<CtJavaDocTag> tags)
Description copied from interface:CtJavaDoc
Define the list of tags
-
addTag
public <E extends CtJavaDoc> E addTag(CtJavaDocTag tag)
Description copied from interface:CtJavaDoc
Add a new tag at the end of the list
-
addTag
public <E extends CtJavaDoc> E addTag(int index, CtJavaDocTag tag)
Description copied from interface:CtJavaDoc
Add a new tag at the index position
-
removeTag
public <E extends CtJavaDoc> E removeTag(int index)
Description copied from interface:CtJavaDoc
Remove a tag from the index
-
removeTag
public <E extends CtJavaDoc> E removeTag(CtJavaDocTag tag)
Description copied from interface:CtJavaDoc
Remove a specific tag
-
getShortDescription
public String getShortDescription()
Description copied from interface:CtJavaDoc
Get the short summary of the javadoc (first sentence of the javadoc)- Specified by:
getShortDescription
in interfaceCtJavaDoc
- Returns:
- the summary of the javadoc
-
setContent
public <E extends CtComment> E setContent(String content)
Parses the content string to split in two: the description and the Javadoc tags- Specified by:
setContent
in interfaceCtComment
- Overrides:
setContent
in classCtCommentImpl
-
getLongDescription
public String getLongDescription()
Description copied from interface:CtJavaDoc
Get the long description of the javadoc- Specified by:
getLongDescription
in interfaceCtJavaDoc
- Returns:
- the long description of the javadoc
-
accept
public void accept(CtVisitor visitor)
Description copied from interface:CtVisitable
Accepts a visitor- Specified by:
accept
in interfaceCtVisitable
- Overrides:
accept
in classCtCommentImpl
-
clone
public CtJavaDoc clone()
Description copied from interface:CtElement
Clone the element which calls this method in a new object. Note that that references are kept as is, and thus, so if you clone whole classes or methods, some parts of the cloned element (eg executable references) may still point to the initial element. In this case, consider using methodsRefactoring.copyType(CtType)
andRefactoring.copyMethod(CtMethod)
instead which does additional work beyond cloning.- Specified by:
clone
in interfaceCtCodeElement
- Specified by:
clone
in interfaceCtComment
- Specified by:
clone
in interfaceCtElement
- Specified by:
clone
in interfaceCtJavaDoc
- Specified by:
clone
in interfaceCtStatement
- Overrides:
clone
in classCtCommentImpl
-
getJavadocElements
public List<JavadocDescriptionElement> getJavadocElements()
Description copied from interface:CtJavaDoc
Returns the list of parsed Javadoc elements- Specified by:
getJavadocElements
in interfaceCtJavaDoc
-
-