YggXMLInputStream.java 文件源码

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

项目:Skript 作者:
@SuppressWarnings("null")
private Class<?> getType(String s) throws StreamCorruptedException {
    int dim = 0;
    while (s.endsWith("[]")) {
        s = "" + s.substring(0, s.length() - 2);
        dim++;
    }
    Class<?> c;
    final Tag t = Tag.byName(s);
    if (t != null)
        c = t.c;
    else
        c = yggdrasil.getClass(s);
    if (c == null)
        throw new StreamCorruptedException("Invalid type " + s);
    if (dim == 0)
        return c;
    while (dim-- > 0)
        c = Array.newInstance(c, 0).getClass();
    return c;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号