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