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

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

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

Plugin.elementType介绍

暂无

代码示例

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

private void verifyFakePluginEntry(final String name, final PluginEntry fake) {
  assertNotNull("The plugin '" + name.toLowerCase() + "' was not found.", fake);
  assertEquals(FakePlugin.class.getName(), fake.getClassName());
  assertEquals(name.toLowerCase(), fake.getKey());
  assertEquals(Plugin.EMPTY, p.elementType());
  assertEquals(name, fake.getName());
  assertEquals(p.printObject(), fake.isPrintable());
  assertEquals(p.deferChildren(), fake.isDefer());
}

代码示例来源: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: 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

@Override
  public Collection<PluginEntry> visitType(final TypeElement e, final Plugin plugin) {
    final PluginAliases aliases = e.getAnnotation(PluginAliases.class);
    if (aliases == null) {
      return DEFAULT_VALUE;
    }
    final Collection<PluginEntry> entries = new ArrayList<>(aliases.value().length);
    for (final String alias : aliases.value()) {
      final PluginEntry entry = new PluginEntry();
      entry.setKey(alias.toLowerCase(Locale.US));
      entry.setClassName(elements.getBinaryName(e).toString());
      entry.setName(Plugin.EMPTY.equals(plugin.elementType()) ? alias : plugin.elementType());
      entry.setPrintable(plugin.printObject());
      entry.setDefer(plugin.deferChildren());
      entry.setCategory(plugin.category());
      entries.add(entry);
    }
    return entries;
  }
}

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

final String mainElementName = plugin.elementType().equals(
  Plugin.EMPTY) ? plugin.name() : plugin.elementType();
mainEntry.setKey(plugin.name().toLowerCase());
mainEntry.setName(plugin.name());
  for (final String alias : pluginAliases.value()) {
    final PluginEntry aliasEntry = new PluginEntry();
    final String aliasElementName = plugin.elementType().equals(
      Plugin.EMPTY) ? alias.trim() : plugin.elementType();
    aliasEntry.setKey(alias.trim().toLowerCase());
    aliasEntry.setName(plugin.name());

相关文章