当前位置: 首页>>代码示例>>Java>>正文


Java Library.value方法代码示例

本文整理汇总了Java中org.bridj.ann.Library.value方法的典型用法代码示例。如果您正苦于以下问题:Java Library.value方法的具体用法?Java Library.value怎么用?Java Library.value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bridj.ann.Library的用法示例。


在下文中一共展示了Library.value方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: register

import org.bridj.ann.Library; //导入方法依赖的package包/类
@Override
public void register(Type type) {
    Class<?> typeClass = Utils.getClass(type);
    typeClass.getAnnotation(Library.class);
    Library libAnn = typeClass.getAnnotation(Library.class);
    if (libAnn != null) {
        String name = libAnn.value();
        File libraryFile = BridJ.getNativeLibraryFile(name);
        if (libraryFile != null) {
            System.load(libraryFile.toString());
        }
        if (ObjCObject.class.isAssignableFrom(typeClass)) {
            bridjClassesByObjCName.put(typeClass.getSimpleName(), (Class<? extends ObjCObject>) typeClass);
        }
    }

    super.register(type);
}
 
开发者ID:nativelibs4java,项目名称:BridJ,代码行数:19,代码来源:ObjectiveCRuntime.java

示例2: getNativeLibrary

import org.bridj.ann.Library; //导入方法依赖的package包/类
@Override
protected NativeLibrary getNativeLibrary(Class<?> type) throws IOException {
    Library libAnn = type.getAnnotation(Library.class);
    if (libAnn != null) {
        try {
            String name = libAnn.value();
            return BridJ.getNativeLibrary(name, new File("/System/Library/Frameworks/" + name + ".framework/" + name));
        } catch (FileNotFoundException ex) {
        }
    }

    return super.getNativeLibrary(type);
}
 
开发者ID:nativelibs4java,项目名称:BridJ,代码行数:14,代码来源:ObjectiveCRuntime.java

示例3: getNativeLibrary

import org.bridj.ann.Library; //导入方法依赖的package包/类
public static synchronized NativeLibrary getNativeLibrary(AnnotatedElement type) throws IOException {
    NativeLibrary lib = librariesByClass.get(type);
    if (lib == null) {
        Library libraryAnnotation = getLibrary(type);
        if (libraryAnnotation != null) {
            String libraryName = libraryAnnotation.value();
            String dependenciesEnv = getDependenciesEnv(libraryName);
            List<String> dependencies = libraryDependencies.get(libraryName);
            List<String> staticDependencies = Arrays.asList(
                    dependenciesEnv == null ? libraryAnnotation.dependencies() : dependenciesEnv.split(","));
            if (dependencies == null) {
                dependencies = staticDependencies;
            } else {
                dependencies.addAll(staticDependencies);
            }

            for (String dependency : dependencies) {
                if (verbose) {
                    info("Trying to load dependency '" + dependency + "' of '" + libraryName + "'");
                }
                NativeLibrary depLib = getNativeLibrary(dependency);
                if (depLib == null) {
                    throw new RuntimeException("Failed to load dependency '" + dependency + "' of library '" + libraryName + "'");
                }
            }
            lib = getNativeLibrary(libraryName);
            if (lib != null) {
                librariesByClass.put(type, lib);
            }
        }
    }
    return lib;
}
 
开发者ID:nativelibs4java,项目名称:BridJ,代码行数:34,代码来源:BridJ.java

示例4: getNativeLibraryName

import org.bridj.ann.Library; //导入方法依赖的package包/类
/**
 * Gets the name of the library declared for an annotated element. Recurses
 * up to parents of the element (class, enclosing classes) to find any
 * {@link org.bridj.ann.Library} annotation.
 */
public static String getNativeLibraryName(AnnotatedElement m) {
    Library lib = getLibrary(m);
    return lib == null ? null : lib.value();
}
 
开发者ID:nativelibs4java,项目名称:BridJ,代码行数:10,代码来源:BridJ.java


注:本文中的org.bridj.ann.Library.value方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。