类org.apache.logging.log4j.core.config.plugins.Plugin源码实例Demo

下面列出了怎么用org.apache.logging.log4j.core.config.plugins.Plugin的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: logging-log4j-audit   文件: ConstraintType.java
default String getName() {
    Plugin annotation = this.getClass().getAnnotation(Plugin.class);
    if (annotation == null || annotation.name().length() == 0) {
        throw new NameNotFoundException("No name could be found for plugin class " + this.getClass().getName());
    }

    return annotation.name();
}
 
源代码2 项目: Poseidon   文件: PatternConverterTest.java
/**
 * Tests the presence of certain annotations and converter key in a given Converter class
 *
 * @param clazz PatterConverter class to test
 * @param key Converter key to match
 */
private void testPatternAnnotation(Class<? extends AccessLogPatternConverter> clazz, String key) {
    assertTrue(clazz.isAnnotationPresent(Plugin.class));
    assertTrue(clazz.isAnnotationPresent(ConverterKeys.class));
    assertEquals(key, clazz.getAnnotation(ConverterKeys.class).value()[0]);
}
 
 类所在包
 类方法
 同包方法