本文整理了Java中com.sun.jna.Native.getTypeMapper()
方法的一些代码示例,展示了Native.getTypeMapper()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Native.getTypeMapper()
方法的具体详情如下:
包路径:com.sun.jna.Native
类名称:Native
方法名:getTypeMapper
[英]Return the preferred TypeMapper for the given native interface.
[中]返回给定本机接口的首选类型映射器。
代码示例来源:origin: net.java.dev.jna/jna
/** Initialize the type mapper for this structure.
* If <code>null</code>, the default mapper for the
* defining class will be used.
* @param mapper Find the type mapper appropriate for this structure's
* context if none was explicitly set.
*/
private void initializeTypeMapper(TypeMapper mapper) {
if (mapper == null) {
mapper = Native.getTypeMapper(getClass());
}
this.typeMapper = mapper;
layoutChanged();
}
代码示例来源:origin: net.java.dev.jna/jna
private static Pointer get(Object obj, Class<?> cls) {
TypeMapper mapper = Native.getTypeMapper(cls);
if (mapper != null) {
ToNativeConverter nc = mapper.getToNativeConverter(cls);
代码示例来源:origin: net.java.dev.jna/jna
private CallbackReference(Callback callback, int callingConvention, boolean direct) {
super(callback);
TypeMapper mapper = Native.getTypeMapper(callback.getClass());
this.callingConvention = callingConvention;
Class<?>[] nativeParamTypes;
代码示例来源:origin: com.sun.jna/jna
/** Change the type mapping for this structure. May cause the structure
* to be resized and any existing memory to be reallocated.
* If <code>null</code>, the default mapper for the
* defining class will be used.
*/
protected void setTypeMapper(TypeMapper mapper) {
if (mapper == null) {
Class declaring = getClass().getDeclaringClass();
if (declaring != null) {
mapper = Native.getTypeMapper(declaring);
}
}
this.typeMapper = mapper;
this.size = CALCULATE_SIZE;
this.memory = null;
}
代码示例来源:origin: org.elasticsearch/jna
/** Initialize the type mapper for this structure.
* If <code>null</code>, the default mapper for the
* defining class will be used.
* @param mapper Find the type mapper appropriate for this structure's
* context if none was explicitly set.
*/
private void initializeTypeMapper(TypeMapper mapper) {
if (mapper == null) {
mapper = Native.getTypeMapper(getClass());
}
this.typeMapper = mapper;
layoutChanged();
}
代码示例来源:origin: org.elasticsearch/jna
private static Pointer get(Object obj, Class<?> cls) {
TypeMapper mapper = Native.getTypeMapper(cls);
if (mapper != null) {
ToNativeConverter nc = mapper.getToNativeConverter(cls);
代码示例来源:origin: org.elasticsearch/jna
private CallbackReference(Callback callback, int callingConvention, boolean direct) {
super(callback);
TypeMapper mapper = Native.getTypeMapper(callback.getClass());
this.callingConvention = callingConvention;
Class<?>[] nativeParamTypes;
代码示例来源:origin: com.sun.jna/jna
private CallbackReference(Callback callback, int callingConvention) {
super(callback);
Class type = getCallbackClass(callback.getClass());
TypeMapper mapper = Native.getTypeMapper(type);
Method m = getCallbackMethod(callback);
if (callback instanceof CallbackProxy) {
内容来源于网络,如有侵权,请联系作者删除!