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

Method toJavaProp

packages/jsii-pacmak/lib/targets/java.ts:2158–2186  ·  view source on GitHub ↗
(
    property: spec.Property,
    definingType: spec.Type,
    inherited: boolean,
  )

Source from the content-addressed store, hash-verified

2156 }
2157
2158 private toJavaProp(
2159 property: spec.Property,
2160 definingType: spec.Type,
2161 inherited: boolean,
2162 ): JavaProp {
2163 const safeName = JavaGenerator.safeJavaPropertyName(property.name);
2164 const propName = jsiiToPascalCase(safeName);
2165
2166 const noIntersectionJavaTypes = this.toJavaTypes(
2167 removeIntersections(property.type),
2168 );
2169 const singleJavaType = forceSingleType(noIntersectionJavaTypes);
2170
2171 return {
2172 docs: property.docs,
2173 spec: property,
2174 definingType,
2175 propName,
2176 jsiiName: property.name,
2177 nullable: !!property.optional,
2178 fieldName: this.code.toCamelCase(safeName),
2179 renderedFieldType: displayStatic(singleJavaType),
2180 renderedParamType: displayType(singleJavaType, 'covariant'),
2181 renderedNativeFieldType: this.toNativeType(singleJavaType),
2182 javaTypes: this.toJavaTypes(property.type),
2183 immutable: property.immutable ?? false,
2184 inherited,
2185 };
2186 }
2187
2188 private emitClassBuilder(cls: spec.ClassType) {
2189 // Not rendering if there is no initializer, or if the initializer is protected or variadic

Callers 1

collectPropsMethod · 0.95

Calls 9

toJavaTypesMethod · 0.95
toNativeTypeMethod · 0.95
jsiiToPascalCaseFunction · 0.90
removeIntersectionsFunction · 0.85
forceSingleTypeFunction · 0.85
displayStaticFunction · 0.85
displayTypeFunction · 0.85
safeJavaPropertyNameMethod · 0.80
toCamelCaseMethod · 0.80

Tested by

no test coverage detected