当前位置: 首页>>代码示例>>Java>>正文


Java TypeQualifierValidator类代码示例

本文整理汇总了Java中javax.annotation.meta.TypeQualifierValidator的典型用法代码示例。如果您正苦于以下问题:Java TypeQualifierValidator类的具体用法?Java TypeQualifierValidator怎么用?Java TypeQualifierValidator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TypeQualifierValidator类属于javax.annotation.meta包,在下文中一共展示了TypeQualifierValidator类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sandboxedValidation

import javax.annotation.meta.TypeQualifierValidator; //导入依赖的package包/类
public static <A extends Annotation> When sandboxedValidation(A proxy, TypeQualifierValidator<A> v, @CheckForNull
Object constantValue) {
    if (performingValidation.get())
        throw new IllegalStateException("recursive validation");

    try {
        performingValidation.set(Boolean.TRUE);
        if (TypeQualifierValue.DEBUG_CLASSLOADING)
            System.out.println("Performing validation in thread " + Thread.currentThread().getName());
        try {
            When result = v.forConstantValue(proxy, constantValue);
            if (!performingValidation.get())
                throw new IllegalStateException("performingValidation not set when validation completes");
            return result;
        } catch (ClassCastException e) {
            Class<? extends Annotation> c = proxy.getClass();
            System.out.println(c.getName() + " extends " + c.getSuperclass().getName());
            for(Class<?> i : c.getInterfaces())
                    System.out.println("  " + i.getName());
            throw e;
        }
        
    } finally {
        performingValidation.set(Boolean.FALSE);
        if (TypeQualifierValue.DEBUG_CLASSLOADING)
            System.out.println("Validation finished in thread " + Thread.currentThread().getName());
       
    }
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:30,代码来源:ValidationSecurityManager.java

示例2: inValidation

import javax.annotation.meta.TypeQualifierValidator; //导入依赖的package包/类
private boolean inValidation() {
    for (Class<?> c : getClassContext()) {
        if (TypeQualifierValidator.class.isAssignableFrom(c)
                || c.getClassLoader() == ValidatorClassLoader.INSTANCE)
            return true;
    }
    return false;
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:9,代码来源:ValidationSecurityManager.java

示例3: getValidator

import javax.annotation.meta.TypeQualifierValidator; //导入依赖的package包/类
private static <A extends Annotation> TypeQualifierValidator<A> getValidator(
        Class<? extends TypeQualifierValidator<A>> checkerClass)
        throws InstantiationException, IllegalAccessException {
    return checkerClass.newInstance();
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:6,代码来源:TypeQualifierValue.java

示例4: getValidator

import javax.annotation.meta.TypeQualifierValidator; //导入依赖的package包/类
/**
 * @param checkerClass
 * @return
 * @throws InstantiationException
 * @throws IllegalAccessException
 */
@SuppressWarnings("unchecked")
private TypeQualifierValidator<A> getValidator(Class<? extends TypeQualifierValidator> checkerClass)
        throws InstantiationException, IllegalAccessException {
    return checkerClass.newInstance();
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:12,代码来源:TypeQualifierValue.java


注:本文中的javax.annotation.meta.TypeQualifierValidator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。