本文整理了Java中org.jvnet.tiger_types.Types.isSubClassOf()
方法的一些代码示例,展示了Types.isSubClassOf()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Types.isSubClassOf()
方法的具体详情如下:
包路径:org.jvnet.tiger_types.Types
类名称:Types
方法名:isSubClassOf
[英]Checks if sub is a sub-type of sup.
[中]检查sub是否为sup的子类型。
代码示例来源:origin: org.glassfish.hk2/auto-depends
/**
* Resolve the parameters for the selected ctor
*/
protected List<Object> getParameters(Constructor<T> ctor) {
ArrayList<Object> params = new ArrayList<Object>();
for (Type paramType : ctor.getGenericParameterTypes()) {
Class<?> paramClass = Types.erasure(paramType);
Object val;
if (Types.isSubClassOf(paramClass, Provider.class)) {
val = Jsr330InjectionResolver.getHolderInjectValue(habitat, ctor, null, paramType);
} else {
val = Jsr330InjectionResolver.get(habitat, ctor, ctor, paramClass);
}
params.add(val);
}
return params;
}
代码示例来源:origin: org.glassfish.hk2/auto-depends
@Override
public <V> V getValue(Object component, Inhabitant<?> onBehalfOf,
AnnotatedElement target, Type gtype, Class<V> type)
throws ComponentException {
Object result;
if (type.isArray()) {
result = getValueForInjectedArray(onBehalfOf, gtype, type);
}
else if (Types.isSubClassOf(type, Provider.class)) {
gtype = getGenericType(gtype, target);
result = getHolderInjectValue(habitat, onBehalfOf, target,gtype);
}
else {
result = get(habitat, onBehalfOf, target, type);
}
return (V) result;
}
代码示例来源:origin: org.glassfish.hk2/auto-depends
Class<V> baseType = (Class<V>) type.getComponentType();
if (Types.isSubClassOf(baseType, Provider.class)) {
代码示例来源:origin: com.sun.enterprise/auto-depends
result = getArrayInjectValue(habitat, component, onBehalfOf, target, genericType, type);
} else {
if (Types.isSubClassOf(type, Holder.class)) {
result = getHolderInjectValue(habitat, component, onBehalfOf, target, genericType, type, inject);
} else {
代码示例来源:origin: org.glassfish.hk2/auto-depends
result = getArrayInjectValue(habitat, component, onBehalfOf, target, genericType, type);
} else {
if (Types.isSubClassOf(type, org.glassfish.hk2.Factory.class)) {
result = getHolderInjectValue(habitat, component, onBehalfOf, target, genericType, type, inject);
} else {
内容来源于网络,如有侵权,请联系作者删除!