MCPcopy Index your code
hub / github.com/aws/jsii / safeJavaMethodName

Method safeJavaMethodName

packages/jsii-pacmak/lib/targets/java.ts:691–705  ·  view source on GitHub ↗

* Turns a raw javascript method name (eg: 'import') into a safe Java method name (eg: 'doImport'). * @param methodName

(methodName: string)

Source from the content-addressed store, hash-verified

689 * @param methodName
690 */
691 private static safeJavaMethodName(methodName: string) {
692 if (!methodName) {
693 return methodName;
694 }
695
696 if (methodName === '_') {
697 // Different pattern for this one. Also this should never happen, who names a function '_' ??
698 return 'doIt';
699 }
700
701 if (JavaGenerator.RESERVED_KEYWORDS.includes(methodName)) {
702 return `do${jsiiToPascalCase(methodName)}`;
703 }
704 return methodName;
705 }
706
707 /** If false, @Generated will not include generator version nor timestamp */
708 private emitFullGeneratorInfo?: boolean;

Callers 2

onInterfaceMethodMethod · 0.80
emitMethodMethod · 0.80

Calls 1

jsiiToPascalCaseFunction · 0.90

Tested by

no test coverage detected