Package spoon.reflect.declaration
Interface CtCodeSnippet
- All Known Subinterfaces:
CtCodeSnippetExpression<T>
,CtCodeSnippetStatement
- All Known Implementing Classes:
CtCodeSnippetExpressionImpl
,CtCodeSnippetStatementImpl
public interface CtCodeSnippet
This interface represents snippets of source code that can be used in the AST
to represent complex code without having to build the corresponding program
model structure. It is mainly provided on simplification purpose in order to
avoid having to build the program's model. Code snippets should be compiled
to validate their contents and the result of the compilation should be used
to replace the code snippet in the final AST.
- See Also:
CtType.compileAndReplaceSnippets()
-
Method Summary
Modifier and TypeMethodDescriptiongetValue()
Gets the textual value of the code.<C extends CtCodeSnippet>
CSets the textual value of the code.
-
Method Details
-
setValue
Sets the textual value of the code. -
getValue
String getValue()Gets the textual value of the code.
-