You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2014/06/02 01:10:29 UTC
svn commit: r1599078 - in
/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout:
HtmlLayout.java PatternLayout.java
Author: mattsicker
Date: Sun Jun 1 23:10:29 2014
New Revision: 1599078
URL: http://svn.apache.org/r1599078
Log:
Migrate builder fields to use new annotation.
Modified:
logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HtmlLayout.java
logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java
Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HtmlLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HtmlLayout.java?rev=1599078&r1=1599077&r2=1599078&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HtmlLayout.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HtmlLayout.java Sun Jun 1 23:10:29 2014
@@ -32,6 +32,7 @@ import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.config.plugins.Plugin;
import org.apache.logging.log4j.core.config.plugins.PluginAttribute;
+import org.apache.logging.log4j.core.config.plugins.PluginBuilderAttribute;
import org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory;
import org.apache.logging.log4j.core.config.plugins.PluginFactory;
import org.apache.logging.log4j.core.util.Charsets;
@@ -354,22 +355,22 @@ public final class HtmlLayout extends Ab
public static class Builder implements org.apache.logging.log4j.core.util.Builder<HtmlLayout> {
- @PluginAttribute(value = "locationInfo", defaultBoolean = false)
+ @PluginBuilderAttribute
private boolean locationInfo = false;
- @PluginAttribute(value = "title", defaultString = DEFAULT_TITLE)
+ @PluginBuilderAttribute
private String title = DEFAULT_TITLE;
- @PluginAttribute(value = "contentType")
+ @PluginBuilderAttribute
private String contentType = null; // defer default value in order to use specified charset
- @PluginAttribute(value = "charset", defaultString = "UTF-8")
+ @PluginBuilderAttribute
private Charset charset = Charsets.UTF_8;
- @PluginAttribute(value = "fontSize", defaultString = "SMALL")
+ @PluginBuilderAttribute
private FontSize fontSize = FontSize.SMALL;
- @PluginAttribute(value = "fontName", defaultString = DEFAULT_FONT_FAMILY)
+ @PluginBuilderAttribute
private String fontName = DEFAULT_FONT_FAMILY;
private Builder() {
Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java?rev=1599078&r1=1599077&r2=1599078&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java Sun Jun 1 23:10:29 2014
@@ -26,6 +26,7 @@ import org.apache.logging.log4j.core.con
import org.apache.logging.log4j.core.config.DefaultConfiguration;
import org.apache.logging.log4j.core.config.plugins.Plugin;
import org.apache.logging.log4j.core.config.plugins.PluginAttribute;
+import org.apache.logging.log4j.core.config.plugins.PluginBuilderAttribute;
import org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory;
import org.apache.logging.log4j.core.config.plugins.PluginConfiguration;
import org.apache.logging.log4j.core.config.plugins.PluginElement;
@@ -313,7 +314,7 @@ public final class PatternLayout extends
// FIXME: it seems rather redundant to repeat default values (same goes for field names)
// perhaps introduce a @PluginBuilderAttribute that has no values of its own and uses reflection?
- @PluginAttribute(value = "pattern", defaultString = PatternLayout.DEFAULT_CONVERSION_PATTERN)
+ @PluginBuilderAttribute
private String pattern = PatternLayout.DEFAULT_CONVERSION_PATTERN;
@PluginConfiguration
@@ -322,19 +323,19 @@ public final class PatternLayout extends
@PluginElement("Replace")
private RegexReplacement regexReplacement = null;
- @PluginAttribute(value = "charset", defaultString = "UTF-8")
+ @PluginBuilderAttribute
private Charset charset = Charsets.UTF_8;
- @PluginAttribute(value = "alwaysWriteExceptions", defaultBoolean = true)
+ @PluginBuilderAttribute
private boolean alwaysWriteExceptions = true;
- @PluginAttribute(value = "noConsoleNoAnsi", defaultBoolean = false)
+ @PluginBuilderAttribute
private boolean noConsoleNoAnsi = false;
- @PluginAttribute("header")
+ @PluginBuilderAttribute
private String header = null;
- @PluginAttribute("footer")
+ @PluginBuilderAttribute
private String footer = null;
private Builder() {