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


Java ClassInfo.name方法代码示例

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


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

示例1: build

import org.jboss.jandex.ClassInfo; //导入方法依赖的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
	);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:34,代码来源:IndexBuilder.java

示例2: getKnownImplementors

import org.jboss.jandex.ClassInfo; //导入方法依赖的package包/类
private void getKnownImplementors(DotName name, Set<ClassInfo> allKnown, Set<DotName> subInterfacesToProcess,
        Set<DotName> processedClasses) {
    for (Index index : indexes) {
        final List<ClassInfo> list = index.getKnownDirectImplementors(name);
        if (list != null) {
            for (final ClassInfo clazz : list) {
                final DotName className = clazz.name();
                if (!processedClasses.contains(className)) {
                    if (Modifier.isInterface(clazz.flags())) {
                        subInterfacesToProcess.add(className);
                    } else {
                        if (!allKnown.contains(clazz)) {
                            allKnown.add(clazz);
                            processedClasses.add(className);
                            getAllKnownSubClasses(className, allKnown, processedClasses);
                        }
                    }
                }
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:23,代码来源:CompositeIndex.java

示例3: verify

import org.jboss.jandex.ClassInfo; //导入方法依赖的package包/类
@Override
public final AssertionResult verify(final ClassInfo info) {

    boolean ok = true;
    final StringBuffer sb = new StringBuffer("Class " + info.name() + " has final methods:\n");

    final List<MethodInfo> methodInfos = info.methods();
    for (final MethodInfo methodInfo : methodInfos) {
        if (Modifier.isFinal(methodInfo.flags())) {
            ok = false;
            sb.append(methodInfo.toString());
            sb.append("\n");
        }            
    }
    
    if (ok) {
        return AssertionResult.OK;
    }
    return new AssertionResult(sb.toString());

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

示例4: checkClass

import org.jboss.jandex.ClassInfo; //导入方法依赖的package包/类
/**
 * @param ci
 * @throws SerianalyzerException
 */
private void checkClass ( ClassInfo ci ) throws SerianalyzerException {
    DotName dname = ci.name();
    String dnameString = dname.toString();
    try ( InputStream data = this.input.getClassData(dnameString) ) {
        if ( data == null ) {
            log.error("No class data for " + dname); //$NON-NLS-1$
            return;
        }
        boolean serializable = this.isTypeSerializable(this.getIndex(), dnameString);
        ClassReader cr = new ClassReader(data);
        if ( log.isTraceEnabled() ) {
            log.trace("Adding " + dnameString); //$NON-NLS-1$
        }
        SerianalyzerClassSerializationVisitor visitor = new SerianalyzerClassSerializationVisitor(this, dnameString, serializable);
        cr.accept(visitor, 0);
        if ( serializable ) {
            ClassInfo classByName = this.input.getIndex().getClassByName(ci.superName());
            if ( classByName == null ) {
                log.error("Failed to locate super class " + ci.superName()); //$NON-NLS-1$
                return;
            }
            checkClass(classByName);
        }
        else if ( !visitor.isFoundDefaultConstructor() && log.isTraceEnabled() ) {
            log.trace("No default constructor found in first non-serializable parent " + dname); //$NON-NLS-1$
        }
    }
    catch ( IOException e ) {
        throw new SerianalyzerException("Failed to read class data" + dname, e); //$NON-NLS-1$
    }
}
 
开发者ID:mbechler,项目名称:serianalyzer,代码行数:36,代码来源:Serianalyzer.java

示例5: getAllKnownSubClasses

import org.jboss.jandex.ClassInfo; //导入方法依赖的package包/类
private void getAllKnownSubClasses(DotName name, Set<ClassInfo> allKnown, Set<DotName> subClassesToProcess,
        Set<DotName> processedClasses) {
    for (Index index : indexes) {
        final List<ClassInfo> list = index.getKnownDirectSubclasses(name);
        if (list != null) {
            for (final ClassInfo clazz : list) {
                final DotName className = clazz.name();
                if (!processedClasses.contains(className)) {
                    allKnown.add(clazz);
                    subClassesToProcess.add(className);
                }
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:16,代码来源:CompositeIndex.java

示例6: verify

import org.jboss.jandex.ClassInfo; //导入方法依赖的package包/类
@Override
public final AssertionResult verify(final ClassInfo info) {

    final MethodInfo method = info.method("<init>");
    if ((method == null) || !publicOrProtected(method)) {
        return new AssertionResult("Missing public or protected no arg constructor: " + info.name());
    }

    return AssertionResult.OK;

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

示例7: verify

import org.jboss.jandex.ClassInfo; //导入方法依赖的package包/类
@Override
public final AssertionResult verify(final ClassInfo info) {

    if (Modifier.isFinal(info.flags())) {
        return new AssertionResult("Class is final: " + info.name());
    }

    return AssertionResult.OK;

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


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