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

项目:java-gobject    文件:GBoxed.java   
private static RegisteredType boxedFor(Pointer ptr, Class<?> klass, GType gtype) {
    try {
        Constructor<?> ctor = klass.getConstructor(new Class<?>[] { GType.class, Pointer.class, TypeMapper.class });
        ctor.setAccessible(true);
        return (RegisteredType) ctor.newInstance(new Object[] { gtype, ptr, GTypeMapper.getInstance() });
    } catch (Exception e) {
        throw new RuntimeException(e);
    }       
}
项目:tools-idea    文件:PathManager.java   
@NotNull
public static Collection<String> getUtilClassPath() {
  final List<Class<?>> classes = Arrays.asList(
    PathManager.class,            // module 'util'
    NotNull.class,                // module 'annotations'
    SystemInfoRt.class,           // module 'util-rt'
    Document.class,               // jDOM
    Appender.class,               // log4j
    THashSet.class,               // trove4j
    PicoContainer.class,          // PicoContainer
    TypeMapper.class,             // JNA
    FileUtils.class,              // JNA (jna-utils)
    PatternMatcher.class          // OROMatcher
  );

  final Set<String> classPath = new HashSet<String>();
  for (Class<?> aClass : classes) {
    final String path = getJarPathForClass(aClass);
    if (path != null) {
      classPath.add(path);
    }
  }

  final String resourceRoot = getResourceRoot(PathManager.class, "/messages/CommonBundle.properties");  // platform-resources-en
  if (resourceRoot != null) {
    classPath.add(new File(resourceRoot).getAbsolutePath());
  }

  return Collections.unmodifiableCollection(classPath);
}
项目:consulo    文件:PathManager.java   
@Nonnull
public static Collection<String> getUtilClassPath() {
  final Class<?>[] classes = {PathManager.class,            // module 'util'
          Nonnull.class,                // module 'annotations'
          SystemInfoRt.class,           // module 'util-rt'
          Document.class,               // jDOM
          Appender.class,               // log4j
          THashSet.class,               // trove4j
          PicoContainer.class,          // PicoContainer
          TypeMapper.class,             // JNA
          FileUtils.class,              // JNA (jna-platform)
          PatternMatcher.class          // OROMatcher
  };

  final Set<String> classPath = new HashSet<String>();
  for (Class<?> aClass : classes) {
    final String path = getJarPathForClass(aClass);
    if (path != null) {
      classPath.add(path);
    }
  }

  final String resourceRoot = getResourceRoot(PathManager.class, "/messages/CommonBundle.properties");  // platform-resources-en
  if (resourceRoot != null) {
    classPath.add(new File(resourceRoot).getAbsolutePath());
  }

  return Collections.unmodifiableCollection(classPath);
}
项目:domino-jna    文件:BaseStructure.java   
public BaseStructure(int alignType, TypeMapper mapper) {
    super(alignType, mapper);
    setAlignType(NotesNativeAPI.getPlatformAlignment());
}
项目:domino-jna    文件:BaseStructure.java   
public BaseStructure(Pointer p, int alignType, TypeMapper mapper) {
    super(p, alignType, mapper);
    setAlignType(NotesNativeAPI.getPlatformAlignment());
}
项目:domino-jna    文件:BaseStructure.java   
public BaseStructure(TypeMapper mapper) {
    super(mapper);
    setAlignType(NotesNativeAPI.getPlatformAlignment());
}
项目:intellij-ce-playground    文件:PathManager.java   
@NotNull
public static Collection<String> getUtilClassPath() {
  final Class<?>[] classes = {
    PathManager.class,            // module 'util'
    Flow.class,                   // module 'annotations'
    SystemInfoRt.class,           // module 'util-rt'
    Document.class,               // jDOM
    Appender.class,               // log4j
    THashSet.class,               // trove4j
    PicoContainer.class,          // PicoContainer
    TypeMapper.class,             // JNA
    FileUtils.class,              // JNA (jna-platform)
    PatternMatcher.class,          // OROMatcher
    Snappy.class                   // Snappy
  };

  final Set<String> classPath = new HashSet<String>();
  for (Class<?> aClass : classes) {
    final String path = getJarPathForClass(aClass);
    if (path != null) {
      classPath.add(path);
    }
  }

  final String annotationsRoot = getJarPathForClass(Flow.class);
  if (annotationsRoot != null && !annotationsRoot.endsWith(".jar")) {
    // We're running IDEA built from sources. Flow.class is under annotations-common, and NotNull.class is under annotations. Add both
    // roots to classpath.
    final File notNullRoot = new File(new File(annotationsRoot).getParentFile(), "annotations");
    if (notNullRoot.exists()) {
      classPath.add(notNullRoot.getAbsolutePath());
    }
  }

  final String resourceRoot = getResourceRoot(PathManager.class, "/messages/CommonBundle.properties");  // platform-resources-en
  if (resourceRoot != null) {
    classPath.add(new File(resourceRoot).getAbsolutePath());
  }

  return Collections.unmodifiableCollection(classPath);
}
项目:java-gobject    文件:BoxedUnion.java   
protected BoxedUnion(TypeMapper mapper) {
    super(mapper);
    gtype = GType.INVALID;
    isNative = false;
}
项目:java-gobject    文件:BoxedUnion.java   
protected BoxedUnion(Pointer pointer, TypeMapper mapper) {
    super(mapper);
    useMemory(pointer);
    this.gtype = GType.fromClass(getClass());
    isNative = true;
}
项目:java-gobject    文件:BoxedUnion.java   
protected BoxedUnion(GType gtype, Pointer pointer, TypeMapper mapper) {
    super(mapper);
    useMemory(pointer);     
    this.gtype = gtype;
    isNative = true;
}
项目:java-gobject    文件:GBoxed.java   
public GBoxed(TypeMapper mapper) {
    this();
}
项目:java-gobject    文件:GBoxed.java   
public GBoxed(Pointer ptr, TypeMapper typeMapper) {
    super(ptr);
    this.gtype = GType.fromClass(getClass());
}
项目:java-gobject    文件:GBoxed.java   
public GBoxed(GType gtype, Pointer ptr, TypeMapper typeMapper) {
    this(gtype, ptr);
}
项目:java-gobject    文件:BoxedStructure.java   
protected BoxedStructure(TypeMapper mapper) {
    super(mapper);
    gtype = GType.INVALID; // Should not be used
    isNative = false;
}
项目:java-gobject    文件:BoxedStructure.java   
protected BoxedStructure(Pointer pointer, TypeMapper mapper) {
    super(mapper);
    useMemory(pointer);
    this.gtype = GType.fromClass(getClass());
    isNative = true;
}
项目:java-gobject    文件:BoxedStructure.java   
protected BoxedStructure(GType gtype, Pointer pointer, TypeMapper mapper) {
    super(mapper);
    useMemory(pointer);
    this.gtype = gtype;
    isNative = true;
}