001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.juneau.commons.bean; 018 019import static java.lang.annotation.ElementType.*; 020import static java.lang.annotation.RetentionPolicy.*; 021 022import java.io.*; 023import java.lang.annotation.*; 024import java.lang.reflect.*; 025 026/** 027 * Annotation for specifying bean-modeling config properties on REST classes and methods. 028 * 029 * <p> 030 * The bean-modeling sibling of {@code @MarshalledConfig}. 031 * Where {@code @MarshalledConfig} (in <c>juneau-marshall</c>) carries the marshalling-only attributes 032 * (such as {@code dictionary}, {@code swaps}, {@code typePropertyName}, {@code locale}, {@code mediaType}, 033 * and {@code timeZone}), this annotation carries the attributes that describe how the bean MODEL is 034 * detected and introspected — visibility settings, required-properties toggles, fluent-setter detection, 035 * property naming, not-bean exclusions, etc. 036 * 037 * <p> 038 * Splitting the annotations lets a class/method participate in bean-modeling configuration without 039 * dragging in any marshalling concerns, and lets the bean-modeling layer live in <c>juneau-commons</c> 040 * independent of <c>juneau-marshall</c>. 041 * 042 * <p> 043 * Can be used in the following locations: 044 * <ul> 045 * <li>Classes and methods (typically REST classes/methods). 046 * </ul> 047 */ 048@Documented 049@Target({ TYPE, METHOD }) 050@Retention(RUNTIME) 051@Inherited 052@SuppressWarnings({ 053 "java:S100" // Annotation methods use underscore suffix to avoid Java keyword conflicts 054}) 055public @interface BeanConfig { 056 057 /** 058 * Minimum bean class visibility. 059 * 060 * <p> 061 * Classes are not considered beans unless they meet the minimum visibility requirements. 062 * 063 * <p> 064 * For example, if the visibility is <c>PUBLIC</c> and the bean class is <jk>protected</jk>, then the class 065 * will not be interpreted as a bean class and be serialized as a string. 066 * <br>Use this setting to reduce the visibility requirement. 067 * 068 * <ul class='values'> 069 * <li><js>"PUBLIC"</js> (default) 070 * <li><js>"PROTECTED"</js> 071 * <li><js>"DEFAULT"</js> 072 * <li><js>"PRIVATE"</js> 073 * </ul> 074 * 075 * <h5 class='section'>Notes:</h5><ul> 076 * <li class='note'> 077 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 078 * </ul> 079 * 080 * @return The annotation value. 081 */ 082 String beanClassVisibility() default ""; 083 084 /** 085 * Minimum bean constructor visibility. 086 * 087 * <p> 088 * Only look for constructors with the specified minimum visibility. 089 * 090 * <p> 091 * This setting affects the logic for finding no-arg constructors for bean. 092 * <br>Normally, only <jk>public</jk> no-arg constructors are used. 093 * <br>Use this setting if you want to reduce the visibility requirement. 094 * 095 * <ul class='values'> 096 * <li><js>"PUBLIC"</js> (default) 097 * <li><js>"PROTECTED"</js> 098 * <li><js>"DEFAULT"</js> 099 * <li><js>"PRIVATE"</js> 100 * </ul> 101 * 102 * <h5 class='section'>Notes:</h5><ul> 103 * <li class='note'> 104 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 105 * </ul> 106 * 107 * @return The annotation value. 108 */ 109 String beanConstructorVisibility() default ""; 110 111 /** 112 * Minimum bean field visibility. 113 * 114 * <p> 115 * Only look for bean fields with the specified minimum visibility. 116 * 117 * <p> 118 * This affects which fields on a bean class are considered bean properties. 119 * <br>Normally only <jk>public</jk> fields are considered. 120 * <br>Use this setting if you want to reduce the visibility requirement. 121 * 122 * <ul class='values'> 123 * <li><js>"PUBLIC"</js> (default) 124 * <li><js>"PROTECTED"</js> 125 * <li><js>"DEFAULT"</js> 126 * <li><js>"PRIVATE"</js> 127 * </ul> 128 * 129 * <h5 class='section'>Notes:</h5><ul> 130 * <li class='note'> 131 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 132 * </ul> 133 * 134 * @return The annotation value. 135 */ 136 String beanFieldVisibility() default ""; 137 138 /** 139 * BeanMap.put() returns old property value. 140 * 141 * <p> 142 * If <js>"true"</js>, then the {@code BeanMap.put()} method will return old property values. 143 * <br>Otherwise, it returns <jk>null</jk>. 144 * 145 * <ul class='values'> 146 * <li><js>"true"</js> 147 * <li><js>"false"</js> (default because it introduces a slight performance penalty during serialization) 148 * </ul> 149 * 150 * <h5 class='section'>Notes:</h5><ul> 151 * <li class='note'> 152 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 153 * </ul> 154 * 155 * @return The annotation value. 156 */ 157 String beanMapPutReturnsOldValue() default ""; 158 159 /** 160 * Minimum bean method visibility. 161 * 162 * <p> 163 * Only look for bean methods with the specified minimum visibility. 164 * 165 * <p> 166 * This affects which methods are detected as getters and setters on a bean class. 167 * <br>Normally only <jk>public</jk> getters and setters are considered. 168 * <br>Use this setting if you want to reduce the visibility requirement. 169 * 170 * <ul class='values'> 171 * <li><js>"PUBLIC"</js> (default) 172 * <li><js>"PROTECTED"</js> 173 * <li><js>"DEFAULT"</js> 174 * <li><js>"PRIVATE"</js> 175 * </ul> 176 * 177 * <h5 class='section'>Notes:</h5><ul> 178 * <li class='note'> 179 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 180 * </ul> 181 * 182 * @return The annotation value. 183 */ 184 String beanMethodVisibility() default ""; 185 186 /** 187 * Beans require no-arg constructors. 188 * 189 * <p> 190 * If <js>"true"</js>, a Java class must implement a default no-arg constructor to be considered a bean. 191 * <br>Otherwise, the bean will be serialized as a string using the {@link Object#toString()} method. 192 * 193 * <ul class='values'> 194 * <li><js>"true"</js> 195 * <li><js>"false"</js> (default) 196 * </ul> 197 * 198 * <h5 class='section'>Notes:</h5><ul> 199 * <li class='note'> 200 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 201 * </ul> 202 * 203 * @return The annotation value. 204 */ 205 String beansRequireDefaultConstructor() default ""; 206 207 /** 208 * Beans require Serializable interface. 209 * 210 * <p> 211 * If <js>"true"</js>, a Java class must implement the {@link Serializable} interface to be considered a bean. 212 * <br>Otherwise, the bean will be serialized as a string using the {@link Object#toString()} method. 213 * 214 * <ul class='values'> 215 * <li><js>"true"</js> 216 * <li><js>"false"</js> (default) 217 * </ul> 218 * 219 * <h5 class='section'>Notes:</h5><ul> 220 * <li class='note'> 221 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 222 * </ul> 223 * 224 * @return The annotation value. 225 */ 226 String beansRequireSerializable() default ""; 227 228 /** 229 * Beans require setters for getters. 230 * 231 * <p> 232 * If <js>"true"</js>, only getters that have equivalent setters will be considered as properties on a bean. 233 * <br>Otherwise, they will be ignored. 234 * 235 * <ul class='values'> 236 * <li><js>"true"</js> 237 * <li><js>"false"</js> (default) 238 * </ul> 239 * 240 * <h5 class='section'>Notes:</h5><ul> 241 * <li class='note'> 242 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 243 * </ul> 244 * 245 * @return The annotation value. 246 */ 247 String beansRequireSettersForGetters() default ""; 248 249 /** 250 * Beans don't require at least one property. 251 * 252 * <p> 253 * If <js>"true"</js>, then a Java class doesn't need to contain at least 1 property to be considered a bean. 254 * <br>Otherwise, the bean will be serialized as a string using the {@link Object#toString()} method. 255 * 256 * <ul class='values'> 257 * <li><js>"true"</js> 258 * <li><js>"false"</js> (default) 259 * </ul> 260 * 261 * <h5 class='section'>Notes:</h5><ul> 262 * <li class='note'> 263 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 264 * </ul> 265 * 266 * @return The annotation value. 267 */ 268 String disableBeansRequireSomeProperties() default ""; 269 270 /** 271 * Don't silently ignore missing setters. 272 * 273 * <p> 274 * If <js>"true"</js>, trying to set a value on a bean property without a setter will throw a {@code BeanRuntimeException}. 275 * <br>Otherwise it will be sliently ignored. 276 * 277 * <ul class='values'> 278 * <li><js>"true"</js> 279 * <li><js>"false"</js> (default) 280 * </ul> 281 * 282 * <h5 class='section'>Notes:</h5><ul> 283 * <li class='note'> 284 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 285 * </ul> 286 * 287 * @return The annotation value. 288 */ 289 String disableIgnoreMissingSetters() default ""; 290 291 /** 292 * Don't ignore transient fields. 293 * 294 * <p> 295 * If <jk>true</jk>, methods and fields marked as <jk>transient</jk> will not be ignored as bean properties. 296 * 297 * <ul class='values'> 298 * <li><js>"true"</js> 299 * <li><js>"false"</js> (default) 300 * </ul> 301 * 302 * <h5 class='section'>Notes:</h5><ul> 303 * <li class='note'> 304 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 305 * </ul> 306 * 307 * @return The annotation value. 308 */ 309 String disableIgnoreTransientFields() default ""; 310 311 /** 312 * Don't ignore unknown properties with null values. 313 * 314 * <p> 315 * If <js>"true"</js>, trying to set a <jk>null</jk> value on a non-existent bean property will throw a {@code BeanRuntimeException}. 316 * Otherwise it will be silently ignored. 317 * 318 * <ul class='values'> 319 * <li><js>"true"</js> 320 * <li><js>"false"</js> (default) 321 * </ul> 322 * 323 * <h5 class='section'>Notes:</h5><ul> 324 * <li class='note'> 325 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 326 * </ul> 327 * 328 * @return The annotation value. 329 */ 330 String disableIgnoreUnknownNullBeanProperties() default ""; 331 332 /** 333 * Don't use interface proxies. 334 * 335 * <p> 336 * Disables the feature where interfaces will be instantiated as proxy classes through the use of an 337 * {@link InvocationHandler} if there is no other way of instantiating them. 338 * <br>Setting this to <js>"true"</js> causes this to be a {@link org.apache.juneau.commons.reflect.BeanRuntimeException}. 339 * 340 * <ul class='values'> 341 * <li><js>"true"</js> 342 * <li><js>"false"</js> (default) 343 * </ul> 344 * 345 * <h5 class='section'>Notes:</h5><ul> 346 * <li class='note'> 347 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 348 * </ul> 349 * 350 * @return The annotation value. 351 */ 352 String disableInterfaceProxies() default ""; 353 354 /** 355 * Find fluent setters. 356 * 357 * <p> 358 * When enabled, fluent setters are detected on beans. 359 * 360 * <p> 361 * Fluent setters must have the following attributes: 362 * <ul> 363 * <li>Public. 364 * <li>Not static. 365 * <li>Take in one parameter. 366 * <li>Return the bean itself. 367 * </ul> 368 * 369 * <ul class='values'> 370 * <li><js>"true"</js> 371 * <li><js>"false"</js> (default) 372 * </ul> 373 * 374 * <h5 class='section'>Notes:</h5><ul> 375 * <li class='note'> 376 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 377 * </ul> 378 * 379 * <h5 class='section'>See Also:</h5><ul> 380 * <li class='ja'>{@link BeanType#findFluentSetters()} 381 * </ul> 382 * 383 * @return The annotation value. 384 */ 385 String findFluentSetters() default ""; 386 387 /** 388 * Ignore invocation errors on getters. 389 * 390 * <p> 391 * If <js>"true"</js>, errors thrown when calling bean getter methods will silently be ignored. 392 * <br>Otherwise, a {@code BeanRuntimeException} is thrown. 393 * 394 * <ul class='values'> 395 * <li><js>"true"</js> 396 * <li><js>"false"</js> (default) 397 * </ul> 398 * 399 * <h5 class='section'>Notes:</h5><ul> 400 * <li class='note'> 401 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 402 * </ul> 403 * 404 * @return The annotation value. 405 */ 406 String ignoreInvocationExceptionsOnGetters() default ""; 407 408 /** 409 * Ignore invocation errors on setters. 410 * 411 * <p> 412 * If <js>"true"</js>, errors thrown when calling bean setter methods will silently be ignored. 413 * <br>Otherwise, a {@code BeanRuntimeException} is thrown. 414 * 415 * <ul class='values'> 416 * <li><js>"true"</js> 417 * <li><js>"false"</js> (default) 418 * </ul> 419 * 420 * <h5 class='section'>Notes:</h5><ul> 421 * <li class='note'> 422 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 423 * </ul> 424 * 425 * @return The annotation value. 426 */ 427 String ignoreInvocationExceptionsOnSetters() default ""; 428 429 /** 430 * Ignore unknown properties. 431 * 432 * <p> 433 * If <js>"true"</js>, trying to set a value on a non-existent bean property will silently be ignored. 434 * <br>Otherwise, a {@code RuntimeException} is thrown. 435 * 436 * <ul class='values'> 437 * <li><js>"true"</js> 438 * <li><js>"false"</js> (default) 439 * </ul> 440 * 441 * <h5 class='section'>Notes:</h5><ul> 442 * <li class='note'> 443 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 444 * </ul> 445 * 446 * @return The annotation value. 447 */ 448 String ignoreUnknownBeanProperties() default ""; 449 450 /** 451 * Schema validation mode. 452 * 453 * <p> 454 * If <js>"true"</js>, bean property values are validated against the constraints declared by 455 * {@link org.apache.juneau.commons.Schema @Schema} annotations on those properties. Validation runs 456 * during both <b>parsing</b> (value set on the bean) and <b>serialization</b> (value read from the bean). 457 * 458 * <p> 459 * Backed by the typed {@code JsonSchema} bean in {@code juneau-bean-jsonschema} and JSON Schema Draft 2020-12 460 * semantics. Validation failures throw 461 * {@link org.apache.juneau.commons.httppart.SchemaValidationException} wrapped in {@code BeanRuntimeException}; 462 * the parser surfaces them as parse exceptions and the serializer surfaces them as serialize exceptions. 463 * 464 * <p> 465 * If {@code juneau-bean-jsonschema} is not on the classpath, this setting becomes a silent no-op. 466 * 467 * <ul class='values'> 468 * <li><js>"true"</js> 469 * <li><js>"false"</js> (default) 470 * </ul> 471 * 472 * <h5 class='section'>Notes:</h5><ul> 473 * <li class='note'> 474 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 475 * </ul> 476 * 477 * @return The annotation value. 478 * @since 10.0.0 479 */ 480 String validateSchema() default ""; 481 482 /** 483 * Ignore unknown enum values. 484 * 485 * <p> 486 * If <js>"true"</js>, unknown enum values are set to <jk>null</jk> instead of throwing an exception. 487 * 488 * <ul class='values'> 489 * <li><js>"true"</js> 490 * <li><js>"false"</js> (default) 491 * </ul> 492 * 493 * <h5 class='section'>Notes:</h5><ul> 494 * <li class='note'> 495 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 496 * </ul> 497 * 498 * @return The annotation value. 499 */ 500 String ignoreUnknownEnumValues() default ""; 501 502 /** 503 * Identifies a set of interfaces. 504 * 505 * <p> 506 * When specified, only the list of properties defined on the interface class will be used during serialization 507 * of implementation classes. Additional properties on subclasses will be ignored. 508 * 509 * <p class='bjava'> 510 * <jc>// Parent class or interface</jc> 511 * <jk>public abstract class</jk> A { 512 * <jk>public</jk> String <jf>foo</jf> = <js>"foo"</js>; 513 * } 514 * 515 * <jc>// Sub class</jc> 516 * <jk>public class</jk> A1 <jk>extends</jk> A { 517 * <jk>public</jk> String <jf>bar</jf> = <js>"bar"</js>; 518 * } 519 * 520 * <jc>// Apply it to a config</jc> 521 * <ja>@BeanConfig</ja>( 522 * interfaces={ 523 * A.<jk>class</jk> 524 * } 525 * ) 526 * </p> 527 * 528 * <p> 529 * This annotation can be used on the parent class so that it filters to all child classes, or can be set 530 * individually on the child classes. 531 * 532 * <h5 class='section'>Notes:</h5><ul> 533 * <li class='note'>The {@link BeanType#interfaceClass() @BeanType(interfaceClass)} annotation is the equivalent annotation-based solution. 534 * </ul> 535 * 536 * @return The annotation value. 537 */ 538 Class<?>[] interfaces() default {}; 539 540 /** 541 * Bean class exclusions. 542 * 543 * <p> 544 * List of classes that should not be treated as beans even if they appear to be bean-like. 545 * <br>Not-bean classes are converted to <c>Strings</c> during serialization. 546 * 547 * <h5 class='section'>Notes:</h5><ul> 548 * <li class='note'> 549 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 550 * </ul> 551 * 552 * @return The annotation value. 553 */ 554 Class<?>[] notBeanClasses() default {}; 555 556 /** 557 * Replace classes that should not be considered beans. 558 * 559 * <p> 560 * Same as {@link #notBeanClasses()} but replaces any existing value. 561 * 562 * @return The annotation value. 563 */ 564 Class<?>[] notBeanClasses_replace() default {}; 565 566 /** 567 * Bean package exclusions. 568 * 569 * <p> 570 * When specified, the current list of ignore packages are appended to. 571 * 572 * <p> 573 * Any classes within these packages will be serialized to strings using {@link Object#toString()}. 574 * 575 * <p> 576 * Note that you can specify suffix patterns to include all subpackages. 577 * 578 * <h5 class='section'>Notes:</h5><ul> 579 * <li class='note'> 580 * The default value excludes the following packages: 581 * <ul class='compact'> 582 * <li class='jp'><c>java.lang</c> 583 * <li class='jp'><c>java.lang.annotation</c> 584 * <li class='jp'><c>java.lang.ref</c> 585 * <li class='jp'><c>java.lang.reflect</c> 586 * <li class='jp'><c>java.io</c> 587 * <li class='jp'><c>java.net</c> 588 * <li class='jp'><c>java.nio.*</c> 589 * <li class='jp'><c>java.util.*</c> 590 * </ul> 591 * <li class='note'> 592 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 593 * </ul> 594 * 595 * @return The annotation value. 596 */ 597 String[] notBeanPackages() default {}; 598 599 /** 600 * Replace packages whose classes should not be considered beans. 601 * 602 * <p> 603 * Same as {@link #notBeanPackages()} but replaces any existing value. 604 * 605 * @return The annotation value. 606 */ 607 String[] notBeanPackages_replace() default {}; 608 609 /** 610 * Bean property namer. 611 * 612 * <p> 613 * The class to use for calculating bean property names. 614 * 615 * <p> 616 * Predefined classes: 617 * <ul> 618 * <li>{@link BasicPropertyNamer} (default) 619 * <li>{@link PropertyNamerDLC} - Dashed-lower-case names. 620 * <li>{@link PropertyNamerULC} - Dashed-upper-case names. 621 * </ul> 622 * 623 * @return The annotation value. 624 */ 625 Class<? extends PropertyNamer> propertyNamer() default PropertyNamer.Void.class; 626 627 /** 628 * Optional rank for this config. 629 * 630 * <p> 631 * Can be used to override default ordering and application of config annotations. 632 * 633 * @return The annotation value. 634 */ 635 int rank() default 0; 636 637 /** 638 * Disable sorted bean properties. 639 * 640 * <p> 641 * When <jk>true</jk>, bean properties are serialized and accessed in declaration order instead of the default 642 * alphabetical order: record component order for records, field declaration order (superclass first) for other 643 * classes, then method-only properties alphabetically. 644 * 645 * <ul class='values'> 646 * <li><js>"true"</js> 647 * <li><js>"false"</js> (default — properties are sorted alphabetically) 648 * </ul> 649 * 650 * <h5 class='section'>Notes:</h5><ul> 651 * <li> 652 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 653 * </ul> 654 * 655 * @return The annotation value. 656 */ 657 String unsortedProperties() default ""; 658 659 /** 660 * Record component order. 661 * 662 * <p> 663 * When <jk>true</jk>, the properties of {@link Record} beans use record component (declaration) order even when 664 * other beans are sorted alphabetically. Non-record beans are unaffected. 665 * 666 * <h5 class='section'>Example:</h5> 667 * <p class='bjava'> 668 * <ja>@BeanConfig</ja>(recordComponentOrder=<js>"true"</js>) 669 * <jk>public class</jk> MyRestResource { ... } 670 * 671 * <jk>public record</jk> Person(String <jv>name</jv>, <jk>int</jk> <jv>age</jv>) {} 672 * <jc>// Serialized as {"name":"Alice","age":30} instead of {"age":30,"name":"Alice"}</jc> 673 * </p> 674 * 675 * <ul class='values'> 676 * <li><js>"true"</js> 677 * <li><js>"false"</js> (default: record properties are sorted alphabetically like other beans) 678 * </ul> 679 * 680 * <h5 class='section'>Notes:</h5><ul> 681 * <li> 682 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 683 * </ul> 684 * 685 * @return The annotation value. 686 */ 687 String recordComponentOrder() default ""; 688 689 /** 690 * Use Java Introspector. 691 * 692 * <p> 693 * Using the built-in Java bean introspector will not pick up fields or non-standard getters/setters. 694 * <br>Most {@link BeanType @BeanType} annotations will be ignored. 695 * 696 * <ul class='values'> 697 * <li><js>"true"</js> 698 * <li><js>"false"</js> (default) 699 * </ul> 700 * 701 * <h5 class='section'>Notes:</h5><ul> 702 * <li class='note'> 703 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>). 704 * </ul> 705 * 706 * @return The annotation value. 707 */ 708 String useJavaBeanIntrospector() default ""; 709}