本文整理汇总了Java中org.jboss.jandex.DotName.createSimple方法的典型用法代码示例。如果您正苦于以下问题:Java DotName.createSimple方法的具体用法?Java DotName.createSimple怎么用?Java DotName.createSimple使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.jandex.DotName
的用法示例。
在下文中一共展示了DotName.createSimple方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getClassInfo
import org.jboss.jandex.DotName; //导入方法依赖的package包/类
@Override
public ClassInfo getClassInfo(String name) {
DotName dotName = DotName.createSimple( name );
return index.getClassByName( dotName );
}
示例2: createClassInfo
import org.jboss.jandex.DotName; //导入方法依赖的package包/类
ClassInfo createClassInfo(String className) {
if ( StringHelper.isEmpty( className ) ) {
throw new AssertionFailure( "Class Name used to create ClassInfo is empty." );
}
DotName classDotName = DotName.createSimple( className );
if ( classes.containsKey( classDotName ) ) {
//classInfoAnnotationsMap.put( classDotName, new HashMap<DotName, List<AnnotationInstance>>(classes.get( classDotName ).annotations()) );
return classes.get( classDotName );
}
Class clazz = serviceRegistry.getService( ClassLoaderService.class ).classForName( className );
DotName superName = null;
DotName[] interfaces = null;
short access_flag;
ClassInfo annClassInfo = index.getClassByName( classDotName );
if ( annClassInfo != null ) {
superName = annClassInfo.superName();
interfaces = annClassInfo.interfaces();
access_flag = annClassInfo.flags();
}
else {
Class superClass = clazz.getSuperclass();
if ( superClass != null ) {
superName = DotName.createSimple( superClass.getName() );
}
Class[] classInterfaces = clazz.getInterfaces();
if ( classInterfaces != null && classInterfaces.length > 0 ) {
interfaces = new DotName[classInterfaces.length];
for ( int i = 0; i < classInterfaces.length; i++ ) {
interfaces[i] = DotName.createSimple( classInterfaces[i].getName() );
}
}
access_flag = (short) ( clazz.getModifiers() | 0x20 );//(modifiers | ACC_SUPER)
}
Map<DotName, List<AnnotationInstance>> map = new HashMap<DotName, List<AnnotationInstance>>();
classInfoAnnotationsMap.put( classDotName, map );
ClassInfo classInfo = ClassInfo.create(
classDotName, superName, access_flag, interfaces, map
);
classes.put( classDotName, classInfo );
addSubClasses( superName, classInfo );
addImplementors( interfaces, classInfo );
return classInfo;
}