@@ -173,10 +173,29 @@ export class JavaAnalysis {
173
173
} , { } as Record < string , types . JTypeType > ) ;
174
174
}
175
175
176
+ /**
177
+ * Get all methods in the application.
178
+ * @returns {Promise<Record<string, Record<string, types.JCallableType>>> } A promise that resolves to a record of
179
+ * method names and their corresponding {@link JCallableType} objects
180
+ *
181
+ * @notes This method retrieves all methods from the symbol table and returns them as a record. The returned
182
+ * record contains class names as keys and their corresponding {@link JCallableType} objects as values.
183
+ * Each {@link JCallableType} object contains information about the method's parameters, return type, and
184
+ * other relevant details.
185
+ */
176
186
public async getAllMethods ( ) : Promise < Record < string , Record < string , types . JCallableType > > > {
177
187
return Object . entries ( await this . getAllClasses ( ) ) . reduce ( ( allMethods , [ key , value ] ) => {
178
188
allMethods [ key ] = value . callable_declarations ;
179
189
return allMethods ;
180
190
} , { } as Record < string , Record < string , types . JCallableType > > ) ;
181
191
}
192
+
193
+ public async getClassByQualifiedName ( qualifiedName : string ) : Promise < types . JTypeType > {
194
+ const allClasses = await this . getAllClasses ( ) ;
195
+ if ( allClasses [ qualifiedName ] ) {
196
+ return allClasses [ qualifiedName ] ;
197
+ }
198
+ else
199
+ throw new Error ( `Class ${ qualifiedName } not found in the application.` ) ;
200
+ }
182
201
}
0 commit comments