001// ***************************************************************************************************************************
002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
003// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
005// * with the License.  You may obtain a copy of the License at                                                              *
006// *                                                                                                                         *
007// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
008// *                                                                                                                         *
009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
011// * specific language governing permissions and limitations under the License.                                              *
012// ***************************************************************************************************************************
013package org.apache.juneau.annotation;
014
015import static java.lang.annotation.ElementType.*;
016import static java.lang.annotation.RetentionPolicy.*;
017
018import java.lang.annotation.*;
019
020/**
021 * Ignore classes, fields, and methods from being interpreted as bean or bean components.
022 *
023 * <p>
024 * Applied to classes that may look like beans, but you want to be treated as non-beans.
025 * For example, if you want to force a bean to be converted to a string using the <c>toString()</c> method, use
026 * this annotation on the class.
027 *
028 * <p>
029 * Applies to fields that should not be interpreted as bean property fields.
030 *
031 * <p>
032 * Applies to getters or setters that should not be interpreted as bean property getters or setters.
033 *
034 * <ul class='seealso'>
035 *    <li class='link'>{@doc BeanIgnoreAnnotation}
036 * </ul>
037 */
038@Documented
039@Target({FIELD,METHOD,TYPE,CONSTRUCTOR})
040@Retention(RUNTIME)
041@Inherited
042public @interface BeanIgnore {
043   /**
044    * Dynamically apply this annotation to the specified classes/methods/fields/constructors.
045    *
046    * <p>
047    * Used in conjunction with the {@link BeanConfig#applyBeanIgnore()}.
048    * It is ignored when the annotation is applied directly to classes/methods/fields/constructors.
049    *
050    * <h5 class='section'>Valid patterns:</h5>
051    * <ul class='spaced-list'>
052    *  <li>Classes:
053    *       <ul>
054    *          <li>Fully qualified:
055    *             <ul>
056    *                <li><js>"com.foo.MyClass"</js>
057    *             </ul>
058    *          <li>Fully qualified inner class:
059    *             <ul>
060    *                <li><js>"com.foo.MyClass$Inner1$Inner2"</js>
061    *             </ul>
062    *          <li>Simple:
063    *             <ul>
064    *                <li><js>"MyClass"</js>
065    *             </ul>
066    *          <li>Simple inner:
067    *             <ul>
068    *                <li><js>"MyClass$Inner1$Inner2"</js>
069    *                <li><js>"Inner1$Inner2"</js>
070    *                <li><js>"Inner2"</js>
071    *             </ul>
072    *       </ul>
073    *    <li>Methods:
074    *       <ul>
075    *          <li>Fully qualified with args:
076    *             <ul>
077    *                <li><js>"com.foo.MyClass.myMethod(String,int)"</js>
078    *                <li><js>"com.foo.MyClass.myMethod(java.lang.String,int)"</js>
079    *                <li><js>"com.foo.MyClass.myMethod()"</js>
080    *             </ul>
081    *          <li>Fully qualified:
082    *             <ul>
083    *                <li><js>"com.foo.MyClass.myMethod"</js>
084    *             </ul>
085    *          <li>Simple with args:
086    *             <ul>
087    *                <li><js>"MyClass.myMethod(String,int)"</js>
088    *                <li><js>"MyClass.myMethod(java.lang.String,int)"</js>
089    *                <li><js>"MyClass.myMethod()"</js>
090    *             </ul>
091    *          <li>Simple:
092    *             <ul>
093    *                <li><js>"MyClass.myMethod"</js>
094    *             </ul>
095    *          <li>Simple inner class:
096    *             <ul>
097    *                <li><js>"MyClass$Inner1$Inner2.myMethod"</js>
098    *                <li><js>"Inner1$Inner2.myMethod"</js>
099    *                <li><js>"Inner2.myMethod"</js>
100    *             </ul>
101    *       </ul>
102    *    <li>Fields:
103    *       <ul>
104    *          <li>Fully qualified:
105    *             <ul>
106    *                <li><js>"com.foo.MyClass.myField"</js>
107    *             </ul>
108    *          <li>Simple:
109    *             <ul>
110    *                <li><js>"MyClass.myField"</js>
111    *             </ul>
112    *          <li>Simple inner class:
113    *             <ul>
114    *                <li><js>"MyClass$Inner1$Inner2.myField"</js>
115    *                <li><js>"Inner1$Inner2.myField"</js>
116    *                <li><js>"Inner2.myField"</js>
117    *             </ul>
118    *       </ul>
119    *    <li>Constructors:
120    *       <ul>
121    *          <li>Fully qualified with args:
122    *             <ul>
123    *                <li><js>"com.foo.MyClass(String,int)"</js>
124    *                <li><js>"com.foo.MyClass(java.lang.String,int)"</js>
125    *                <li><js>"com.foo.MyClass()"</js>
126    *             </ul>
127    *          <li>Simple with args:
128    *             <ul>
129    *                <li><js>"MyClass(String,int)"</js>
130    *                <li><js>"MyClass(java.lang.String,int)"</js>
131    *                <li><js>"MyClass()"</js>
132    *             </ul>
133    *          <li>Simple inner class:
134    *             <ul>
135    *                <li><js>"MyClass$Inner1$Inner2()"</js>
136    *                <li><js>"Inner1$Inner2()"</js>
137    *                <li><js>"Inner2()"</js>
138    *             </ul>
139    *       </ul>
140    *    <li>A comma-delimited list of anything on this list.
141    * </ul>
142    *
143    * <ul class='seealso'>
144    *    <li class='link'>{@doc DynamicallyAppliedAnnotations}
145    * </ul>
146    */
147   String on() default "";
148}
149