(
property: spec.Property,
definingType: spec.Type,
inherited: boolean,
)
| 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 |
no test coverage detected