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.io.*;
019import java.lang.annotation.*;
020import java.lang.reflect.*;
021
022import org.apache.juneau.*;
023import org.apache.juneau.parser.*;
024import org.apache.juneau.serializer.*;
025import org.apache.juneau.transform.*;
026
027/**
028 * Annotation for specifying config properties defined in {@link BeanContext} and {@link BeanTraverseContext}.
029 *
030 * <p>
031 * Used primarily for specifying bean configuration properties on REST classes and methods.
032 */
033@Documented
034@Target({TYPE,METHOD})
035@Retention(RUNTIME)
036@Inherited
037@PropertyStoreApply(BeanConfigApply.class)
038public @interface BeanConfig {
039
040   //-----------------------------------------------------------------------------------------------------------------
041   // BeanContext
042   //-----------------------------------------------------------------------------------------------------------------
043
044   /**
045    * Configuration property:  Minimum bean class visibility.
046    *
047    * <p>
048    * Classes are not considered beans unless they meet the minimum visibility requirements.
049    *
050    * <p>
051    * For example, if the visibility is <c>PUBLIC</c> and the bean class is <jk>protected</jk>, then the class
052    * will not be interpreted as a bean class and be serialized as a string.
053    * <br>Use this setting to reduce the visibility requirement.
054    *
055    * <ul class='notes'>
056    *    <li>
057    *       Possible values:
058    *       <ul>
059    *          <li><js>"PUBLIC"</js> (default)
060    *          <li><js>"PROTECTED"</js>
061    *          <li><js>"DEFAULT"</js>
062    *          <li><js>"PRIVATE"</js>
063    *       </ul>
064    *    <li>
065    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
066    *    <li>
067    *       A default global value can be set via the system property <js>"BeanContext.beanClassVisibility.s"</js>.
068    * </ul>
069    *
070    * <ul class='seealso'>
071    *    <li class='jf'>{@link BeanContext#BEAN_beanClassVisibility}
072    * </ul>
073    */
074   String beanClassVisibility() default "";
075
076   /**
077    * Configuration property:  Minimum bean constructor visibility.
078    *
079    * <p>
080    * Only look for constructors with the specified minimum visibility.
081    *
082    * <p>
083    * This setting affects the logic for finding no-arg constructors for bean.
084    * <br>Normally, only <jk>public</jk> no-arg constructors are used.
085    * <br>Use this setting if you want to reduce the visibility requirement.
086    *
087    * <ul class='notes'>
088    *    <li>
089    *       Possible values:
090    *       <ul>
091    *          <li><js>"PUBLIC"</js> (default)
092    *          <li><js>"PROTECTED"</js>
093    *          <li><js>"DEFAULT"</js>
094    *          <li><js>"PRIVATE"</js>
095    *       </ul>
096    *    <li>
097    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
098    *    <li>
099    *       A default global value can be set via the system property <js>"BeanContext.beanConstructorVisibility.s"</js>.
100    * </ul>
101    *
102    * <ul class='seealso'>
103    *    <li class='jf'>{@link BeanContext#BEAN_beanConstructorVisibility}
104    * </ul>
105    */
106   String beanConstructorVisibility() default "";
107
108   /**
109    * Configuration property:  Bean dictionary.
110    *
111    * <p>
112    * The list of classes that make up the bean dictionary in this bean context.
113    *
114    * <p>
115    * A dictionary is a name/class mapping used to find class types during parsing when they cannot be inferred
116    * through reflection.
117    * <br>The names are defined through the {@link Bean#typeName() @Bean(typeName)} annotation defined on the bean class.
118    * <br>For example, if a class <c>Foo</c> has a type-name of <js>"myfoo"</js>, then it would end up serialized
119    * as <js>"{_type:'myfoo',...}"</js>.
120    *
121    * <p>
122    * This setting tells the parsers which classes to look for when resolving <js>"_type"</js> attributes.
123    *
124    * <ul class='seealso'>
125    *    <li class='jf'>{@link BeanContext#BEAN_beanDictionary}
126    *    <li class='link'>{@doc juneau-marshall.BeanDictionaries}
127    * </ul>
128    */
129   Class<?>[] beanDictionary() default {};
130
131   /**
132    * Configuration property:  Add to bean dictionary.
133    *
134    * <ul class='seealso'>
135    *    <li class='jf'>{@link BeanContext#BEAN_beanDictionary}
136    * </ul>
137    */
138   Class<?>[] beanDictionary_replace() default {};
139
140   /**
141    * Configuration property:  Remove from bean dictionary.
142    *
143    * <ul class='seealso'>
144    *    <li class='jf'>{@link BeanContext#BEAN_beanDictionary_remove}
145    * </ul>
146    */
147   Class<?>[] beanDictionary_remove() default {};
148
149   /**
150    * Configuration property:  Minimum bean field visibility.
151    *
152    * <p>
153    * Only look for bean fields with the specified minimum visibility.
154    *
155    * <p>
156    * This affects which fields on a bean class are considered bean properties.
157    * <br>Normally only <jk>public</jk> fields are considered.
158    * <br>Use this setting if you want to reduce the visibility requirement.
159    *
160    * <ul class='notes'>
161    *    <li>
162    *       Possible values:
163    *       <ul>
164    *          <li><js>"PUBLIC"</js> (default)
165    *          <li><js>"PROTECTED"</js>
166    *          <li><js>"DEFAULT"</js>
167    *          <li><js>"PRIVATE"</js>
168    *       </ul>
169    *    <li>
170    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
171    *    <li>
172    *       A default global value can be set via the system property <js>"BeanContext.beanFieldVisibility.s"</js>.
173    * </ul>
174    *
175    * <ul class='seealso'>
176    *    <li class='jf'>{@link BeanContext#BEAN_beanFieldVisibility}
177    * </ul>
178    */
179   String beanFieldVisibility() default "";
180
181   /**
182    * Configuration property:  Bean filters.
183    *
184    * <p>
185    * This is a programmatic equivalent to the {@link Bean @Bean} annotation.
186    * <br>It's useful when you want to use the <c>@Bean</c> annotation functionality, but you don't have the ability to alter
187    * the bean classes.
188    *
189    * <ul class='notes'>
190    *    <li>
191    *       Values can consist of any of the following types:
192    *       <ul class='spaced-list'>
193    *          <li>Any subclass of {@link BeanFilterBuilder}.
194    *             <br>These must have a public no-arg constructor.
195    *          <li>Any bean interfaces.
196    *             <br>A shortcut for defining a {@link InterfaceBeanFilterBuilder}.
197    *             <br>Any subclasses of an interface class will only have properties defined on the interface.
198    *             <br>All other bean properties will be ignored.
199    *       </ul>
200    * </ul>
201    *
202    * <ul class='seealso'>
203    *    <li class='jf'>{@link BeanContext#BEAN_beanFilters}
204    *    <li class='link'>{@doc juneau-marshall.Transforms.BeanFilters}
205    *    <li class='link'>{@doc juneau-marshall.Transforms.InterfaceFilters}
206    * </ul>
207    */
208   Class<?>[] beanFilters() default {};
209
210   /**
211    * Configuration property:  Add to bean filters.
212    *
213    * <ul class='seealso'>
214    *    <li class='jf'>{@link BeanContext#BEAN_beanFilters}
215    * </ul>
216    */
217   Class<?>[] beanFilters_replace() default {};
218
219   /**
220    * Configuration property:  Remove from bean filters.
221    *
222    * <ul class='seealso'>
223    *    <li class='jf'>{@link BeanContext#BEAN_beanFilters_remove}
224    * </ul>
225    */
226   Class<?>[] beanFilters_remove() default {};
227
228   /**
229    * Configuration property:  BeanMap.put() returns old property value.
230    *
231    * <p>
232    * If <js>"true"</js>, then the {@link BeanMap#put(String,Object) BeanMap.put()} method will return old property
233    * values.
234    * <br>Otherwise, it returns <jk>null</jk>.
235    *
236    * <ul class='notes'>
237    *    <li>
238    *       Possible values:
239    *       <ul>
240    *          <li><js>"true"</js>
241    *          <li><js>"false"</js> (default because it introduces a slight performance penalty during serialization)
242    *       </ul>
243    *    <li>
244    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
245    *    <li>
246    *       A default global value can be set via the system property <js>"BeanContext.beanMapPutReturnsOldValue.b"</js>.
247    * </ul>
248    *
249    * <ul class='seealso'>
250    *    <li class='jf'>{@link BeanContext#BEAN_beanMapPutReturnsOldValue}
251    * </ul>
252    */
253   String beanMapPutReturnsOldValue() default "";
254
255   /**
256    * Configuration property:  Minimum bean method visibility.
257    *
258    * <p>
259    * Only look for bean methods with the specified minimum visibility.
260    *
261    * <p>
262    * This affects which methods are detected as getters and setters on a bean class.
263    * <br>Normally only <jk>public</jk> getters and setters are considered.
264    * <br>Use this setting if you want to reduce the visibility requirement.
265    *
266    * <ul class='notes'>
267    *    <li>
268    *       Possible values:
269    *       <ul>
270    *          <li><js>"PUBLIC"</js> (default)
271    *          <li><js>"PROTECTED"</js>
272    *          <li><js>"DEFAULT"</js>
273    *          <li><js>"PRIVATE"</js>
274    *       </ul>
275    *    <li>
276    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
277    *    <li>
278    *       A default global value can be set via the system property <js>"BeanContext.beanMethodVisibility.s"</js>.
279    * </ul>
280    *
281    * <ul class='seealso'>
282    *    <li class='jf'>{@link BeanContext#BEAN_beanMethodVisibility}
283    * </ul>
284    */
285   String beanMethodVisibility() default "";
286
287   /**
288    * Configuration property:  Beans require no-arg constructors.
289    *
290    * <p>
291    * If <js>"true"</js>, a Java class must implement a default no-arg constructor to be considered a bean.
292    * <br>Otherwise, the bean will be serialized as a string using the {@link Object#toString()} method.
293    *
294    * <ul class='notes'>
295    *    <li>
296    *       Possible values:
297    *       <ul>
298    *          <li><js>"true"</js>
299    *          <li><js>"false"</js> (default)
300    *       </ul>
301    *    <li>
302    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
303    *    <li>
304    *       The {@link Bean @Bean} annotation can be used on a class to override this setting when <js>"true"</js>.
305    *    <li>
306    *       A default global value can be set via the system property <js>"BeanContext.beansRequireDefaultConstructor.b"</js>.
307    * </ul>
308    *
309    * <ul class='seealso'>
310    *    <li class='jf'>{@link BeanContext#BEAN_beansRequireDefaultConstructor}
311    * </ul>
312    */
313   String beansRequireDefaultConstructor() default "";
314
315   /**
316    * Configuration property:  Beans require Serializable interface.
317    *
318    * <p>
319    * If <js>"true"</js>, a Java class must implement the {@link Serializable} interface to be considered a bean.
320    * <br>Otherwise, the bean will be serialized as a string using the {@link Object#toString()} method.
321    *
322    * <ul class='notes'>
323    *    <li>
324    *       Possible values:
325    *       <ul>
326    *          <li><js>"true"</js>
327    *          <li><js>"false"</js> (default)
328    *       </ul>
329    *    <li>
330    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
331    *    <li>
332    *       The {@link Bean @Bean} annotation can be used on a class to override this setting when <js>"true"</js>.
333    *    <li>
334    *       A default global value can be set via the system property <js>"BeanContext.beansRequireSerializable.b"</js>.
335    * </ul>
336    *
337    * <ul class='seealso'>
338    *    <li class='jf'>{@link BeanContext#BEAN_beansRequireSerializable}
339    * </ul>
340    */
341   String beansRequireSerializable() default "";
342
343   /**
344    * Configuration property:  Beans require setters for getters.
345    *
346    * <p>
347    * If <js>"true"</js>, only getters that have equivalent setters will be considered as properties on a bean.
348    * <br>Otherwise, they will be ignored.
349    *
350    * <ul class='notes'>
351    *    <li>
352    *       Possible values:
353    *       <ul>
354    *          <li><js>"true"</js>
355    *          <li><js>"false"</js> (default)
356    *       </ul>
357    *    <li>
358    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
359    *    <li>
360    *       A default global value can be set via the system property <js>"BeanContext.beansRequireSettersForGetters.b"</js>.
361    * </ul>
362    *
363    * <ul class='seealso'>
364    *    <li class='jf'>{@link BeanContext#BEAN_beansRequireSettersForGetters}
365    * </ul>
366    */
367   String beansRequireSettersForGetters() default "";
368
369   /**
370    * Configuration property:  Beans require at least one property.
371    *
372    * <p>
373    * If <js>"true"</js>, then a Java class must contain at least 1 property to be considered a bean.
374    * <br>Otherwise, the bean will be serialized as a string using the {@link Object#toString()} method.
375    *
376    * <ul class='notes'>
377    *    <li>
378    *       Possible values:
379    *       <ul>
380    *          <li><js>"true"</js> (default)
381    *          <li><js>"false"</js>
382    *       </ul>
383    *    <li>
384    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
385    *    <li>
386    *       A default global value can be set via the system property <js>"BeanContext.beansRequireSomeProperties.b"</js>.
387    * </ul>
388    *
389    * <ul class='seealso'>
390    *    <li class='jf'>{@link BeanContext#BEAN_beansRequireSomeProperties}
391    * </ul>
392    */
393   String beansRequireSomeProperties() default "";
394
395   /**
396    * Configuration property:  Bean type property name.
397    *
398    * <p>
399    * This specifies the name of the bean property used to store the dictionary name of a bean type so that the
400    * parser knows the data type to reconstruct.
401    *
402    * <ul class='notes'>
403    *    <li>
404    *       Default value: <js>"_type"</js>.
405    *    <li>
406    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
407    *    <li>
408    *       A default global value can be set via the system property <js>"BeanContext.beanTypePropertyName.s"</js>.
409    * </ul>
410
411    * <ul class='seealso'>
412    *    <li class='jf'>{@link BeanContext#BEAN_beanTypePropertyName}
413    * </ul>
414    */
415   String beanTypePropertyName() default "";
416
417   /**
418    * Configuration property:  Bean property includes.
419    *
420    * Shortcut for specifying the {@link BeanContext#BEAN_includeProperties} property on all serializers.
421    *
422    * <p>
423    * The typical use case is when you're rendering summary and details views of the same bean in a resource and
424    * you want to expose or hide specific properties depending on the level of detail you want.
425    *
426    * <p>
427    * In the example below, our 'summary' view is a list of beans where we only want to show the ID property,
428    * and our detail view is a single bean where we want to expose different fields:
429    * <p class='bcode w800'>
430    *    <jc>// Our bean</jc>
431    *    <jk>public class</jk> MyBean {
432    *
433    *       <jc>// Summary properties</jc>
434    *       <ja>@Html</ja>(link=<js>"servlet:/mybeans/{id}"</js>)
435    *       <jk>public</jk> String <jf>id</jf>;
436    *
437    *       <jc>// Detail properties</jc>
438    *       <jk>public</jk> String <jf>a</jf>, <jf>b</jf>;
439    *    }
440    *
441    *    <jc>// Only render "id" property.</jc>
442    *    <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/mybeans"</js>)
443    *    <ja>@BeanConfig</ja>(bpi=<js>"MyBean: id"</js>)
444    *    <jk>public</jk> List&lt;MyBean&gt; getBeanSummary() {...}
445    *
446    *    <jc>// Only render "a" and "b" properties.</jc>
447    *    <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/mybeans/{id}"</js>)
448    *    <ja>@BeanConfig</ja>(bpi=<js>"MyBean: a,b"</js>)
449    *    <jk>public</jk> MyBean getBeanDetails(<ja>@Path</ja> String id) {...}
450    * </p>
451    *
452    * <ul class='notes'>
453    *    <li>
454    *       The format of each value is: <js>"Key: comma-delimited-tokens"</js>.
455    *    <li>
456    *       Keys can be fully-qualified or short class names or <js>"*"</js> to represent all classes.
457    *    <li>
458    *       Values are comma-delimited lists of bean property names.
459    *    <li>
460    *       Properties apply to specified class and all subclasses.
461    *    <li>
462    *       Semicolons can be used as an additional separator for multiple values:
463    *       <p class='bcode w800'>
464    *    <jc>// Equivalent</jc>
465    *    bpi={<js>"Bean1: foo"</js>,<js>"Bean2: bar,baz"</js>}
466    *    bpi=<js>"Bean1: foo; Bean2: bar,baz"</js>
467    *       </p>
468    *    <li>
469    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
470    *    <li>
471    *       A default global value can be set via the system property <js>"BeanContext.properties.sms"</js>.
472    * </ul>
473    *
474    * <ul class='seealso'>
475    *    <li class='jf'>{@link BeanContext#BEAN_includeProperties}
476    * </ul>
477    */
478   String[] bpi() default {};
479
480   /**
481    * Configuration property:  Bean property excludes.
482    *
483    * Shortcut for specifying the {@link BeanContext#BEAN_excludeProperties} property on all serializers.
484    *
485    * <p>
486    * Same as {@link #bpi()} except you specify a list of bean property names that you want to exclude from
487    * serialization.
488    *
489    * <p>
490    * In the example below, our 'summary' view is a list of beans where we want to exclude some properties:
491    * <p class='bcode w800'>
492    *    <jc>// Our bean</jc>
493    *    <jk>public class</jk> MyBean {
494    *
495    *       <jc>// Summary properties</jc>
496    *       <ja>@Html</ja>(link=<js>"servlet:/mybeans/{id}"</js>)
497    *       <jk>public</jk> String <jf>id</jf>;
498    *
499    *       <jc>// Detail properties</jc>
500    *       <jk>public</jk> String <jf>a</jf>, <jf>b</jf>;
501    *    }
502    *
503    *    <jc>// Don't show "a" and "b" properties.</jc>
504    *    <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/mybeans"</js>)
505    *    <ja>@BeanConfig</ja>(bpx=<js>"MyBean: a,b"</js>)
506    *    <jk>public</jk> List&lt;MyBean&gt; getBeanSummary() {...}
507    *
508    *    <jc>// Render all properties.</jc>
509    *    <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/mybeans/{id}"</js>)
510    *    <jk>public</jk> MyBean getBeanDetails(<ja>@Path</ja> String id) {...}
511    * </p>
512    *
513    * <ul class=''>
514    *    <li>
515    *       The format of each value is: <js>"Key: comma-delimited-tokens"</js>.
516    *    <li>
517    *       Keys can be fully-qualified or short class names or <js>"*"</js> to represent all classes.
518    *    <li>
519    *       Values are comma-delimited lists of bean property names.
520    *    <li>
521    *       Properties apply to specified class and all subclasses.
522    *    <li>
523    *       Semicolons can be used as an additional separator for multiple values:
524    *       <p class='bcode w800'>
525    *    <jc>// Equivalent</jc>
526    *    bpx={<js>"Bean1: foo"</js>,<js>"Bean2: bar,baz"</js>}
527    *    bpx=<js>"Bean1: foo; Bean2: bar,baz"</js>
528    *       </p>
529    *    <li>
530    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
531    *    <li>
532    *       A default global value can be set via the system property <js>"BeanContext.excludeProperties.sms"</js>.
533    * </ul>
534    *
535    * <ul class='seealso'>
536    *    <li class='jf'>{@link BeanContext#BEAN_excludeProperties}
537    * </ul>
538    */
539   String[] bpx() default {};
540
541   /**
542    * Configuration property:  Debug mode.
543    *
544    * <p>
545    * Enables the following additional information during serialization:
546    * <ul class='spaced-list'>
547    *    <li>
548    *       When bean getters throws exceptions, the exception includes the object stack information
549    *       in order to determine how that method was invoked.
550    *    <li>
551    *       Enables {@link Serializer#BEANTRAVERSE_detectRecursions}.
552    * </ul>
553    *
554    * <p>
555    * Enables the following additional information during parsing:
556    * <ul class='spaced-list'>
557    *    <li>
558    *       When bean setters throws exceptions, the exception includes the object stack information
559    *       in order to determine how that method was invoked.
560    * </ul>
561    *
562    * <ul class='notes'>
563    *    <li>
564    *       Possible values:
565    *       <ul>
566    *          <li><js>"true"</js>
567    *          <li><js>"false"</js> (default)
568    *       </ul>
569    *    <li>
570    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
571    *    <li>
572    *       A default global value can be set via the system property <js>"BeanContext.debug.b"</js>.
573    * </ul>
574    *
575    * <ul class='seealso'>
576    *    <li class='jf'>{@link BeanContext#BEAN_debug}
577    * </ul>
578    */
579   String debug() default "";
580
581   /**
582    * Configuration property:  POJO examples.
583    *
584    * <p>
585    * Specifies an example of the specified class.
586    *
587    * <p>
588    * Examples are used in cases such as POJO examples in Swagger documents.
589    *
590    * <h5 class='section'>Example:</h5>
591    * <p class='bcode w800'>
592    *    <ja>@BeanConfig</ja>(
593    *       examples={
594    *          <ja>@CSEntry</ja>(key=MyBean.<jk>class</jk>, value=<js>"{foo:'bar'}"</js>)
595    *       }
596    *    )
597    * </p>
598    *
599    * <ul class='notes'>
600    *    <li>
601    *       Setting applies to specified class and all subclasses.
602    *    <li>
603    *       Keys are the class of the example.
604    *       <br>Values are Simple-JSON representation of that class.
605    *    <li>
606    *       POJO examples can also be defined on classes via the following:
607    *       <ul class='spaced-list'>
608    *          <li>A static field annotated with {@link Example @Example}.
609    *          <li>A static method annotated with {@link Example @Example} with zero arguments or one {@link BeanSession} argument.
610    *          <li>A static method with name <c>example</c> with no arguments or one {@link BeanSession} argument.
611    *       </ul>
612    *    <li>
613    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
614    *    <li>
615    *       A default global value can be set via the system property <js>"BeanContext.examples.smo"</js>.
616    * </ul>
617    *
618    * <ul class='seealso'>
619    *    <li class='jf'>{@link BeanContext#BEAN_examples}
620    * </ul>
621    */
622   CS[] example() default {};
623
624   /**
625    * Configuration property:  POJO examples.
626    *
627    * <p>
628    * Same as {@link #example()} but allows you to define examples as a Simple-JSON string.
629    *
630    * <h5 class='section'>Example:</h5>
631    * <p class='bcode w800'>
632    *    <ja>@BeanConfig</ja>(
633    *       examples={
634    *          <js>"MyBean: {foo:'bar'}"</js>  <jc>// Could also be "{MyBean: {foo:'bar'}}"</jc>
635    *       }
636    *    )
637    * </p>
638    *
639    * <ul class='notes'>
640    *    <li>
641    *       Keys are the class of the example and can be the fully-qualified name or simple name.
642    *       <br>Values are Simple-JSON representation of that class.
643    * <li>
644    *       The individual strings are concatenated together and the whole string is treated as a JSON Object.
645    *       <br>The leading and trailing <js>'{'</js> and <js>'}'</js> characters are optional.
646    *    <li>
647    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
648    *    <li>
649    *       A default global value can be set via the system property <js>"BeanContext.examples.smo"</js>.
650    * </ul>
651    *
652    * <ul class='seealso'>
653    *    <li class='jf'>{@link BeanContext#BEAN_examples}
654    * </ul>
655    */
656   String[] examples() default {};
657
658   /**
659    * Configuration property:  Bean property excludes.
660    *
661    * <p>
662    * Specifies to exclude the specified list of properties for the specified bean class.
663    *
664    * <h5 class='section'>Example:</h5>
665    * <p class='bcode w800'>
666    *    <ja>@BeanConfig</ja>(
667    *       excludeProperties={
668    *          <ja>@CSEntry</ja>(key=MyBean.<jk>class</jk>, value=<js>"foo,bar"</js>)
669    *       }
670    *    )
671    * <p>
672    *
673    * <ul class='notes'>
674    *    <li>
675    *       Keys are the class applied to.
676    *       <br>Values are comma-delimited lists of property names.
677    * <li>
678    *       Setting applies to specified class and all subclasses.
679    *    <li>
680    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
681    *    <li>
682    *       A default global value can be set via the system property <js>"BeanContext.excludeProperties.sms"</js>.
683    * </ul>
684    *
685    * <ul class='seealso'>
686    *    <li class='jf'>{@link BeanContext#BEAN_excludeProperties}
687    * </ul>
688    */
689   CS[] excludeProperties() default {};
690
691   /**
692    * Configuration property:  Find fluent setters.
693    *
694    * <p>
695    * When enabled, fluent setters are detected on beans.
696    *
697    * <p>
698    * Fluent setters must have the following attributes:
699    * <ul>
700    *    <li>Public.
701    *    <li>Not static.
702    *    <li>Take in one parameter.
703    *    <li>Return the bean itself.
704    * </ul>
705    *
706    * <ul class='notes'>
707    *    <li>
708    *       Possible values:
709    *       <ul>
710    *          <li><js>"true"</js>
711    *          <li><js>"false"</js> (default)
712    *       </ul>
713    *    <li>
714    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
715    *    <li>
716    *       A default global value can be set via the system property <js>"BeanContext.fluentSetters.b"</js>.
717    * </ul>
718    *
719    * <ul class='seealso'>
720    *    <li class='jf'>{@link BeanContext#BEAN_fluentSetters}
721    * </ul>
722    */
723   String fluentSetters() default "";
724
725   /**
726    * Configuration property:  Ignore invocation errors on getters.
727    *
728    * <p>
729    * If <js>"true"</js>, errors thrown when calling bean getter methods will silently be ignored.
730    * <br>Otherwise, a {@code BeanRuntimeException} is thrown.
731    *
732    * <ul class='notes'>
733    *    <li>
734    *       Possible values:
735    *       <ul>
736    *          <li><js>"true"</js>
737    *          <li><js>"false"</js> (default)
738    *       </ul>
739    *    <li>
740    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
741    *    <li>
742    *       A default global value can be set via the system property <js>"BeanContext.ignoreInvocationExceptionsOnGetters.b"</js>.
743    * </ul>
744    *
745    * <ul class='seealso'>
746    *    <li class='jf'>{@link BeanContext#BEAN_ignoreInvocationExceptionsOnGetters}
747    * </ul>
748    */
749   String ignoreInvocationExceptionsOnGetters() default "";
750
751   /**
752    * Configuration property:  Ignore invocation errors on setters.
753    *
754    * <p>
755    * If <js>"true"</js>, errors thrown when calling bean setter methods will silently be ignored.
756    * <br>Otherwise, a {@code BeanRuntimeException} is thrown.
757    *
758    * <ul class='notes'>
759    *    <li>
760    *       Possible values:
761    *       <ul>
762    *          <li><js>"true"</js>
763    *          <li><js>"false"</js> (default)
764    *       </ul>
765    *    <li>
766    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
767    *    <li>
768    *       A default global value can be set via the system property <js>"BeanContext.ignoreInvocationExceptionsOnSetters.b"</js>.
769    * </ul>
770    *
771    * <ul class='seealso'>
772    *    <li class='jf'>{@link BeanContext#BEAN_ignoreInvocationExceptionsOnSetters}
773    * </ul>
774    */
775   String ignoreInvocationExceptionsOnSetters() default "";
776
777   /**
778    * Configuration property:  Ignore properties without setters.
779    *
780    * <p>
781    * If <js>"true"</js>, trying to set a value on a bean property without a setter will silently be ignored.
782    * <br>Otherwise, a {@code RuntimeException} is thrown.
783    *
784    * <ul class='notes'>
785    *    <li>
786    *       Possible values:
787    *       <ul>
788    *          <li><js>"true"</js> (default)
789    *          <li><js>"false"</js>
790    *       </ul>
791    *    <li>
792    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
793    *    <li>
794    *       A default global value can be set via the system property <js>"BeanContext.ignorePropertiesWithoutSetters.b"</js>.
795    * </ul>
796    *
797    * <ul class='seealso'>
798    *    <li class='jf'>{@link BeanContext#BEAN_ignorePropertiesWithoutSetters}
799    * </ul>
800    */
801   String ignorePropertiesWithoutSetters() default "";
802
803   /**
804    * Configuration property:  Ignore unknown properties.
805    *
806    * <p>
807    * If <js>"true"</js>, trying to set a value on a non-existent bean property will silently be ignored.
808    * <br>Otherwise, a {@code RuntimeException} is thrown.
809    *
810    * <ul class='notes'>
811    *    <li>
812    *       Possible values:
813    *       <ul>
814    *          <li><js>"true"</js>
815    *          <li><js>"false"</js> (default)
816    *       </ul>
817    *    <li>
818    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
819    *    <li>
820    *       A default global value can be set via the system property <js>"BeanContext.ignoreUnknownBeanProperties.b"</js>.
821    * </ul>
822    *
823    * <ul class='seealso'>
824    *    <li class='jf'>{@link BeanContext#BEAN_ignoreUnknownBeanProperties}
825    * </ul>
826    */
827   String ignoreUnknownBeanProperties() default "";
828
829   /**
830    * Configuration property:  Ignore unknown properties with null values.
831    *
832    * <p>
833    * If <js>"true"</js>, trying to set a <jk>null</jk> value on a non-existent bean property will silently be ignored.
834    * <br>Otherwise, a {@code RuntimeException} is thrown.
835    *
836    * <ul class='notes'>
837    *    <li>
838    *       Possible values:
839    *       <ul>
840    *          <li><js>"true"</js> (default)
841    *          <li><js>"false"</js>
842    *       </ul>
843    *    <li>
844    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
845    *    <li>
846    *       A default global value can be set via the system property <js>"BeanContext.ignoreUnknownNullBeanProperties.b"</js>.
847    * </ul>
848    *
849    * <ul class='seealso'>
850    *    <li class='jf'>{@link BeanContext#BEAN_ignoreUnknownNullBeanProperties}
851    * </ul>
852    */
853   String ignoreUnknownNullBeanProperties() default "";
854
855   /**
856    * Configuration property:  Implementation classes.
857    *
858    * <p>
859    * For interfaces and abstract classes this method can be used to specify an implementation class for the
860    * interface/abstract class so that instances of the implementation class are used when instantiated (e.g. during a
861    * parse).
862    *
863    * <h5 class='section'>Example:</h5>
864    * <p class='bcode w800'>
865    *    <ja>@BeanConfig</ja>(
866    *       implClasses={
867    *          <ja>@CCEntry</ja>(key=MyInterface.<jk>class</jk>, value=MyInterfaceImpl.<jk>class</jk>)
868    *       }
869    *    )
870    * <p>
871    *
872    * <ul class='seealso'>
873    *    <li class='jf'>{@link BeanContext#BEAN_implClasses}
874    * </ul>
875    */
876   CC[] implClasses() default {};
877
878   /**
879    * Configuration property:  Bean property includes.
880    *
881    * <p>
882    * Specifies the set and order of names of properties associated with the bean class.
883    *
884    * <h5 class='section'>Example:</h5>
885    * <p class='bcode w800'>
886    *    <ja>@BeanConfig</ja>(
887    *       includeProperties={
888    *          <ja>@CSEntry</ja>(key=MyBean.<jk>class</jk>, value=<js>"foo,bar"</js>)
889    *       }
890    *    )
891    * <p>
892    *
893    * <ul class='notes'>
894    *    <li>
895    *       Keys are the class applied to.
896    *       <br>Values are comma-delimited lists of property names.
897    *    <li>
898    *       Setting applies to specified class and all subclasses.
899    *    <li>
900    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
901    *    <li>
902    *       A default global value can be set via the system property <js>"BeanContext.properties.sms"</js>.
903    * </ul>
904    *
905    * <ul class='seealso'>
906    *    <li class='jf'>{@link BeanContext#BEAN_includeProperties}
907    * </ul>
908    */
909   CS[] includeProperties() default {};
910
911   /**
912    * Configuration property:  Locale.
913    *
914    * <p>
915    * Specifies the default locale for serializer and parser sessions.
916    *
917    * <ul class='notes'>
918    *    <li>
919    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
920    *    <li>
921    *       A default global value can be set via the system property <js>"BeanContext.locale.s"</js>.
922    * </ul>
923    *
924    * <ul class='seealso'>
925    *    <li class='jf'>{@link BeanContext#BEAN_locale}
926    * </ul>
927    */
928   String locale() default "";
929
930   /**
931    * Configuration property:  Media type.
932    *
933    * <p>
934    * Specifies the default media type value for serializer and parser sessions.
935    *
936    * <ul class='notes'>
937    *    <li>
938    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
939    *    <li>
940    *       A default global value can be set via the system property <js>"BeanContext.mediaType.s"</js>.
941    * </ul>
942    *
943    * <ul class='seealso'>
944    *    <li class='jf'>{@link BeanContext#BEAN_mediaType}
945    * </ul>
946    */
947   String mediaType() default "";
948
949   /**
950    * Configuration property:  Bean class exclusions.
951    *
952    * <p>
953    * List of classes that should not be treated as beans even if they appear to be bean-like.
954    * <br>Not-bean classes are converted to <c>Strings</c> during serialization.
955    *
956    * <ul class='notes'>
957    *    <li>
958    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
959    *    <li>
960    *       A default global value can be set via the system property <js>"BeanContext.notBeanClasses.sc"</js>.
961    * </ul>
962    *
963    * <ul class='seealso'>
964    *    <li class='jf'>{@link BeanContext#BEAN_notBeanClasses}
965    * </ul>
966    */
967   Class<?>[] notBeanClasses() default {};
968
969   /**
970    * Configuration property:  Add to classes that should not be considered beans.
971    *
972    * <ul class='seealso'>
973    *    <li class='jf'>{@link BeanContext#BEAN_notBeanClasses}
974    * </ul>
975    */
976   Class<?>[] notBeanClasses_replace() default {};
977
978   /**
979    * Configuration property:  Remove from classes that should not be considered beans.
980    *
981    * <ul class='seealso'>
982    *    <li class='jf'>{@link BeanContext#BEAN_notBeanClasses}
983    * </ul>
984    */
985   Class<?>[] notBeanClasses_remove() default {};
986
987   /**
988    * Configuration property:  Bean package exclusions.
989    *
990    * <p>
991    * When specified, the current list of ignore packages are appended to.
992    *
993    * <p>
994    * Any classes within these packages will be serialized to strings using {@link Object#toString()}.
995    *
996    * <p>
997    * Note that you can specify suffix patterns to include all subpackages.
998    *
999    * <ul class='notes'>
1000    *    <li>
1001    *       The default value excludes the following packages:
1002    *       <ul>
1003    *          <li><c>java.lang</c>
1004    *          <li><c>java.lang.annotation</c>
1005    *          <li><c>java.lang.ref</c>
1006    *          <li><c>java.lang.reflect</c>
1007    *          <li><c>java.io</c>
1008    *          <li><c>java.net</c>
1009    *          <li><c>java.nio.*</c>
1010    *          <li><c>java.util.*</c>
1011    *       </ul>
1012    *    <li>
1013    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
1014    *    <li>
1015    *       A default global value can be set via the system property <js>"BeanContext.notBeanPackages.ss"</js>.
1016    * </ul>
1017    *
1018    * <ul class='seealso'>
1019    *    <li class='jf'>{@link BeanContext#BEAN_notBeanPackages}
1020    * </ul>
1021    */
1022   String[] notBeanPackages() default {};
1023
1024   /**
1025    * Configuration property:  Add to packages whose classes should not be considered beans.
1026    *
1027    * <ul class='seealso'>
1028    *    <li class='jf'>{@link BeanContext#BEAN_notBeanPackages}
1029    * </ul>
1030    */
1031   String[] notBeanPackages_replace() default {};
1032
1033   /**
1034    * Configuration property:  Remove from packages whose classes should not be considered beans.
1035    *
1036    * <ul class='seealso'>
1037    *    <li class='jf'>{@link BeanContext#BEAN_notBeanPackages}
1038    * </ul>
1039    */
1040   String[] notBeanPackages_remove() default {};
1041
1042   /**
1043    * Configuration property:  POJO swaps.
1044    *
1045    * <p>
1046    * POJO swaps are used to "swap out" non-serializable classes with serializable equivalents during serialization,
1047    * and "swap in" the non-serializable class during parsing.
1048    *
1049    * <p>
1050    * An example of a POJO swap would be a <c>Calendar</c> object that gets swapped out for an ISO8601 string.
1051    *
1052    * <p>
1053    * Multiple POJO swaps can be associated with a single class.
1054    * <br>When multiple swaps are applicable to the same class, the media type pattern defined by
1055    * {@link PojoSwap#forMediaTypes()} or {@link Swap#mediaTypes() @Swap(mediaTypes)} are used to come up with the best match.
1056    *
1057    * <ul class='seealso'>
1058    *    <li class='jf'>{@link BeanContext#BEAN_pojoSwaps}
1059    *    <li class='link'>{@doc juneau-marshall.Transforms.PojoSwaps}
1060    *    <li class='link'>{@doc juneau-marshall.Transforms.PerMediaTypePojoSwaps}
1061    *    <li class='link'>{@doc juneau-marshall.Transforms.OneWayPojoSwaps}
1062    *    <li class='link'>{@doc juneau-marshall.Transforms.SwapAnnotation}
1063    *    <li class='link'>{@doc juneau-marshall.Transforms.AutoPojoSwaps}
1064    *    <li class='link'>{@doc juneau-marshall.Transforms.SurrogateClasses}
1065    * </ul>
1066    */
1067   Class<? extends PojoSwap<?,?>>[] pojoSwaps() default {};
1068
1069   /**
1070    * Configuration property:  Add to POJO swap classes.
1071    *
1072    * <ul class='seealso'>
1073    *    <li class='jf'>{@link BeanContext#BEAN_pojoSwaps}
1074    * </ul>
1075    */
1076   Class<? extends PojoSwap<?,?>>[] pojoSwaps_replace() default {};
1077
1078   /**
1079    * Configuration property:  Remove from POJO swap classes.
1080    *
1081    * <ul class='seealso'>
1082    *    <li class='jf'>{@link BeanContext#BEAN_pojoSwaps}
1083    * </ul>
1084    */
1085   Class<? extends PojoSwap<?,?>>[] pojoSwaps_remove() default {};
1086
1087   /**
1088    * Configuration property:  Bean property namer.
1089    *
1090    * <p>
1091    * The class to use for calculating bean property names.
1092    *
1093    * <p>
1094    * Predefined classes:
1095    * <ul>
1096    *    <li>{@link PropertyNamerDefault} (default)
1097    *    <li>{@link PropertyNamerDLC} - Dashed-lower-case names.
1098    *    <li>{@link PropertyNamerULC} - Dashed-upper-case names.
1099    * </ul>
1100    *
1101    * <ul class='seealso'>
1102    *    <li class='jf'>{@link BeanContext#BEAN_propertyNamer}
1103    * </ul>
1104    */
1105   Class<? extends PropertyNamer> propertyNamer() default PropertyNamer.Null.class;
1106
1107   /**
1108    * Configuration property:  Sort bean properties.
1109    *
1110    * <p>
1111    * When <jk>true</jk>, all bean properties will be serialized and access in alphabetical order.
1112    * <br>Otherwise, the natural order of the bean properties is used which is dependent on the JVM vendor.
1113    * <br>On IBM JVMs, the bean properties are ordered based on their ordering in the Java file.
1114    * <br>On Oracle JVMs, the bean properties are not ordered (which follows the official JVM specs).
1115    *
1116    * <p>
1117    * This property is disabled by default so that IBM JVM users don't have to use {@link Bean @Bean} annotations
1118    * to force bean properties to be in a particular order and can just alter the order of the fields/methods
1119    * in the Java file.
1120    *
1121    * <ul class='notes'>
1122    *    <li>
1123    *       Possible values:
1124    *       <ul>
1125    *          <li><js>"true"</js>
1126    *          <li><js>"false"</js> (default)
1127    *       </ul>
1128    *    <li>
1129    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
1130    *    <li>
1131    *       A default global value can be set via the system property <js>"BeanContext.sortProperties.b"</js>.
1132    * </ul>
1133    *
1134    * <ul class='seealso'>
1135    *    <li class='jf'>{@link BeanContext#BEAN_sortProperties}
1136    * </ul>
1137    */
1138   String sortProperties() default "";
1139
1140   /**
1141    * Configuration property:  Time zone.
1142    *
1143    * <p>
1144    * Specifies the default timezone for serializer and parser sessions.
1145    *
1146    * <ul class='notes'>
1147    *    <li>
1148    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
1149    *    <li>
1150    *       A default global value can be set via the system property <js>"BeanContext.timeZone.s"</js>.
1151    * </ul>
1152    *
1153    * <ul class='seealso'>
1154    *    <li class='jf'>{@link BeanContext#BEAN_timeZone}
1155    * </ul>
1156    */
1157   String timeZone() default "";
1158
1159   /**
1160    * Configuration property:  Use enum names.
1161    *
1162    * <p>
1163    * When enabled, enums are always serialized by name, not using {@link Object#toString()}.
1164    *
1165    * <ul class='notes'>
1166    *    <li>
1167    *    Possible values:
1168    *       <ul>
1169    *          <li><js>"true"</js>
1170    *          <li><js>"false"</js> (default)
1171    *       </ul>
1172    *    <li>
1173    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
1174    *    <li>
1175    *       A default global value can be set via the system property <js>"BeanContext.useEnumNames.b"</js>.
1176    * </ul>
1177    *
1178    * <ul class='seealso'>
1179    *    <li class='jf'>{@link BeanContext#BEAN_useEnumNames}
1180    * </ul>
1181    */
1182   String useEnumNames() default "";
1183
1184   /**
1185    * Configuration property:  Use interface proxies.
1186    *
1187    * <p>
1188    * If <js>"true"</js>, then interfaces will be instantiated as proxy classes through the use of an
1189    * {@link InvocationHandler} if there is no other way of instantiating them.
1190    * <br>Otherwise, throws a {@link BeanRuntimeException}.
1191    *
1192    * <ul class='notes'>
1193    *    <li>
1194    *    Possible values:
1195    *       <ul>
1196    *          <li><js>"true"</js> (default)
1197    *          <li><js>"false"</js>
1198    *       </ul>
1199    *    <li>
1200    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
1201    *    <li>
1202    *       A default global value can be set via the system property <js>"BeanContext.useInterfaceProxies.b"</js>.
1203    * </ul>
1204    *
1205    * <ul class='seealso'>
1206    *    <li class='jf'>{@link BeanContext#BEAN_useInterfaceProxies}
1207    * </ul>
1208    */
1209   String useInterfaceProxies() default "";
1210
1211   /**
1212    * Configuration property:  Use Java Introspector.
1213    *
1214    * <p>
1215    * Using the built-in Java bean introspector will not pick up fields or non-standard getters/setters.
1216    * <br>Most {@link Bean @Bean} annotations will be ignored.
1217    *
1218    * <ul class='notes'>
1219    *    <li>
1220    *    Possible values:
1221    *       <ul>
1222    *          <li><js>"true"</js>
1223    *          <li><js>"false"</js> (default)
1224    *       </ul>
1225    *    <li>
1226    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
1227    *    <li>
1228    *       A default global value can be set via the system property <js>"BeanContext.useJavaBeanIntrospector.b"</js>.
1229    * </ul>
1230    *
1231    * <ul class='seealso'>
1232    *    <li class='jf'>{@link BeanContext#BEAN_useJavaBeanIntrospector}
1233    * </ul>
1234    */
1235   String useJavaBeanIntrospector() default "";
1236
1237   //-----------------------------------------------------------------------------------------------------------------
1238   // BeanTraverseContext
1239   //-----------------------------------------------------------------------------------------------------------------
1240
1241   /**
1242    * Configuration property:  Automatically detect POJO recursions.
1243    *
1244    * <p>
1245    * Specifies that recursions should be checked for during traversal.
1246    *
1247    * <p>
1248    * Recursions can occur when traversing models that aren't true trees but rather contain loops.
1249    * <br>In general, unchecked recursions cause stack-overflow-errors.
1250    * <br>These show up as {@link ParseException ParseExceptions} with the message <js>"Depth too deep.  Stack overflow occurred."</js>.
1251    *
1252    * <p>
1253    * The behavior when recursions are detected depends on the value for {@link BeanTraverseContext#BEANTRAVERSE_ignoreRecursions}.
1254    *
1255    * <p>
1256    * For example, if a model contains the links A-&gt;B-&gt;C-&gt;A, then the JSON generated will look like
1257    *    the following when <jsf>BEANTRAVERSE_ignoreRecursions</jsf> is <jk>true</jk>...
1258    *
1259    * <p class='bcode w800'>
1260    *    {A:{B:{C:<jk>null</jk>}}}
1261    * </p>
1262    *
1263    * <ul class='notes'>
1264    *    <li>
1265    *       Checking for recursion can cause a small performance penalty.
1266    *    <li>
1267    *    Possible values:
1268    *       <ul>
1269    *          <li><js>"true"</js>
1270    *          <li><js>"false"</js> (default)
1271    *       </ul>
1272    *    <li>
1273    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
1274    *    <li>
1275    *       A default global value can be set via the system property <js>"BeanTraverseContext.detectRecursions.b"</js>.
1276    * </ul>
1277    *
1278    * <ul class='seealso'>
1279    *    <li class='jf'>{@link BeanTraverseContext#BEANTRAVERSE_detectRecursions}
1280    * </ul>
1281    */
1282   String detectRecursions() default "";
1283
1284   /**
1285    * Configuration property:  Ignore recursion errors.
1286    *
1287    * <p>
1288    * Used in conjunction with {@link BeanTraverseContext#BEANTRAVERSE_detectRecursions}.
1289    * <br>Setting is ignored if <jsf>BEANTRAVERSE_detectRecursions</jsf> is <js>"false"</js>.
1290    *
1291    * <p>
1292    * If <js>"true"</js>, when we encounter the same object when traversing a tree, we set the value to <jk>null</jk>.
1293    * <br>Otherwise, a {@link BeanRecursionException} is thrown with the message <js>"Recursion occurred, stack=..."</js>.
1294    *
1295    * <ul class='notes'>
1296    *    <li>
1297    *    Possible values:
1298    *       <ul>
1299    *          <li><js>"true"</js>
1300    *          <li><js>"false"</js> (default)
1301    *       </ul>
1302    *    <li>
1303    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
1304    *    <li>
1305    *       A default global value can be set via the system property <js>"BeanTraverseContext.ignoreRecursions.b"</js>.
1306    * </ul>
1307    *
1308    * <ul class='seealso'>
1309    *    <li class='jf'>{@link BeanTraverseContext#BEANTRAVERSE_ignoreRecursions}
1310    * </ul>
1311    */
1312   String ignoreRecursions() default "";
1313
1314   /**
1315    * Configuration property:  Initial depth.
1316    *
1317    * <p>
1318    * The initial indentation level at the root.
1319    * <br>Useful when constructing document fragments that need to be indented at a certain level.
1320    *
1321    * <ul class='notes'>
1322    *    <li>
1323    *       Format: integer
1324    * <li>
1325    *       Default value: <js>"0"</js>
1326    *    <li>
1327    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
1328    *    <li>
1329    *       A default global value can be set via the system property <js>"BeanTraverseContext.initialDepth.i"</js>.
1330    * </ul>
1331    *
1332    * <ul class='seealso'>
1333    *    <li class='jf'>{@link BeanTraverseContext#BEANTRAVERSE_initialDepth}
1334    * </ul>
1335    */
1336   String initialDepth() default "";
1337
1338   /**
1339    * Configuration property:  Max traversal depth.
1340    *
1341    * <p>
1342    * Abort traversal if specified depth is reached in the POJO tree.
1343    * <br>If this depth is exceeded, an exception is thrown.
1344    *
1345    * <ul class='notes'>
1346    *    <li>
1347    *       Format: integer
1348    *    <li>
1349    *       Default value: <js>"100"</js>
1350    *    <li>
1351    *       Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
1352    *    <li>
1353    *       A default global value can be set via the system property <js>"BeanTraverseContext.maxDepth.i"</js>.
1354    * </ul>
1355    *
1356    * <ul class='seealso'>
1357    *    <li class='jf'>{@link BeanTraverseContext#BEANTRAVERSE_maxDepth}
1358    * </ul>
1359    */
1360   String maxDepth() default "";
1361}