本文整理了Java中org.jboss.errai.codegen.meta.MetaClass.getAllSuperTypesAndInterfaces()
方法的一些代码示例,展示了MetaClass.getAllSuperTypesAndInterfaces()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MetaClass.getAllSuperTypesAndInterfaces()
方法的具体详情如下:
包路径:org.jboss.errai.codegen.meta.MetaClass
类名称:MetaClass
方法名:getAllSuperTypesAndInterfaces
暂无
代码示例来源:origin: errai/errai
public static Collection<MetaClass> getAllAssignableTypes(final MetaClass injectedType) {
return injectedType.getAllSuperTypesAndInterfaces();
}
代码示例来源:origin: errai/errai
private MetaClass getConstraintValidatorIface(final MetaClass validator) {
final Optional<MetaClass> ifaceOptional = validator.getAllSuperTypesAndInterfaces().stream()
.filter(iface -> iface.getFullyQualifiedName().equals(ConstraintValidator.class.getName())).findAny();
if (!ifaceOptional.isPresent()) {
throw new RuntimeException("Tried to generate dynamic validator for type that isn't a ConstraintValidator: "
+ validator.getFullyQualifiedName());
}
return ifaceOptional.get();
}
}
代码示例来源:origin: errai/errai
private void processAssignableTypes(final InjectableReference injectableReference) {
for (final MetaClass assignable : injectableReference.type.getAllSuperTypesAndInterfaces()) {
try {
directInjectableReferencesByAssignableTypes.put(assignable.getErased(), injectableReference);
} catch (final Throwable t) {
throw new RuntimeException("Error occurred adding the assignable type " + assignable.getFullyQualifiedName(), t);
}
}
}
代码示例来源:origin: errai/errai
private void validateAssignableTypes(final HasAnnotations annotated, final Class<?>[] beanTypes, final List<String> problems) {
MetaClass actualRawType;
if (annotated instanceof MetaClass) {
actualRawType = ((MetaClass) annotated).getErased();
}
else if (annotated instanceof MetaField) {
actualRawType = ((MetaField) annotated).getType().getErased();
}
else if (annotated instanceof MetaMethod) {
actualRawType = ((MetaMethod) annotated).getReturnType().getErased();
}
else {
throw new IllegalArgumentException("Unrecognized element kind annotated with @Typed: " + annotated);
}
final Set<String> assignableTypeNames =
actualRawType
.getAllSuperTypesAndInterfaces()
.stream()
.map(type -> type.getFullyQualifiedName())
.collect(Collectors.toSet());
final Optional<String> unassignableTypes =
Arrays
.stream(beanTypes)
.map(Class::getName)
.filter(name -> !assignableTypeNames.contains(name))
.reduce((s1, s2) -> s1 + "\n" + s2);
unassignableTypes.ifPresent(typeNameString -> problems.add(
String.format("The @Typed declaration on [%s] contained the following types not assignable to [%s]:\n%s",
annotated, actualRawType, typeNameString)));
}
代码示例来源:origin: errai/errai
parameterContainingType = fromType;
else for (final MetaClass type : fromType.getAllSuperTypesAndInterfaces()) {
if (type.isInterface() && type.getFullyQualifiedName().equals(toType.getFullyQualifiedName())) {
parameterContainingType = type;
代码示例来源:origin: errai/errai
stmts.add(loadVariable("windowContext").invoke("addBeanProvider",
injectable.getInjectedType().getFullyQualifiedName(), createJsTypeProviderFor(injectable)));
for (final MetaClass mc : injectable.getInjectedType().getAllSuperTypesAndInterfaces()) {
if (mc.isPublic() && !mc.equals(injectable.getInjectedType())
&& !mc.getFullyQualifiedName().equals("java.lang.Object") && mc.isAnnotationPresent(JsType.class)) {
内容来源于网络,如有侵权,请联系作者删除!