Interface PluginVisitor<A extends java.lang.annotation.Annotation>
-
- Type Parameters:
A- the Annotation type.
- All Known Implementing Classes:
AbstractPluginVisitor,PluginAttributeVisitor,PluginBuilderAttributeVisitor,PluginConfigurationVisitor,PluginElementVisitor,PluginLoggerContextVisitor,PluginNodeVisitor,PluginValueVisitor
public interface PluginVisitor<A extends java.lang.annotation.Annotation>Visitor strategy for parsing data from aNode, doing any relevant type conversion, and returning a parsed value for that variable. Implementations must be constructable using the default constructor.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PluginVisitor<A>setAliases(java.lang.String... aliases)Sets the list of aliases to use for this visit.PluginVisitor<A>setAnnotation(java.lang.annotation.Annotation annotation)Sets the Annotation to be used for this.PluginVisitor<A>setConversionType(java.lang.Class<?> conversionType)Sets the class to convert the plugin value to on this visit.PluginVisitor<A>setMember(java.lang.reflect.Member member)Sets the Member that this visitor is being used for injection upon.PluginVisitor<A>setStrSubstitutor(StrSubstitutor substitutor)Sets the StrSubstitutor to use for converting raw strings before type conversion.java.lang.Objectvisit(Configuration configuration, Node node, LogEvent event, java.lang.StringBuilder log)Visits a Node to obtain a value for constructing a Plugin object.
-
-
-
Method Detail
-
setAnnotation
PluginVisitor<A> setAnnotation(java.lang.annotation.Annotation annotation)
Sets the Annotation to be used for this. If the given Annotation is not compatible with this class's type, then it is ignored.- Parameters:
annotation- the Annotation instance.- Returns:
this.- Throws:
java.lang.NullPointerException- if the argument isnull.
-
setAliases
PluginVisitor<A> setAliases(java.lang.String... aliases)
Sets the list of aliases to use for this visit. No aliases are required, however.- Parameters:
aliases- the list of aliases to use.- Returns:
this.
-
setConversionType
PluginVisitor<A> setConversionType(java.lang.Class<?> conversionType)
Sets the class to convert the plugin value to on this visit. This should correspond with a class obtained from a factory method or builder class field. Not all PluginVisitor implementations may need this value.- Parameters:
conversionType- the type to convert the plugin string to (if applicable).- Returns:
this.- Throws:
java.lang.NullPointerException- if the argument isnull.
-
setStrSubstitutor
PluginVisitor<A> setStrSubstitutor(StrSubstitutor substitutor)
Sets the StrSubstitutor to use for converting raw strings before type conversion. Generally obtained from aConfiguration.- Parameters:
substitutor- the StrSubstitutor to use on plugin values.- Returns:
this.- Throws:
java.lang.NullPointerException- if the argument isnull.
-
setMember
PluginVisitor<A> setMember(java.lang.reflect.Member member)
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.- Parameters:
member- the member this visitor is parsing a value for.- Returns:
this.
-
visit
java.lang.Object visit(Configuration configuration, Node node, LogEvent event, java.lang.StringBuilder log)
Visits a Node to obtain a value for constructing a Plugin object.- Parameters:
configuration- the current Configuration.node- the current Node corresponding to the Plugin object being created.event- the current LogEvent that caused this Plugin object to be made (optional).log- the StringBuilder being used to build a debug message.- Returns:
- the converted value to be used for Plugin creation.
-
-