本文整理汇总了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);
}
示例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;
}