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


Java Index.getClassByName方法代码示例

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


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

示例1: findRootEntityClassInfo

import org.jboss.jandex.Index; //导入方法依赖的package包/类
/**
 * Finds the root entity starting at the entity given by {@code info}. The root entity is not the highest superclass
 * in a java type sense, but the highest superclass which is also an entity (annotated w/ {@code @Entity}.
 *
 * @param index the annotation repository
 * @param info the class info representing an entity
 *
 * @return Finds the root entity starting at the entity given by {@code info}
 */
private static ClassInfo findRootEntityClassInfo(Index index, ClassInfo info) {
	ClassInfo rootEntity = info;

	DotName superName = info.superName();
	ClassInfo tmpInfo;
	// walk up the hierarchy until java.lang.Object
	while ( !OBJECT.equals( superName ) ) {
		tmpInfo = index.getClassByName( superName );
		if ( isEntityClass( tmpInfo ) ) {
			rootEntity = tmpInfo;
		}
		superName = tmpInfo.superName();
	}
	return rootEntity;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:25,代码来源:EntityHierarchyBuilder.java

示例2: implementsMethodRecursive

import org.jboss.jandex.Index; //导入方法依赖的package包/类
/**
 * 
 * @param i
 * @param methodReference
 * @param ci
 * @return whether any superclass implements the method
 */
public static boolean implementsMethodRecursive ( Index i, MethodReference methodReference, ClassInfo ci ) {
    if ( implementsMethod(methodReference, ci) ) {
        return true;
    }

    DotName superName = ci.superName();
    if ( superName != null ) {
        ClassInfo superByName = i.getClassByName(superName);
        if ( superByName == null || "java.lang.Object".equals(superByName.name().toString()) ) { //$NON-NLS-1$
            return false;
        }

        return implementsMethodRecursive(i, methodReference, superByName);
    }
    return false;
}
 
开发者ID:mbechler,项目名称:serianalyzer,代码行数:24,代码来源:TypeUtil.java

示例3: findOverrideMethods

import org.jboss.jandex.Index; //导入方法依赖的package包/类
private static List<MethodInfo> findOverrideMethods(final Index index, final ClassInfo clasz,
        final MethodInfo methodToFind, final int level) {

    final List<MethodInfo> methods = new ArrayList<>();
    if (clasz != null) {
        
        // Super classes
        if (level > 0) {
            addIfFound(index, clasz, methodToFind, methods);
        }
        
        // Check interfaces
        methods.addAll(findInterfaceMethods(index, clasz, methodToFind));

        // Check super class
        final DotName superName = clasz.superName();
        final ClassInfo superClass = index.getClassByName(superName);            
        methods.addAll(findOverrideMethods(index, superClass, methodToFind, (level + 1)));
        
    }
    return methods;

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

示例4: addMappedSuperclasses

import org.jboss.jandex.Index; //导入方法依赖的package包/类
private static void addMappedSuperclasses(Index index, ClassInfo info, List<ClassInfo> classInfoList) {
	DotName superName = info.superName();
	ClassInfo tmpInfo;
	// walk up the hierarchy until java.lang.Object
	while ( !OBJECT.equals( superName ) ) {
		tmpInfo = index.getClassByName( superName );
		if ( isMappedSuperclass( tmpInfo ) ) {
			classInfoList.add( tmpInfo );
		}
		superName = tmpInfo.superName();
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:EntityHierarchyBuilder.java

示例5: isTypeSerializable

import org.jboss.jandex.Index; //导入方法依赖的package包/类
/**
 * @param index
 * @param classByName
 * @return
 */
private boolean isTypeSerializable ( Index index, String typeName ) {

    Boolean s = this.serializableCache.get(typeName);
    if ( s != null ) {
        return s;
    }
    ClassInfo classByName = index.getClassByName(DotName.createSimple(typeName));
    s = TypeUtil.isSerializable(index, classByName);
    this.serializableCache.put(typeName, s);
    return s;
}
 
开发者ID:mbechler,项目名称:serianalyzer,代码行数:17,代码来源:Serianalyzer.java

示例6: extendsClass

import org.jboss.jandex.Index; //导入方法依赖的package包/类
/**
 * @param bInfo
 * @param aInfo
 * @return
 * @throws SerianalyzerException
 */
private static boolean extendsClass ( Index i, ClassInfo extendor, ClassInfo base ) throws SerianalyzerException {
    if ( extendor.equals(base) ) {
        return true;
    }
    DotName superName = extendor.superName();
    if ( superName != null ) {
        ClassInfo superByName = i.getClassByName(superName);
        if ( superByName == null ) {
            throw new SerianalyzerException("Failed to find super class " + superName); //$NON-NLS-1$
        }
        return extendsClass(i, superByName, base);
    }
    return false;
}
 
开发者ID:mbechler,项目名称:serianalyzer,代码行数:21,代码来源:TypeUtil.java

示例7: __invoke

import org.jboss.jandex.Index; //导入方法依赖的package包/类
private static List<Method> __invoke(Class<?> clazz, Index index, Comparator<Method> comparator) throws NoSuchMethodException {
    ArrayList methods = new ArrayList();
    ClassInfo clazzInfo = index.getClassByName(DotName.createSimple(clazz.getName()));
    for (MethodInfo method : clazzInfo.methods()) {
        if (method.hasAnnotation(IndexFactory.SUBRESOURCE_META)) {
            methods.add(clazz.getMethod(method.name()));
        }
    }
    if (clazzInfo.superName() != null && clazz.getSuperclass() != java.lang.Object.class) {
        index = IndexFactory.createIndex(clazz.getSuperclass());
        return __invoke(clazz.getSuperclass(), index, comparator);
    }
    Collections.sort(methods, comparator);
    return methods;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-config-api,代码行数:16,代码来源:SubresourceFilter.java

示例8: getClassByName

import org.jboss.jandex.Index; //导入方法依赖的package包/类
/**
 * @see {@link Index#getClassByName(org.jboss.jandex.DotName)}
 */
public ClassInfo getClassByName(final DotName className) {
    for (Index index : indexes) {
        final ClassInfo info = index.getClassByName(className);
        if (info != null) {
            return info;
        }
    }
    return null;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:13,代码来源:CompositeIndex.java

示例9: findInterfaceMethods

import org.jboss.jandex.Index; //导入方法依赖的package包/类
private static List<MethodInfo> findInterfaceMethods(final Index index, final ClassInfo clasz,
        final MethodInfo methodToFind) {

    final List<MethodInfo> methods = new ArrayList<>();
    if (clasz != null) {
        final List<DotName> interfaceNames = clasz.interfaceNames();
        for (final DotName interfaceName : interfaceNames) {
            final ClassInfo intf = index.getClassByName(interfaceName);
            addIfFound(index, intf, methodToFind, methods);
            // Check extended super interfaces
            methods.addAll(findInterfaceMethods(index, intf, methodToFind));
        }
    }
    return methods;
}
 
开发者ID:fuinorg,项目名称:units4j,代码行数:16,代码来源:Utils.java

示例10: classInfo

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


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