logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattsic...@apache.org
Subject svn commit: r1599073 - in /logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors: AbstractPluginVisitor.java PluginVisitor.java
Date Sun, 01 Jun 2014 22:51:16 GMT
Author: mattsicker
Date: Sun Jun  1 22:51:15 2014
New Revision: 1599073

URL: http://svn.apache.org/r1599073
Log:
Add setMember method to PluginVisitor.

  - This can be used for obtaining extra details about a member to be
   reflected on (e.g., the name of a field).

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/AbstractPluginVisitor.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginVisitor.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/AbstractPluginVisitor.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/AbstractPluginVisitor.java?rev=1599073&r1=1599072&r2=1599073&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/AbstractPluginVisitor.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/AbstractPluginVisitor.java
Sun Jun  1 22:51:15 2014
@@ -18,6 +18,7 @@
 package org.apache.logging.log4j.core.config.plugins.visitors;
 
 import java.lang.annotation.Annotation;
+import java.lang.reflect.Member;
 import java.util.Map;
 
 import org.apache.logging.log4j.Logger;
@@ -42,6 +43,7 @@ public abstract class AbstractPluginVisi
     protected String[] aliases;
     protected Class<?> conversionType;
     protected StrSubstitutor substitutor;
+    protected Member member;
 
     /**
      * This constructor must be overridden by implementation classes as a no-arg constructor.
@@ -80,6 +82,12 @@ public abstract class AbstractPluginVisi
         return this;
     }
 
+    @Override
+    public PluginVisitor<A> setMember(final Member member) {
+        this.member = member;
+        return this;
+    }
+
     /**
      * Removes an Entry from a given Map using a key name and aliases for that key. Keys
are case-insensitive.
      *

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginVisitor.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginVisitor.java?rev=1599073&r1=1599072&r2=1599073&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginVisitor.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginVisitor.java
Sun Jun  1 22:51:15 2014
@@ -18,6 +18,7 @@
 package org.apache.logging.log4j.core.config.plugins.visitors;
 
 import java.lang.annotation.Annotation;
+import java.lang.reflect.Member;
 
 import org.apache.logging.log4j.core.LogEvent;
 import org.apache.logging.log4j.core.config.Configuration;
@@ -71,6 +72,16 @@ public interface PluginVisitor<A extends
     PluginVisitor<A> setStrSubstitutor(StrSubstitutor substitutor);
 
     /**
+     * Sets the Member that this visitor is being used for injection upon. For instance,
this could be the Field
+     * that is being used for injecting a value, or it could be the factory method being
used to inject parameters
+     * into.
+     *
+     * @param member the member this visitor is parsing a value for.
+     * @return {@code this}.
+     */
+    PluginVisitor<A> setMember(Member member);
+
+    /**
      * Visits a Node to obtain a value for constructing a Plugin object.
      *
      * @param configuration the current Configuration.



Mime
View raw message