Returns a code block for binding's ContributionBinding#mapKey() map key. If for whatever reason the map key is not accessible from within requestingClass (i.e. it has a package-private enum from a different package), this will return an invocation of a proxy-method gi
(ContributionBinding binding, ClassName requestingClass)
| 145 | * map} contribution. |
| 146 | */ |
| 147 | static CodeBlock getMapKeyExpression(ContributionBinding binding, ClassName requestingClass) { |
| 148 | AnnotationMirror mapKeyAnnotation = binding.mapKey().get(); |
| 149 | return MapKeyAccessibility.isMapKeyAccessibleFrom( |
| 150 | mapKeyAnnotation, requestingClass.packageName()) |
| 151 | ? directMapKeyExpression(mapKeyAnnotation) |
| 152 | : CodeBlock.of("$T.mapKey()", generatedClassNameForBinding(binding)); |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * Returns a code block for the map key annotation {@code mapKey}. |
no test coverage detected