Java 类com.sun.jna.FromNativeConverter 实例源码

项目:yajsw    文件:BSDProcess.java   
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;
}
项目:yajsw    文件:PosixProcess.java   
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;
}
项目:gstreamer1.x-java    文件:GTypeMapper.java   
@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);
   }
项目:gst1-java-core    文件:GTypeMapper.java   
@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);
   }
项目:java-gobject    文件:GTypeMapper.java   
@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);
   }