JMXUtils.java 文件源码

java
阅读 30 收藏 0 点赞 0 评论 0

项目:bagri 作者:
private static OpenType getOpenType(Object value) throws OpenDataException {
    if (value == null) {
        return SimpleType.VOID;
    }

    //if (OpenType.ALLOWED_CLASSNAMES_LIST.contains(name)) {
    int dim = 0;
    Class<?> cls = value.getClass();
    while (cls.isArray()) {
        cls = value.getClass().getComponentType();
        dim++;
    }
    SimpleType<?> type = getTypeForName(cls.getName());
    if (type != null && dim > 0) {
        if (cls.isPrimitive() && dim == 1) {
            return new ArrayType<>(type, true);
        }
        return new ArrayType<>(dim, type);
    }
    return type;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号