private String getJNAJar() { String cn = FromNativeConverter.class.getCanonicalName(); String rn = cn.replace('.', '/') + ".class"; String path = "."; try { path = FromNativeConverter.class.getClassLoader().getResource(rn) .getPath(); if (!checkPath(path)) return null; path = path.substring(0, path.indexOf("!")); path = new URI(path).getPath(); path.replaceAll("%20", " "); return path; } catch (Exception e1) { e1.printStackTrace(); } return null; }
private String getJNAJar() { String cn = FromNativeConverter.class.getCanonicalName(); String rn = cn.replace('.', '/') + ".class"; String path = "."; try { path = FromNativeConverter.class.getClassLoader().getResource(rn) .getPath(); if (!checkPath(path)) return null; path = path.substring(0, path.indexOf("!")); path = new URI(path).getPath(); path.replaceAll("%20", " "); return path; } catch (Exception e1) { log("could not find jna jar", e1); } return null; }
@SuppressWarnings("rawtypes") public FromNativeConverter getFromNativeConverter(Class type) { if (Enum.class.isAssignableFrom(type)) { return enumConverter; } else if (NativeObject.class.isAssignableFrom(type)) { return nativeObjectConverter; } else if (Boolean.class == type || boolean.class == type) { return booleanConverter; } else if (String.class == type) { return stringConverter; } else if (IntPtr.class == type) { return intptrConverter; } else if (GQuark.class == type) { return gquarkConverter; } return super.getFromNativeConverter(type); }
@SuppressWarnings("unchecked") public FromNativeConverter getFromNativeConverter(Class type) { if (Enum.class.isAssignableFrom(type)) { return enumConverter; } else if (GObject.GObjectProxy.class.isAssignableFrom(type)) { return nativeObjectConverter; } else if (NativeObject.class.isAssignableFrom(type)) { return nativeObjectConverter; } else if (Boolean.class == type || boolean.class == type) { return booleanConverter; } else if (IntPtr.class == type) { return intptrConverter; } else if (GQuark.class == type) { return gquarkConverter; } else if (Date.class.isAssignableFrom(type)) { return dateConverter; } return super.getFromNativeConverter(type); }