55import java .util .ArrayList ;
66import java .util .List ;
77
8+ /**
9+ * Represents a callable entity in the source code, such as a method or constructor.
10+ *
11+ * <p>
12+ * This class encapsulates information about the callable's file path, signature, comments,
13+ * annotations, modifiers, thrown exceptions, declaration, parameters, code, position within
14+ * the source file, return type, and various properties that characterize the callable.
15+ * </p>
16+ *
17+ * <p>
18+ * This class leverages Lombok's {@code @Data} annotation to automatically generate
19+ * getters, setters, {@code toString()}, {@code equals()}, and {@code hashCode()} methods.
20+ * </p>
21+ *
22+ * <p>
23+ * Example usage:
24+ * <pre>
25+ * Callable callable = new Callable();
26+ * callable.setFilePath("src/main/java/com/ibm/cldk/entities/Example.java");
27+ * callable.setSignature("public void exampleMethod()");
28+ * callable.setStartLine(10);
29+ * callable.setEndLine(20);
30+ * callable.setReturnType("void");
31+ * callable.setConstructor(false);
32+ * </pre>
33+ * </p>
34+ *
35+ * @author Rahul Krishna
36+ * @version 2.3.0
37+ */
838@ Data
939public class Callable {
40+ /** The file path where the callable entity is defined. */
1041 private String filePath ;
42+
43+ /** The signature of the callable entity. */
1144 private String signature ;
12- private String comment ;
45+
46+ /** A list of comments associated with the callable entity. */
47+ private List <Comment > comments ;
48+
49+ /** A list of annotations applied to the callable entity. */
1350 private List <String > annotations ;
51+
52+ /** A list of modifiers applied to the callable entity (e.g., public, private). */
1453 private List <String > modifiers ;
54+
55+ /** A list of exceptions thrown by the callable entity. */
1556 private List <String > thrownExceptions ;
57+
58+ /** The declaration of the callable entity. */
1659 private String declaration ;
60+
61+ /** A list of parameters for the callable entity. */
1762 private List <ParameterInCallable > parameters ;
63+
64+ /** The code of the callable entity. */
1865 private String code ;
66+
67+ /** The starting line number of the callable entity in the source file. */
1968 private int startLine ;
69+
70+ /** The ending line number of the callable entity in the source file. */
2071 private int endLine ;
72+
73+ /** The return type of the callable entity. */
2174 private String returnType = null ;
75+
76+ /** Indicates whether the callable entity is implicit. */
2277 private boolean isImplicit = false ;
78+
79+ /** Indicates whether the callable entity is a constructor. */
2380 private boolean isConstructor = false ;
81+
82+ /** A list of types referenced by the callable entity. */
2483 private List <String > referencedTypes ;
84+
85+ /** A list of fields accessed by the callable entity. */
2586 private List <String > accessedFields ;
87+
88+ /** A list of call sites within the callable entity. */
2689 private List <CallSite > callSites ;
90+
91+ /** A list of variable declarations within the callable entity. */
2792 private List <VariableDeclaration > variableDeclarations ;
93+
94+ /** A list of CRUD operations associated with the callable entity. */
2895 private List <CRUDOperation > crudOperations = new ArrayList <>();
96+
97+ /** A list of CRUD queries associated with the callable entity. */
2998 private List <CRUDQuery > crudQueries = new ArrayList <>();
99+
100+ /** The cyclomatic complexity of the callable entity. */
30101 private int cyclomaticComplexity ;
102+
103+ /** Indicates whether the callable entity is an entry point. */
31104 private boolean isEntrypoint = false ;
32- }
105+ }
0 commit comments