Class DefaultComponentBuilder<T extends ComponentBuilder<T>,CB extends ConfigurationBuilder<? extends Configuration>>
java.lang.Object
org.apache.logging.log4j.core.config.builder.impl.DefaultComponentBuilder<T,CB>
- All Implemented Interfaces:
ComponentBuilder<T>,Builder<Component>
- Direct Known Subclasses:
DefaultComponentAndConfigurationBuilder
class DefaultComponentBuilder<T extends ComponentBuilder<T>,CB extends ConfigurationBuilder<? extends Configuration>>
extends Object
implements ComponentBuilder<T>
Generic component that captures attributes and Components in preparation for assembling the Appender's
Component.
- Since:
- 2.4
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultComponentBuilder(CB builder, String type) DefaultComponentBuilder(CB builder, String name, String type) DefaultComponentBuilder(CB builder, String name, String type, String value) -
Method Summary
Modifier and TypeMethodDescriptionaddAttribute(String key, boolean value) Adds a boolean attribute.addAttribute(String key, int value) Adds an integer attribute.addAttribute(String key, Enum<?> value) Adds an enumeration attribute.addAttribute(String key, Object value) Adds an Object attribute.addAttribute(String key, String value) Adds a String attribute.addAttribute(String key, Level level) Adds a logging Level attribute.addComponent(ComponentBuilder<?> builder) Adds a sub component.build()Builds the object after all configuration has been set.Retrieves the ConfigurationBuilder.getName()Returns the name of the component, if any.protected TMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.logging.log4j.core.util.Builder
getErrorPrefix, isValid
-
Field Details
-
builder
-
type
-
attributes
-
components
-
name
-
value
-
-
Constructor Details
-
DefaultComponentBuilder
-
DefaultComponentBuilder
-
DefaultComponentBuilder
-
-
Method Details
-
addAttribute
Description copied from interface:ComponentBuilderAdds a boolean attribute.- Specified by:
addAttributein interfaceComponentBuilder<T extends ComponentBuilder<T>>- Parameters:
key- The attribute key.value- The boolean value.- Returns:
- This ComponentBuilder.
-
addAttribute
Description copied from interface:ComponentBuilderAdds an enumeration attribute.- Specified by:
addAttributein interfaceComponentBuilder<T extends ComponentBuilder<T>>- Parameters:
key- The attribute key.value- The enumeration.- Returns:
- This ComponentBuilder.
-
addAttribute
Description copied from interface:ComponentBuilderAdds an integer attribute.- Specified by:
addAttributein interfaceComponentBuilder<T extends ComponentBuilder<T>>- Parameters:
key- The attribute key.value- The integer value.- Returns:
- This ComponentBuilder.
-
addAttribute
Description copied from interface:ComponentBuilderAdds a logging Level attribute.- Specified by:
addAttributein interfaceComponentBuilder<T extends ComponentBuilder<T>>- Parameters:
key- The attribute key.level- The logging Level.- Returns:
- This ComponentBuilder.
-
addAttribute
Description copied from interface:ComponentBuilderAdds an Object attribute.- Specified by:
addAttributein interfaceComponentBuilder<T extends ComponentBuilder<T>>- Parameters:
key- The attribute key.value- The object value.- Returns:
- This ComponentBuilder.
-
addAttribute
Description copied from interface:ComponentBuilderAdds a String attribute.- Specified by:
addAttributein interfaceComponentBuilder<T extends ComponentBuilder<T>>- Parameters:
key- The attribute key.value- The value of the attribute.- Returns:
- This ComponentBuilder.
-
addComponent
Description copied from interface:ComponentBuilderAdds a sub component.- Specified by:
addComponentin interfaceComponentBuilder<T extends ComponentBuilder<T>>- Parameters:
builder- The Assembler for the subcomponent with all of its attributes and sub-components set.- Returns:
- This ComponentBuilder (not the argument).
-
build
Description copied from interface:BuilderBuilds the object after all configuration has been set. This will use default values for any unspecified attributes for the object.- Specified by:
buildin interfaceBuilder<T extends ComponentBuilder<T>>- Returns:
- the configured instance.
-
getBuilder
Description copied from interface:ComponentBuilderRetrieves the ConfigurationBuilder.- Specified by:
getBuilderin interfaceComponentBuilder<T extends ComponentBuilder<T>>- Returns:
- The ConfigurationBuilder.
-
getName
Description copied from interface:ComponentBuilderReturns the name of the component, if any.- Specified by:
getNamein interfaceComponentBuilder<T extends ComponentBuilder<T>>- Returns:
- The components name or null if it doesn't have one.
-
put
-