org.apache.logging.log4j.core.config.plugins.Plugin.name()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(111)

本文整理了Java中org.apache.logging.log4j.core.config.plugins.Plugin.name()方法的一些代码示例,展示了Plugin.name()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Plugin.name()方法的具体详情如下:
包路径:org.apache.logging.log4j.core.config.plugins.Plugin
类名称:Plugin
方法名:name

Plugin.name介绍

暂无

代码示例

代码示例来源:origin: org.apache.logging.log4j/log4j-core

@Test
public void testFakePluginFoundWithCorrectInformation() throws Exception {
  final PluginEntry fake = pluginCache.getCategory(p.category()).get(p.name().toLowerCase());
  verifyFakePluginEntry(p.name(), fake);
}

代码示例来源:origin: org.apache.logging.log4j/log4j-core

@Test
  public void testNestedPlugin() throws Exception {
    final Plugin p = FakePlugin.Nested.class.getAnnotation(Plugin.class);
    final PluginEntry nested = pluginCache.getCategory(p.category()).get(p.name().toLowerCase());
    assertNotNull(nested);
    assertEquals(p.name().toLowerCase(), nested.getKey());
    assertEquals(FakePlugin.Nested.class.getName(), nested.getClassName());
    assertEquals(p.name(), nested.getName());
    assertEquals(Plugin.EMPTY, p.elementType());
    assertEquals(p.printObject(), nested.isPrintable());
    assertEquals(p.deferChildren(), nested.isDefer());
  }
}

代码示例来源:origin: org.apache.logging.log4j/log4j-catalog-api

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();
}

代码示例来源:origin: ops4j/org.ops4j.pax.logging

@Override
  public PluginEntry visitType(final TypeElement e, final Plugin plugin) {
    Objects.requireNonNull(plugin, "Plugin annotation is null.");
    final PluginEntry entry = new PluginEntry();
    entry.setKey(plugin.name().toLowerCase(Locale.US));
    entry.setClassName(elements.getBinaryName(e).toString());
    entry.setName(Plugin.EMPTY.equals(plugin.elementType()) ? plugin.name() : plugin.elementType());
    entry.setPrintable(plugin.printObject());
    entry.setDefer(plugin.deferChildren());
    entry.setCategory(plugin.category());
    return entry;
  }
}

代码示例来源:origin: ops4j/org.ops4j.pax.logging

Plugin.EMPTY) ? plugin.name() : plugin.elementType();
mainEntry.setKey(plugin.name().toLowerCase());
mainEntry.setName(plugin.name());
mainEntry.setCategory(plugin.category());
mainEntry.setClassName(clazz.getName());
      Plugin.EMPTY) ? alias.trim() : plugin.elementType();
    aliasEntry.setKey(alias.trim().toLowerCase());
    aliasEntry.setName(plugin.name());
    aliasEntry.setCategory(plugin.category());
    aliasEntry.setClassName(clazz.getName());

相关文章