本文整理汇总了Java中org.apache.logging.log4j.core.config.plugins.PluginValue类的典型用法代码示例。如果您正苦于以下问题:Java PluginValue类的具体用法?Java PluginValue怎么用?Java PluginValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PluginValue类属于org.apache.logging.log4j.core.config.plugins包,在下文中一共展示了PluginValue类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createScript
import org.apache.logging.log4j.core.config.plugins.PluginValue; //导入依赖的package包/类
@PluginFactory
public static Script createScript(
// @formatter:off
@PluginAttribute("name") final String name,
@PluginAttribute(ATTR_LANGUAGE) String language,
@PluginValue(ATTR_SCRIPT_TEXT) final String scriptText) {
// @formatter:on
if (language == null) {
LOGGER.error("No '{}' attribute provided for {} plugin '{}'", ATTR_LANGUAGE, PLUGIN_NAME, name);
language = DEFAULT_LANGUAGE;
}
if (scriptText == null) {
LOGGER.error("No '{}' attribute provided for {} plugin '{}'", ATTR_SCRIPT_TEXT, PLUGIN_NAME, name);
return null;
}
return new Script(name, language, scriptText);
}
开发者ID:apache,项目名称:logging-log4j2,代码行数:19,代码来源:Script.java
示例2: createStaticField
import org.apache.logging.log4j.core.config.plugins.PluginValue; //导入依赖的package包/类
/**
* Creates a Property.
*
* @param name The key.
* @param value The value.
* @return A Property.
*/
@PluginFactory
public static StaticField createStaticField(
@PluginAttribute("name") final String name,
@PluginValue("value") final String value) {
if (name == null) {
LOGGER.error("Property name cannot be null");
}
return new StaticField(name, value);
}
开发者ID:wywy,项目名称:log4j-plugin-fluency,代码行数:17,代码来源:StaticField.java
示例3: createProperty
import org.apache.logging.log4j.core.config.plugins.PluginValue; //导入依赖的package包/类
/**
* Create a Property.
* @param key The key.
* @param value The value.
* @return A Property.
*/
@PluginFactory
public static Property createProperty(
@PluginAttribute("name") final String key,
@PluginValue("value")final String value) {
if (key == null) {
LOGGER.error("Property key cannot be null");
}
if(value.contains("${")){
List<String> keys = new ArrayList<String>();
List<String> values = new ArrayList<String>();
String _value = value;
Matcher m = pat.matcher(_value);
while(m.find()){
String _key = m.group();
keys.add(_key);
values.add(System.getProperty(_key.substring(2, _key.lastIndexOf('}'))));
}
for(int i = 0; i < keys.size(); i++){
_value = _value.replaceAll("[${][^$]["+keys.get(i)+"]*}", values.get(i));
}
return new Property(key, _value);
}else{
return new Property(key, value);
}
}
开发者ID:youngor,项目名称:openclouddb,代码行数:34,代码来源:Property.java
示例4: createProperty
import org.apache.logging.log4j.core.config.plugins.PluginValue; //导入依赖的package包/类
/**
* Create a Property.
* @param key The key.
* @param value The value.
* @return A Property.
*/
@PluginFactory
public static Property createProperty(
@PluginAttribute("name") final String key,
@PluginValue("value") final String value) {
if (key == null) {
LOGGER.error("Property key cannot be null");
}
return new Property(key, value);
}
开发者ID:OuZhencong,项目名称:log4j2,代码行数:16,代码来源:Property.java
示例5: createProperty
import org.apache.logging.log4j.core.config.plugins.PluginValue; //导入依赖的package包/类
/**
* Creates a Property.
*
* @param name The key.
* @param value The value.
* @return A Property.
*/
@PluginFactory
public static Property createProperty(
@PluginAttribute("name") final String name,
@PluginValue("value") final String value) {
if (name == null) {
LOGGER.error("Property name cannot be null");
}
return new Property(name, value);
}
开发者ID:apache,项目名称:logging-log4j2,代码行数:17,代码来源:Property.java
示例6: create
import org.apache.logging.log4j.core.config.plugins.PluginValue; //导入依赖的package包/类
@PluginFactory
public static Mask create(@PluginValue("value") final String value,
@PluginAttribute("enabled") final String enabled) {
return new Mask(value, enabled != null && Boolean.parseBoolean(enabled));
}
开发者ID:stackify,项目名称:stackify-log-log4j2,代码行数:6,代码来源:Mask.java
示例7: PluginValueVisitor
import org.apache.logging.log4j.core.config.plugins.PluginValue; //导入依赖的package包/类
public PluginValueVisitor() {
super(PluginValue.class);
}
开发者ID:apache,项目名称:logging-log4j2,代码行数:4,代码来源:PluginValueVisitor.java
注:本文中的org.apache.logging.log4j.core.config.plugins.PluginValue类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论