1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache license, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the license for the specific language governing permissions and 15 * limitations under the license. 16 */ 17 package org.apache.logging.log4j.core.config.plugins; 18 19 import java.lang.annotation.Documented; 20 import java.lang.annotation.ElementType; 21 import java.lang.annotation.Retention; 22 import java.lang.annotation.RetentionPolicy; 23 import java.lang.annotation.Target; 24 25 import org.apache.logging.log4j.util.Strings; 26 27 /** 28 * Annotation that identifies a Class as a Plugin. 29 */ 30 @Documented 31 @Retention(RetentionPolicy.RUNTIME) 32 @Target(ElementType.TYPE) 33 public @interface Plugin { 34 35 /** 36 * Value of the elementType when none is specified. 37 */ 38 String EMPTY = Strings.EMPTY; 39 40 /** 41 * Name of the plugin. Note that this name is case-insensitive. 42 */ 43 String name(); 44 45 /** 46 * Category to place the plugin under. Category names are case-sensitive. 47 */ 48 String category(); 49 50 /** 51 * Name of the corresponding category of elements this plugin belongs under. For example, {@code appender} would 52 * indicate an {@link org.apache.logging.log4j.core.Appender} plugin which would be in the 53 * {@code <Appenders/>} element of a {@link org.apache.logging.log4j.core.config.Configuration}. 54 */ 55 String elementType() default EMPTY; 56 57 /** 58 * Indicates if the plugin class implements a useful {@link Object#toString()} method for use in log messages. 59 */ 60 boolean printObject() default false; 61 62 boolean deferChildren() default false; 63 }