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


Java Indexer.complete方法代码示例

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


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

示例1: index

import org.jboss.jandex.Indexer; //导入方法依赖的package包/类
@Produces
@DeploymentScoped
@Default
IndexView index() {
    Indexer indexer = new Indexer();
    Map<ArchivePath, Node> c = context.getCurrentArchive().getContent();
    try {
        for (Map.Entry<ArchivePath, Node> each : c.entrySet()) {
            if (each.getKey().get().endsWith(CLASS_SUFFIX)) {
                indexer.index(each.getValue().getAsset().openStream());
            }
        }
    } catch (IOException e) {
        throw new RuntimeException(e);
    }

    return indexer.complete();
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:19,代码来源:DeploymentProducer.java

示例2: createIndex

import org.jboss.jandex.Indexer; //导入方法依赖的package包/类
/**
 * Creates an annotation index for the given entity type
 */
public synchronized static Index createIndex(Class<?> type) {
    Index index = indices.get(type);
    if (index == null) {
        try {
            Indexer indexer = new Indexer();
            Class<?> currentType = type;
            while ( currentType != null ) {
                String className = currentType.getName().replace(".", "/") + ".class";
                InputStream stream = type.getClassLoader()
                        .getResourceAsStream(className);
                indexer.index(stream);
                currentType = currentType.getSuperclass();
            }
            index = indexer.complete();
            indices.put(type, index);
        } catch (IOException e) {
            throw new RuntimeException("Failed to initialize Indexer", e);
        }
    }
    return index;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-config-api,代码行数:25,代码来源:IndexFactory.java

示例3: loadDependentIndexFromArchive

import org.jboss.jandex.Indexer; //导入方法依赖的package包/类
protected IndexView loadDependentIndexFromArchive(File archive) throws IOException {
    try (JarFile jar = new JarFile(archive)) {

        ZipEntry entry = jar.getEntry("META-INF/" + Jandexer.INDEX_NAME);
        if (entry != null) {
            return loadIndex(jar.getInputStream(entry));

        }
        Indexer indexer = new Indexer();

        Enumeration<JarEntry> entries = jar.entries();

        while (entries.hasMoreElements()) {
            JarEntry each = entries.nextElement();
            if (each.getName().endsWith(".class") && !each.getName().equals("module-info.class")) {
                try (InputStream in = jar.getInputStream(each)) {
                    indexer.index(in);
                }
            }

        }

        return indexer.complete();
    }
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm-fraction-plugin,代码行数:26,代码来源:ConfigurableDocumentationGenerator.java

示例4: calculateModuleIndex

import org.jboss.jandex.Indexer; //导入方法依赖的package包/类
private Index calculateModuleIndex(final Module module) throws ModuleLoadException, IOException {
    final Indexer indexer = new Indexer();
    final PathFilter filter = PathFilters.getDefaultImportFilter();
    final Iterator<Resource> iterator = module.iterateResources(filter);
    while (iterator.hasNext()) {
        Resource resource = iterator.next();
        if(resource.getName().endsWith(".class")) {
            try (InputStream in = resource.openStream()) {
                indexer.index(in);
            } catch (Exception e) {
                ServerLogger.DEPLOYMENT_LOGGER.cannotIndexClass(resource.getName(), resource.getURL().toExternalForm(), e);
            }
        }
    }
    return indexer.complete();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:CompositeIndexProcessor.java

示例5: indexForClass

import org.jboss.jandex.Indexer; //导入方法依赖的package包/类
/**
 * Creates a jandex index for the specified classes
 *
 * @param classLoaderService class loader service
 * @param classes the classes to index
 *
 * @return an annotation repository w/ all the annotation discovered in the specified classes
 */
public static Index indexForClass(ClassLoaderService classLoaderService, Class<?>... classes) {
    Indexer indexer = new Indexer();
    for ( Class<?> clazz : classes ) {
        InputStream stream = classLoaderService.locateResourceStream(
                clazz.getName().replace( '.', '/' ) + ".class"
        );
        try {
            indexer.index( stream );
        }
        catch ( IOException e ) {
            StringBuilder builder = new StringBuilder();
            builder.append( "[" );
            int count = 0;
            for ( Class<?> c : classes ) {
                builder.append( c.getName() );
                if ( count < classes.length - 1 ) {
                    builder.append( "," );
                }
                count++;
            }
            builder.append( "]" );
            throw new HibernateException( "Unable to create annotation index for " + builder.toString() );
        }
    }
    return indexer.complete();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:35,代码来源:JandexHelper.java

示例6: prepare

import org.jboss.jandex.Indexer; //导入方法依赖的package包/类
@Override
@SuppressWarnings( { "unchecked" })
public void prepare(MetadataSources sources) {
    // create a jandex index from the annotated classes
    Indexer indexer = new Indexer();
    for ( Class<?> clazz : sources.getAnnotatedClasses() ) {
        indexClass( indexer, clazz.getName().replace( '.', '/' ) + ".class" );
    }

    // add package-info from the configured packages
    for ( String packageName : sources.getAnnotatedPackages() ) {
        indexClass( indexer, packageName.replace( '.', '/' ) + "/package-info.class" );
    }

    Index index = indexer.complete();

    List<JaxbRoot<JaxbEntityMappings>> mappings = new ArrayList<JaxbRoot<JaxbEntityMappings>>();
    for ( JaxbRoot<?> root : sources.getJaxbRootList() ) {
        if ( root.getRoot() instanceof JaxbEntityMappings ) {
            mappings.add( (JaxbRoot<JaxbEntityMappings>) root );
        }
    }
    if ( !mappings.isEmpty() ) {
        index = parseAndUpdateIndex( mappings, index );
    }

    if ( index.getAnnotations( PseudoJpaDotNames.DEFAULT_DELIMITED_IDENTIFIERS ) != null ) {
        // todo : this needs to move to AnnotationBindingContext
        // what happens right now is that specifying this in an orm.xml causes it to effect all orm.xmls
        metadata.setGloballyQuotedIdentifiers( true );
    }
    bindingContext = new AnnotationBindingContextImpl( metadata, index );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:34,代码来源:AnnotationMetadataSourceProcessorImpl.java

示例7: createIndex

import org.jboss.jandex.Indexer; //导入方法依赖的package包/类
Index createIndex(Archive<?> archive) throws IOException {
    Indexer indexer = new Indexer();

    Map<ArchivePath, Node> c = archive.getContent();
    for (Map.Entry<ArchivePath, Node> each : c.entrySet()) {
        if (each.getKey().get().endsWith(".class")) {
            indexer.index(each.getValue().getAsset().openStream());
        }
    }


    return indexer.complete();
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:14,代码来源:AdvertisingMetadataProcessorTest.java

示例8: testAssertThat

import org.jboss.jandex.Indexer; //导入方法依赖的package包/类
@Test
public void testAssertThat() {

    // TEST
    final Indexer indexer = new Indexer();
    final Index actual = indexer.complete();
    final JandexAssert result = JandexAssert.assertThat(actual);

    // VERIFY
    assertThat(result).isNotNull();

}
 
开发者ID:fuinorg,项目名称:units4j,代码行数:13,代码来源:JandexAssertTest.java

示例9: getIndexForClass

import org.jboss.jandex.Indexer; //导入方法依赖的package包/类
private Index getIndexForClass(URLClassLoader classLoader, String className) throws IOException {
    Indexer indexer = new Indexer();
    indexer.index(classLoader.getResourceAsStream(className));
    return indexer.complete();
}
 
开发者ID:ContaAzul,项目名称:jaxrs-path-analyzer,代码行数:6,代码来源:PathAnalyzer.java

示例10: indexAllClasses

import org.jboss.jandex.Indexer; //导入方法依赖的package包/类
/**
 * Creates an index for all class files in the given list.
 * 
 * @param classFiles
 *            List of ".class" files.
 * 
 * @return Index.
 */
public static final Index indexAllClasses(final List<File> classFiles) {
    final Indexer indexer = new Indexer();
    indexAllClasses(indexer, classFiles);
    return indexer.complete();
}
 
开发者ID:fuinorg,项目名称:units4j,代码行数:14,代码来源:Units4JUtils.java

示例11: index

import org.jboss.jandex.Indexer; //导入方法依赖的package包/类
/**
 * Returns a Jandex index for a class by it's name.
 * 
 * @param cl
 *            Class loader to use.
 * @param className
 *            Full qualified name of the class.
 * 
 * @return Jandex index.
 */
public static Index index(final ClassLoader cl, final String className) {
    final Indexer indexer = new Indexer();
    index(indexer, cl, className);
    return indexer.complete();
}
 
开发者ID:fuinorg,项目名称:units4j,代码行数:16,代码来源:Units4JUtils.java


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