@specs-feup/kadabra
Version:
A Java source-to-source compiler written in Typescript
52 lines • 2.43 kB
TypeScript
import { Method, InterfaceType, Class, Call, Field, App, FileJp } from "../Joinpoints.js";
/**
* Prepares a given method call by:
* - Extracting a functional interface.
* - Creating a field of that type.
* - Initializing the field with the called method.
* - Replacing the call with invocation of the field method.
*
* @param call - The method call join point.
* @param method - The method join point (optional).
* @param fieldLocation - The location to insert the field (optional).
* @param newFile - Whether to create the interface in a new file (default: true).
* @param funcInterface - The functional interface join point (optional).
* @returns An object containing the extracted field, interface, and related information.
*/
export declare function extractToField(call: Call | undefined | null, method?: Method, fieldLocation?: Class, newFile?: boolean, funcInterface?: InterfaceType | undefined | null): {
$field: Field | undefined | null;
$interface: InterfaceType | null;
$interfaceMethod: Method | undefined;
defaultMethod: string | undefined;
};
/**
* Generates a new mapping class for functional mapping.
*
* @param interfaceJp - The functional interface join point.
* @param methodName - The name of the method.
* @param getterType - The type of the getter.
* @param target - The target join point (optional).
* @returns An object containing the mapping class and related methods.
*/
export declare function newMappingClass(interfaceJp: InterfaceType, methodName: string, getterType: string, target?: Class | App | FileJp): {
$mapClass: Class;
put: (key: string, value: string) => string;
contains: (key: string) => string;
get: (param: string, defaultMethod?: string) => string;
};
/**
* Generates a new functional method caller.
*
* @param interfaceJp - The functional interface join point.
* @param methodName - The name of the method.
* @param getterType - The type of the getter.
* @param defaultMethodStr - The default method string.
* @returns An object containing the mapping class and related methods.
*/
export declare function newFunctionalMethodCaller(interfaceJp?: InterfaceType | null, methodName?: string | null, getterType?: string | null, defaultMethodStr?: string | null): {
$mapClass: Class | undefined;
put: string;
contains: string;
get: ((param: string) => string) | undefined;
};
//# sourceMappingURL=Transform.d.ts.map