(Class<?> mappingClass, String fieldName, Class<?> resultClass)
| 871 | } |
| 872 | |
| 873 | private static Object lookupField(Class<?> mappingClass, String fieldName, Class<?> resultClass) { |
| 874 | try { |
| 875 | Field field = mappingClass.getField(fieldName); |
| 876 | field.setAccessible(true); |
| 877 | return field.get(null); |
| 878 | } |
| 879 | catch (NoSuchFieldException e) { |
| 880 | return null; |
| 881 | } |
| 882 | catch (Exception e) { |
| 883 | throw new IllegalArgumentException(fieldName + " must be a public field of type " |
| 884 | + resultClass.getName() + " (" |
| 885 | + e + "): " + mappingClass); |
| 886 | } |
| 887 | } |
| 888 | |
| 889 | /** Return the preferred {@link TypeMapper} for the given native interface. |
| 890 | * See {@link com.sun.jna.Library#OPTION_TYPE_MAPPER}. |
no test coverage detected