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

Method renderTypeReference

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

* Render a type reference to something human readable for use in JavaDocs

(x: spec.TypeReference)

Source from the content-addressed store, hash-verified

3118 * Render a type reference to something human readable for use in JavaDocs
3119 */
3120 private renderTypeReference(x: spec.TypeReference): string {
3121 return visitTypeReference<string>(x, {
3122 primitive: (x) =>
3123 `{@link ${this.toJavaPrimitive(x.primitive).typeSymbol}}`,
3124 named: (x) => `{@link ${this.toNativeFqn(x.fqn)}}`,
3125 collection: (x) => {
3126 switch (x.collection.kind) {
3127 case spec.CollectionKind.Array:
3128 return `List<${this.renderTypeReference(x.collection.elementtype)}>`;
3129 case spec.CollectionKind.Map:
3130 return `Map<String, ${this.renderTypeReference(x.collection.elementtype)}>`;
3131 }
3132 },
3133 union: (x) =>
3134 `either ${x.union.types.map((x) => this.renderTypeReference(x)).join(' or ')}`,
3135 intersection: (x) =>
3136 `${x.intersection.types.map((x) => this.renderTypeReference(x)).join(' + ')}`,
3137 });
3138 }
3139
3140 private renderMethodCallArguments(method: spec.Callable) {
3141 if (!method.parameters || method.parameters.length === 0) {

Callers 2

addJavaDocsMethod · 0.95
paramJavadocMethod · 0.95

Calls 3

toJavaPrimitiveMethod · 0.95
toNativeFqnMethod · 0.95
visitTypeReferenceFunction · 0.90

Tested by

no test coverage detected