本文整理了Java中org.apache.logging.log4j.core.config.plugins.Plugin.printObject()
方法的一些代码示例,展示了Plugin.printObject()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Plugin.printObject()
方法的具体详情如下:
包路径:org.apache.logging.log4j.core.config.plugins.Plugin
类名称:Plugin
方法名:printObject
暂无
代码示例来源: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
mainEntry.setCategory(plugin.category());
mainEntry.setClassName(clazz.getName());
mainEntry.setPrintable(plugin.printObject());
mainEntry.setDefer(plugin.deferChildren());
final PluginType<?> mainType = new PluginType<>(mainEntry, clazz, mainElementName);
aliasEntry.setCategory(plugin.category());
aliasEntry.setClassName(clazz.getName());
aliasEntry.setPrintable(plugin.printObject());
aliasEntry.setDefer(plugin.deferChildren());
final PluginType<?> aliasType = new PluginType<>(aliasEntry, clazz, aliasElementName);
内容来源于网络,如有侵权,请联系作者删除!