Returns a TypeMirror for the binding that is accessible to the component.
(TypeMirror type, ClassName requestingClass)
| 137 | |
| 138 | /** Returns a {@link TypeMirror} for the binding that is accessible to the component. */ |
| 139 | protected final TypeMirror accessibleType(TypeMirror type, ClassName requestingClass) { |
| 140 | if (Accessibility.isTypeAccessibleFrom(type, requestingClass.packageName())) { |
| 141 | return type; |
| 142 | } else if (type.getKind().equals(TypeKind.DECLARED) |
| 143 | && Accessibility.isRawTypeAccessible(type, requestingClass.packageName())) { |
| 144 | return getDeclaredType(MoreTypes.asTypeElement(type)); |
| 145 | } else { |
| 146 | return elements.getTypeElement(Object.class).asType(); |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | /** |
| 151 | * Throws {@link TypeNotPresentException} if {@code type} is an {@link |
no test coverage detected