本文整理汇总了Java中org.jboss.jandex.Index.create方法的典型用法代码示例。如果您正苦于以下问题:Java Index.create方法的具体用法?Java Index.create怎么用?Java Index.create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.jandex.Index
的用法示例。
在下文中一共展示了Index.create方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
import org.jboss.jandex.Index; //导入方法依赖的package包/类
/**
* Build new {@link Index} with mocked annotations from orm.xml.
* This method should be only called once per {@org.hibernate.metamodel.source.annotations.xml.mocker.IndexBuilder IndexBuilder} instance.
*
* @param globalDefaults Global defaults from <persistence-unit-metadata>, or null.
*
* @return Index.
*/
Index build(EntityMappingsMocker.Default globalDefaults) {
//merge annotations that not overrided by xml into the new Index
for ( ClassInfo ci : index.getKnownClasses() ) {
DotName name = ci.name();
if ( indexedClassInfoAnnotationsMap.containsKey( name ) ) {
//this class has been overrided by orm.xml
continue;
}
if ( ci.annotations() != null && !ci.annotations().isEmpty() ) {
Map<DotName, List<AnnotationInstance>> tmp = new HashMap<DotName, List<AnnotationInstance>>( ci.annotations() );
DefaultConfigurationHelper.INSTANCE.applyDefaults( tmp, globalDefaults );
mergeAnnotationMap( tmp, annotations );
classes.put( name, ci );
if ( ci.superName() != null ) {
addSubClasses( ci.superName(), ci );
}
if ( ci.interfaces() != null && ci.interfaces().length > 0 ) {
addImplementors( ci.interfaces(), ci );
}
}
}
return Index.create(
annotations, subclasses, implementors, classes
);
}
示例2: mappingMetadataComplete
import org.jboss.jandex.Index; //导入方法依赖的package包/类
/**
* If {@code xml-mapping-metadata-complete} is defined in PersistenceUnitMetadata, we create a new empty {@link Index} here.
*/
void mappingMetadataComplete() {
LOG.debug(
"xml-mapping-metadata-complete is specified in persistence-unit-metadata, ignore JPA annotations."
);
index = Index.create(
new HashMap<DotName, List<AnnotationInstance>>(),
new HashMap<DotName, List<ClassInfo>>(),
new HashMap<DotName, List<ClassInfo>>(),
new HashMap<DotName, ClassInfo>()
);
}