AnnotationMetadata.java 文件源码

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

项目:Dyvil 作者:
private void readRetention()
{
    final Annotation retention = this.theClass.getAnnotation(Annotation.LazyFields.RETENTION_CLASS);
    if (retention == null)
    {
        return;
    }

    final IValue value = retention.getArguments().get(0, Names.value);
    if (!(value instanceof EnumValue))
    {
        return;
    }

    try
    {
        final String name = ((EnumValue) value).getName().qualified;
        this.retention = RetentionPolicy.valueOf(name);
    }
    catch (IllegalArgumentException ignored)
    {
        // Problematic RetentionPolicy annotation - do not handle this
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号