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


Java Index.getKnownClasses方法代码示例

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


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

示例1: getKnownClasses

import org.jboss.jandex.Index; //导入方法依赖的package包/类
/**
 * @see {@link org.jboss.jandex.Index#getKnownClasses()}
 */
public Collection<ClassInfo> getKnownClasses() {
    final List<ClassInfo> allKnown = new ArrayList<ClassInfo>();
    for (Index index : indexes) {
        final Collection<ClassInfo> list = index.getKnownClasses();
        if (list != null) {
            allKnown.addAll(list);
        }
    }
    return Collections.unmodifiableCollection(allKnown);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:14,代码来源:CompositeIndex.java

示例2: createEntityHierarchies

import org.jboss.jandex.Index; //导入方法依赖的package包/类
/**
 * Pre-processes the annotated entities from the index and create a set of entity hierarchies which can be bound
 * to the metamodel.
 *
 * @param bindingContext The binding context, giving access to needed services and information
 *
 * @return a set of {@code EntityHierarchy} instances.
 */
public static Set<EntityHierarchy> createEntityHierarchies(AnnotationBindingContext bindingContext) {
	Set<EntityHierarchy> hierarchies = new HashSet<EntityHierarchy>();

	List<DotName> processedEntities = new ArrayList<DotName>();
	Map<DotName, List<ClassInfo>> classToDirectSubClassMap = new HashMap<DotName, List<ClassInfo>>();
	Index index = bindingContext.getIndex();
	for ( ClassInfo info : index.getKnownClasses() ) {
		if ( !isEntityClass( info ) ) {
			continue;
		}

		if ( processedEntities.contains( info.name() ) ) {
			continue;
		}

		ClassInfo rootClassInfo = findRootEntityClassInfo( index, info );
		List<ClassInfo> rootClassWithAllSubclasses = new ArrayList<ClassInfo>();
		// the root entity might have some mapped super classes which we have to take into consideration
		// for inheritance type and default access
		addMappedSuperclasses( index, rootClassInfo, rootClassWithAllSubclasses );

		// collect the current root entity and all its subclasses
		processHierarchy(
				bindingContext,
				rootClassInfo,
				rootClassWithAllSubclasses,
				processedEntities,
				classToDirectSubClassMap
		);

		AccessType defaultAccessType = determineDefaultAccessType( rootClassWithAllSubclasses );
		InheritanceType hierarchyInheritanceType = determineInheritanceType(
				rootClassInfo,
				rootClassWithAllSubclasses
		);

		// create the root entity source
		EntityClass rootEntityClass = new EntityClass(
				rootClassInfo,
				null,
				defaultAccessType,
				hierarchyInheritanceType,
				bindingContext
		);
		RootEntitySourceImpl rootSource = new RootEntitySourceImpl( rootEntityClass );

		addSubclassEntitySources(
				bindingContext,
				classToDirectSubClassMap,
				defaultAccessType,
				hierarchyInheritanceType,
				rootEntityClass,
				rootSource
		);


		hierarchies.add( new EntityHierarchyImpl( rootSource, hierarchyInheritanceType ) );
	}
	return hierarchies;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:69,代码来源:EntityHierarchyBuilder.java


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