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; 014 015import static org.apache.juneau.BeanContext.*; 016 017import java.io.*; 018import java.lang.reflect.*; 019import java.util.*; 020 021import org.apache.juneau.annotation.*; 022import org.apache.juneau.http.*; 023import org.apache.juneau.serializer.*; 024import org.apache.juneau.transform.*; 025 026/** 027 * Builder class for building instances of serializers, parsers, and bean contexts. 028 * 029 * <p> 030 * All serializers and parsers extend from this class. 031 * 032 * <p> 033 * Provides a base set of common config property setters that allow you to build up serializers and parsers. 034 * 035 * <p class='bcode w800'> 036 * WriterSerializer s = JsonSerializer 037 * .<jsm>create</jsm>() 038 * .set(<jsf>JSON_simpleMode</jsf>, <jk>true</jk>) 039 * .set(<jsf>SERIALIZER_useWhitespace</jsf>, <jk>true</jk>) 040 * .set(<jsf>SERIALIZER_quoteChar</jsf>, <js>"'"</js>) 041 * .build(); 042 * </p> 043 * 044 * <p> 045 * Additional convenience methods are provided for setting properties using reduced syntax. 046 * 047 * <p class='bcode w800'> 048 * WriterSerializer s = JsonSerializer 049 * .<jsm>create</jsm>() <jc>// Create a JsonSerializerBuilder</jc> 050 * .simple() <jc>// Simple mode</jc> 051 * .ws() <jc>// Use whitespace</jc> 052 * .sq() <jc>// Use single quotes </jc> 053 * .build(); <jc>// Create a JsonSerializer</jc> 054 * </p> 055 * 056 * <h5 class='section'>See Also:</h5> 057 * <ul> 058 * <li class='link'>{@doc juneau-marshall.ConfigurableProperties} 059 * </ul> 060 */ 061public class BeanContextBuilder extends ContextBuilder { 062 063 /** 064 * Constructor. 065 * 066 * All default settings. 067 */ 068 public BeanContextBuilder() { 069 super(); 070 } 071 072 /** 073 * Constructor. 074 * 075 * @param ps The initial configuration settings for this builder. 076 */ 077 public BeanContextBuilder(PropertyStore ps) { 078 super(ps); 079 } 080 081 @Override /* ContextBuilder */ 082 public BeanContext build() { 083 return build(BeanContext.class); 084 } 085 086 //----------------------------------------------------------------------------------------------------------------- 087 // Properties 088 //----------------------------------------------------------------------------------------------------------------- 089 090 /** 091 * Configuration property: Minimum bean class visibility. 092 * 093 * <p> 094 * Classes are not considered beans unless they meet the minimum visibility requirements. 095 * 096 * <p> 097 * For example, if the visibility is <code>PUBLIC</code> and the bean class is <jk>protected</jk>, then the class 098 * will not be interpreted as a bean class and will be treated as a string. 099 * 100 * <h5 class='section'>See Also:</h5> 101 * <ul> 102 * <li class='jf'>{@link BeanContext#BEAN_beanClassVisibility} 103 * </ul> 104 * 105 * @param value 106 * The new value for this property. 107 * <br>The default is {@link Visibility#PUBLIC}. 108 * @return This object (for method chaining). 109 */ 110 public BeanContextBuilder beanClassVisibility(Visibility value) { 111 return set(BEAN_beanClassVisibility, value); 112 } 113 114 /** 115 * Configuration property: Minimum bean constructor visibility. 116 * 117 * <p> 118 * Only look for constructors with the specified minimum visibility. 119 * 120 * <h5 class='section'>See Also:</h5> 121 * <ul> 122 * <li class='jf'>{@link BeanContext#BEAN_beanConstructorVisibility} 123 * </ul> 124 * 125 * @param value 126 * The new value for this property. 127 * <br>The default is {@link Visibility#PUBLIC}. 128 * @return This object (for method chaining). 129 */ 130 public BeanContextBuilder beanConstructorVisibility(Visibility value) { 131 return set(BEAN_beanConstructorVisibility, value); 132 } 133 134 /** 135 * Configuration property: Bean dictionary. 136 * 137 * <p> 138 * Adds to the list of classes that make up the bean dictionary in this bean context. 139 * 140 * <h5 class='section'>See Also:</h5> 141 * <ul> 142 * <li class='jf'>{@link BeanContext#BEAN_beanDictionary} 143 * </ul> 144 * 145 * @param values 146 * The values to add to this property. 147 * @return This object (for method chaining). 148 */ 149 public BeanContextBuilder beanDictionary(Object...values) { 150 return addTo(BEAN_beanDictionary, values); 151 } 152 153 /** 154 * Configuration property: Bean dictionary. 155 * 156 * <p> 157 * Same as {@link #beanDictionary(Object...)} but takes in an array of classes. 158 * 159 * <h5 class='section'>See Also:</h5> 160 * <ul> 161 * <li class='jf'>{@link BeanContext#BEAN_beanDictionary} 162 * </ul> 163 * 164 * @param values 165 * The values to add to this property. 166 * @return This object (for method chaining). 167 */ 168 public BeanContextBuilder beanDictionary(Class<?>...values) { 169 return addTo(BEAN_beanDictionary, values); 170 } 171 172 /** 173 * Configuration property: Bean dictionary. 174 * 175 * <p> 176 * Same as {@link #beanDictionary(Object...)} but allows you to optionally overwrite the previous value. 177 * 178 * <h5 class='section'>See Also:</h5> 179 * <ul> 180 * <li class='jf'>{@link BeanContext#BEAN_beanDictionary} 181 * </ul> 182 * 183 * @param append 184 * If <jk>true</jk>, the previous value is appended to. Otherwise, the previous value is replaced. 185 * @param values 186 * The new values for this property. 187 * @return This object (for method chaining). 188 */ 189 public BeanContextBuilder beanDictionary(boolean append, Object...values) { 190 return set(append, BEAN_beanDictionary, values); 191 } 192 193 /** 194 * Configuration property: Bean dictionary. 195 * 196 * <p> 197 * Removes from the list of classes that make up the bean dictionary in this bean context. 198 * 199 * <h5 class='section'>See Also:</h5> 200 * <ul> 201 * <li class='jf'>{@link BeanContext#BEAN_beanDictionary} 202 * </ul> 203 * 204 * @param values 205 * The values to remove from this property. 206 * @return This object (for method chaining). 207 */ 208 public BeanContextBuilder beanDictionaryRemove(Object...values) { 209 return removeFrom(BEAN_beanDictionary, values); 210 } 211 212 /** 213 * Configuration property: Minimum bean field visibility. 214 * 215 * <p> 216 * Only look for bean fields with the specified minimum visibility. 217 * 218 * <h5 class='section'>See Also:</h5> 219 * <ul> 220 * <li class='jf'>{@link BeanContext#BEAN_beanFieldVisibility} 221 * </ul> 222 * 223 * @param value 224 * The new value for this property. 225 * <br>The default is {@link Visibility#PUBLIC}. 226 * @return This object (for method chaining). 227 */ 228 public BeanContextBuilder beanFieldVisibility(Visibility value) { 229 return set(BEAN_beanFieldVisibility, value); 230 } 231 232 /** 233 * Configuration property: Bean filters. 234 * 235 * <p> 236 * This is a programmatic equivalent to the {@link Bean @Bean} annotation. 237 * <br>It's useful when you want to use the Bean annotation functionality, but you don't have the ability to alter 238 * the bean classes. 239 * 240 * <h5 class='section'>See Also:</h5> 241 * <ul> 242 * <li class='jf'>{@link BeanContext#BEAN_beanFilters} 243 * </ul> 244 * 245 * @param values 246 * The values to add to this property. 247 * <br>Values can consist of any of the following types: 248 * <ul> 249 * <li>Any bean class that specifies a value for {@link Bean#typeName() @Bean(typeName)}. 250 * <li>Any subclass of {@link BeanDictionaryList} containing a collection of bean classes with type name annotations. 251 * <li>Any subclass of {@link BeanDictionaryMap} containing a mapping of type names to classes without type name annotations. 252 * <li>Any array or collection of the objects above. 253 * </ul> 254 * @return This object (for method chaining). 255 */ 256 public BeanContextBuilder beanFilters(Object...values) { 257 return addTo(BEAN_beanFilters, values); 258 } 259 260 /** 261 * Configuration property: Bean filters. 262 * 263 * <p> 264 * Same as {@link #beanFilters(Object...)} but takes in an array of classes. 265 * 266 * <h5 class='section'>See Also:</h5> 267 * <ul> 268 * <li class='jf'>{@link BeanContext#BEAN_beanFilters} 269 * </ul> 270 * 271 * @param values 272 * The values to add to this property. 273 * @return This object (for method chaining). 274 */ 275 public BeanContextBuilder beanFilters(Class<?>...values) { 276 return addTo(BEAN_beanFilters, values); 277 } 278 279 /** 280 * Configuration property: Bean filters. 281 * 282 * <p> 283 * Same as {@link #beanFilters(Object...)} but allows you to optionally overwrite the previous value. 284 * 285 * <h5 class='section'>See Also:</h5> 286 * <ul> 287 * <li class='jf'>{@link BeanContext#BEAN_beanFilters} 288 * </ul> 289 * 290 * @param append 291 * If <jk>true</jk>, the previous value is appended to. Otherwise, the previous value is replaced. 292 * @param values 293 * The new values for this property. 294 * <br>Values can consist of any of the following types: 295 * <ul> 296 * <li>Any bean class that specifies a value for {@link Bean#typeName() @Bean(typeName)}. 297 * <li>Any subclass of {@link BeanDictionaryList} containing a collection of bean classes with type name annotations. 298 * <li>Any subclass of {@link BeanDictionaryMap} containing a mapping of type names to classes without type name annotations. 299 * <li>Any array or collection of the objects above. 300 * </ul> 301 * @return This object (for method chaining). 302 */ 303 public BeanContextBuilder beanFilters(boolean append, Object...values) { 304 return set(append, BEAN_beanFilters, values); 305 } 306 307 /** 308 * Configuration property: Bean filters. 309 * 310 * <p> 311 * Removes from the list of classes that make up the bean filters in this bean context. 312 * 313 * <h5 class='section'>See Also:</h5> 314 * <ul> 315 * <li class='jf'>{@link BeanContext#BEAN_beanFilters} 316 * </ul> 317 * 318 * @param values 319 * The values to remove from this property. 320 * <br>Values can consist of any of the following types: 321 * <ul> 322 * <li>Any bean class that specifies a value for {@link Bean#typeName() @Bean(typeName)}. 323 * <li>Any subclass of {@link BeanDictionaryList} containing a collection of bean classes with type name annotations. 324 * <li>Any subclass of {@link BeanDictionaryMap} containing a mapping of type names to classes without type name annotations. 325 * <li>Any array or collection of the objects above. 326 * </ul> 327 * @return This object (for method chaining). 328 */ 329 public BeanContextBuilder beanFiltersRemove(Object...values) { 330 return removeFrom(BEAN_beanFilters, values); 331 } 332 333 /** 334 * Configuration property: BeanMap.put() returns old property value. 335 * 336 * <p> 337 * If <jk>true</jk>, then the {@link BeanMap#put(String,Object) BeanMap.put()} method will return old property 338 * values. 339 * <br>Otherwise, it returns <jk>null</jk>. 340 * 341 * <h5 class='section'>See Also:</h5> 342 * <ul> 343 * <li class='jf'>{@link BeanContext#BEAN_beanMapPutReturnsOldValue} 344 * </ul> 345 * 346 * @param value 347 * The new value for this property. 348 * <br>The default is <jk>false</jk>. 349 * @return This object (for method chaining). 350 */ 351 public BeanContextBuilder beanMapPutReturnsOldValue(boolean value) { 352 return set(BEAN_beanMapPutReturnsOldValue, value); 353 } 354 355 /** 356 * Configuration property: BeanMap.put() returns old property value. 357 * 358 * <p> 359 * Shortcut for calling <code>beanMapPutReturnsOldValue(<jk>true</jk>)</code>. 360 * 361 * <h5 class='section'>See Also:</h5> 362 * <ul> 363 * <li class='jf'>{@link BeanContext#BEAN_beanMapPutReturnsOldValue} 364 * </ul> 365 * 366 * @return This object (for method chaining). 367 */ 368 public BeanContextBuilder beanMapPutReturnsOldValue() { 369 return set(BEAN_beanMapPutReturnsOldValue, true); 370 } 371 372 /** 373 * Configuration property: Minimum bean method visibility. 374 * 375 * <p> 376 * Only look for bean methods with the specified minimum visibility. 377 * 378 * <h5 class='section'>See Also:</h5> 379 * <ul> 380 * <li class='jf'>{@link BeanContext#BEAN_beanMethodVisibility} 381 * </ul> 382 * 383 * @param value 384 * The new value for this property. 385 * <br>The default is {@link Visibility#PUBLIC} 386 * @return This object (for method chaining). 387 */ 388 public BeanContextBuilder beanMethodVisibility(Visibility value) { 389 return set(BEAN_beanMethodVisibility, value); 390 } 391 392 /** 393 * Configuration property: Beans require no-arg constructors. 394 * 395 * <p> 396 * If <jk>true</jk>, a Java class must implement a default no-arg constructor to be considered a bean. 397 * <br>Otherwise, the bean will be serialized as a string using the {@link Object#toString()} method. 398 * 399 * <h5 class='section'>See Also:</h5> 400 * <ul> 401 * <li class='jf'>{@link BeanContext#BEAN_beansRequireDefaultConstructor} 402 * </ul> 403 * 404 * @param value 405 * The new value for this property. 406 * <br>The default is <jk>false</jk>. 407 * @return This object (for method chaining). 408 */ 409 public BeanContextBuilder beansRequireDefaultConstructor(boolean value) { 410 return set(BEAN_beansRequireDefaultConstructor, value); 411 } 412 413 /** 414 * Configuration property: Beans require no-arg constructors. 415 * 416 * <p> 417 * Shortcut for calling <code>beansRequireDefaultConstructor(<jk>true</jk>)</code>. 418 * 419 * <h5 class='section'>See Also:</h5> 420 * <ul> 421 * <li class='jf'>{@link BeanContext#BEAN_beansRequireDefaultConstructor} 422 * </ul> 423 * 424 * @return This object (for method chaining). 425 */ 426 public BeanContextBuilder beansRequireDefaultConstructor() { 427 return set(BEAN_beansRequireDefaultConstructor, true); 428 } 429 430 /** 431 * Configuration property: Beans require Serializable interface. 432 * 433 * <p> 434 * If <jk>true</jk>, a Java class must implement the {@link Serializable} interface to be considered a bean. 435 * <br>Otherwise, the bean will be serialized as a string using the {@link Object#toString()} method. 436 * 437 * <h5 class='section'>See Also:</h5> 438 * <ul> 439 * <li class='jf'>{@link BeanContext#BEAN_beansRequireSerializable} 440 * </ul> 441 * 442 * @param value 443 * The new value for this property. 444 * <br>The default is <jk>false</jk>. 445 * @return This object (for method chaining). 446 */ 447 public BeanContextBuilder beansRequireSerializable(boolean value) { 448 return set(BEAN_beansRequireSerializable, value); 449 } 450 451 /** 452 * Configuration property: Beans require Serializable interface. 453 * 454 * <p> 455 * Shortcut for calling <code>beansRequireSerializable(<jk>true</jk>)</code>. 456 * 457 * <h5 class='section'>See Also:</h5> 458 * <ul> 459 * <li class='jf'>{@link BeanContext#BEAN_beansRequireSerializable} 460 * </ul> 461 * 462 * @return This object (for method chaining). 463 */ 464 public BeanContextBuilder beansRequireSerializable() { 465 return set(BEAN_beansRequireSerializable, true); 466 } 467 468 /** 469 * Configuration property: Beans require setters for getters. 470 * 471 * <p> 472 * If <jk>true</jk>, only getters that have equivalent setters will be considered as properties on a bean. 473 * <br>Otherwise, they will be ignored. 474 * 475 * <h5 class='section'>See Also:</h5> 476 * <ul> 477 * <li class='jf'>{@link BeanContext#BEAN_beansRequireSettersForGetters} 478 * </ul> 479 * 480 * @param value 481 * The new value for this property. 482 * <br>The default is <jk>false</jk>. 483 * @return This object (for method chaining). 484 */ 485 public BeanContextBuilder beansRequireSettersForGetters(boolean value) { 486 return set(BEAN_beansRequireSettersForGetters, value); 487 } 488 489 /** 490 * Configuration property: Beans require setters for getters. 491 * 492 * <p> 493 * Shortcut for calling <code>beansRequireSettersForGetters(<jk>true</jk>)</code>. 494 * 495 * <h5 class='section'>See Also:</h5> 496 * <ul> 497 * <li class='jf'>{@link BeanContext#BEAN_beansRequireSettersForGetters} 498 * </ul> 499 * 500 * @return This object (for method chaining). 501 */ 502 public BeanContextBuilder beansRequireSettersForGetters() { 503 return set(BEAN_beansRequireSettersForGetters, true); 504 } 505 506 /** 507 * Configuration property: Beans require at least one property. 508 * 509 * <p> 510 * If <jk>true</jk>, then a Java class must contain at least 1 property to be considered a bean. 511 * <br>Otherwise, the bean will be serialized as a string using the {@link Object#toString()} method. 512 * 513 * <h5 class='section'>See Also:</h5> 514 * <ul> 515 * <li class='jf'>{@link BeanContext#BEAN_beansRequireSomeProperties} 516 * </ul> 517 * 518 * @param value 519 * The new value for this property. 520 * <br>The default is <jk>true</jk>. 521 * @return This object (for method chaining). 522 */ 523 public BeanContextBuilder beansRequireSomeProperties(boolean value) { 524 return set(BEAN_beansRequireSomeProperties, value); 525 } 526 527 /** 528 * Configuration property: Bean type property name. 529 * 530 * <p> 531 * This specifies the name of the bean property used to store the dictionary name of a bean type so that the 532 * parser knows the data type to reconstruct. 533 * 534 * <h5 class='section'>See Also:</h5> 535 * <ul> 536 * <li class='jf'>{@link BeanContext#BEAN_beanTypePropertyName} 537 * </ul> 538 * 539 * @param value 540 * The new value for this property. 541 * <br>The default is <js>"_type"</js>. 542 * @return This object (for method chaining). 543 */ 544 public BeanContextBuilder beanTypePropertyName(String value) { 545 return set(BEAN_beanTypePropertyName, value); 546 } 547 548 /** 549 * Configuration property: Debug mode. 550 * 551 * <p> 552 * Enables the following additional information during serialization: 553 * <ul class='spaced-list'> 554 * <li> 555 * When bean getters throws exceptions, the exception includes the object stack information 556 * in order to determine how that method was invoked. 557 * <li> 558 * Enables {@link Serializer#BEANTRAVERSE_detectRecursions}. 559 * </ul> 560 * 561 * <h5 class='section'>See Also:</h5> 562 * <ul> 563 * <li class='jf'>{@link BeanContext#BEAN_debug} 564 * </ul> 565 * 566 * @param value 567 * The new value for this property. 568 * <br>The default is <jk>false</jk>. 569 * @return This object (for method chaining). 570 */ 571 public BeanContextBuilder debug(boolean value) { 572 return set(BEAN_debug, value); 573 } 574 575 /** 576 * Configuration property: Debug mode. 577 * 578 * <p> 579 * Shortcut for calling <code>debug(<jk>true</jk>)</code>. 580 * 581 * <h5 class='section'>See Also:</h5> 582 * <ul> 583 * <li class='jf'>{@link BeanContext#BEAN_debug} 584 * </ul> 585 * 586 * @return This object (for method chaining). 587 */ 588 public BeanContextBuilder debug() { 589 return set(BEAN_debug, true); 590 } 591 592 /** 593 * Configuration property: POJO example. 594 * 595 * <p> 596 * Specifies an example of the specified class. 597 * 598 * <h5 class='section'>See Also:</h5> 599 * <ul> 600 * <li class='jf'>{@link BeanContext#BEAN_examples} 601 * </ul> 602 * 603 * @param pojoClass The POJO class. 604 * @param o An instance of the POJO class used for examples. 605 * @return This object (for method chaining). 606 */ 607 public <T> BeanContextBuilder example(Class<T> pojoClass, T o) { 608 return addTo(BEAN_examples, pojoClass.getName(), o); 609 } 610 611 /** 612 * Configuration property: Bean property excludes. 613 * 614 * <p> 615 * Specifies to exclude the specified list of properties for the specified bean class. 616 * 617 * <h5 class='section'>See Also:</h5> 618 * <ul> 619 * <li class='jf'>{@link BeanContext#BEAN_excludeProperties} 620 * </ul> 621 * 622 * @param beanClass The bean class. 623 * @param properties Comma-delimited list of property names. 624 * @return This object (for method chaining). 625 */ 626 public BeanContextBuilder excludeProperties(Class<?> beanClass, String properties) { 627 return addTo(BEAN_excludeProperties, beanClass.getName(), properties); 628 } 629 630 /** 631 * Configuration property: Bean property excludes. 632 * 633 * <p> 634 * Specifies to exclude the specified list of properties for the specified bean classes. 635 * 636 * <h5 class='section'>See Also:</h5> 637 * <ul> 638 * <li class='jf'>{@link BeanContext#BEAN_excludeProperties} 639 * </ul> 640 * 641 * @param values 642 * The new value for this property. 643 * @return This object (for method chaining). 644 */ 645 public BeanContextBuilder excludeProperties(Map<String,String> values) { 646 return set(BEAN_excludeProperties, values); 647 } 648 649 /** 650 * Configuration property: Bean property excludes. 651 * 652 * <h5 class='section'>See Also:</h5> 653 * <ul> 654 * <li class='jf'>{@link BeanContext#BEAN_excludeProperties} 655 * </ul> 656 * 657 * @param beanClassName 658 * The bean class name. 659 * <br>Can be a simple name, fully-qualified name, or <js>"*"</js> for all bean classes. 660 * @param value Comma-delimited list of property names. 661 * @return This object (for method chaining). 662 */ 663 public BeanContextBuilder excludeProperties(String beanClassName, String value) { 664 return addTo(BEAN_excludeProperties, beanClassName, value); 665 } 666 667 /** 668 * Configuration property: Find fluent setters. 669 * 670 * <p> 671 * When enabled, fluent setters are detected on beans. 672 * 673 * <p> 674 * Fluent setters must have the following attributes: 675 * <ul> 676 * <li>Public. 677 * <li>Not static. 678 * <li>Take in one parameter. 679 * <li>Return the bean itself. 680 * </ul> 681 * 682 * <h5 class='section'>See Also:</h5> 683 * <ul> 684 * <li class='jf'>{@link BeanContext#BEAN_fluentSetters} 685 * </ul> 686 * 687 * @param value 688 * The new value for this property. 689 * <br>The default is <jk>false</jk>. 690 * @return This object (for method chaining). 691 */ 692 public BeanContextBuilder fluentSetters(boolean value) { 693 return set(BEAN_fluentSetters, value); 694 } 695 696 /** 697 * Configuration property: Find fluent setters. 698 * 699 * <p> 700 * Shortcut for calling <code>fluentSetters(<jk>true</jk>)</code>. 701 * 702 * <h5 class='section'>See Also:</h5> 703 * <ul> 704 * <li class='jf'>{@link BeanContext#BEAN_fluentSetters} 705 * </ul> 706 * 707 * @return This object (for method chaining). 708 */ 709 public BeanContextBuilder fluentSetters() { 710 return set(BEAN_fluentSetters, true); 711 } 712 713 /** 714 * Configuration property: Ignore invocation errors on getters. 715 * 716 * <p> 717 * If <jk>true</jk>, errors thrown when calling bean getter methods will silently be ignored. 718 * Otherwise, a {@code BeanRuntimeException} is thrown. 719 * 720 * <h5 class='section'>See Also:</h5> 721 * <ul> 722 * <li class='jf'>{@link BeanContext#BEAN_ignoreInvocationExceptionsOnGetters} 723 * </ul> 724 * 725 * @param value 726 * The new value for this property. 727 * <br>The default is <jk>false</jk>. 728 * @return This object (for method chaining). 729 */ 730 public BeanContextBuilder ignoreInvocationExceptionsOnGetters(boolean value) { 731 return set(BEAN_ignoreInvocationExceptionsOnGetters, value); 732 } 733 734 /** 735 * Configuration property: Ignore invocation errors on getters. 736 * 737 * <p> 738 * Shortcut for calling <code>ignoreInvocationExceptionsOnGetters(<jk>true</jk>)</code>. 739 * 740 * <h5 class='section'>See Also:</h5> 741 * <ul> 742 * <li class='jf'>{@link BeanContext#BEAN_ignoreInvocationExceptionsOnGetters} 743 * </ul> 744 * 745 * @return This object (for method chaining). 746 */ 747 public BeanContextBuilder ignoreInvocationExceptionsOnGetters() { 748 return set(BEAN_ignoreInvocationExceptionsOnGetters, true); 749 } 750 751 /** 752 * Configuration property: Ignore invocation errors on setters. 753 * 754 * <p> 755 * If <jk>true</jk>, errors thrown when calling bean setter methods will silently be ignored. 756 * <br>Otherwise, a {@code BeanRuntimeException} is thrown. 757 * 758 * <h5 class='section'>See Also:</h5> 759 * <ul> 760 * <li class='jf'>{@link BeanContext#BEAN_ignoreInvocationExceptionsOnSetters} 761 * </ul> 762 * 763 * @param value 764 * The new value for this property. 765 * <br>The default is <jk>false</jk>. 766 * @return This object (for method chaining). 767 */ 768 public BeanContextBuilder ignoreInvocationExceptionsOnSetters(boolean value) { 769 return set(BEAN_ignoreInvocationExceptionsOnSetters, value); 770 } 771 772 /** 773 * Configuration property: Ignore invocation errors on setters. 774 * 775 * <p> 776 * Shortcut for calling <code>ignoreInvocationExceptionsOnSetters(<jk>true</jk>)</code>. 777 * 778 * <h5 class='section'>See Also:</h5> 779 * <ul> 780 * <li class='jf'>{@link BeanContext#BEAN_ignoreInvocationExceptionsOnSetters} 781 * </ul> 782 * 783 * @return This object (for method chaining). 784 */ 785 public BeanContextBuilder ignoreInvocationExceptionsOnSetters() { 786 return set(BEAN_ignoreInvocationExceptionsOnSetters, true); 787 } 788 789 /** 790 * Configuration property: Ignore properties without setters. 791 * 792 * <p> 793 * If <jk>true</jk>, trying to set a value on a bean property without a setter will silently be ignored. 794 * <br>Otherwise, a {@code BeanRuntimeException} is thrown. 795 * 796 * <h5 class='section'>See Also:</h5> 797 * <ul> 798 * <li class='jf'>{@link BeanContext#BEAN_ignorePropertiesWithoutSetters} 799 * </ul> 800 * 801 * @param value 802 * The new value for this property. 803 * <br>The default is <jk>true</jk>. 804 * @return This object (for method chaining). 805 */ 806 public BeanContextBuilder ignorePropertiesWithoutSetters(boolean value) { 807 return set(BEAN_ignorePropertiesWithoutSetters, value); 808 } 809 810 /** 811 * Configuration property: Ignore unknown properties. 812 * 813 * <p> 814 * If <jk>true</jk>, trying to set a value on a non-existent bean property will silently be ignored. 815 * <br>Otherwise, a {@code BeanRuntimeException} is thrown. 816 * 817 * <h5 class='section'>See Also:</h5> 818 * <ul> 819 * <li class='jf'>{@link BeanContext#BEAN_ignoreUnknownBeanProperties} 820 * </ul> 821 * 822 * @param value 823 * The new value for this property. 824 * <br>The default is <jk>false</jk>. 825 * @return This object (for method chaining). 826 */ 827 public BeanContextBuilder ignoreUnknownBeanProperties(boolean value) { 828 return set(BEAN_ignoreUnknownBeanProperties, value); 829 } 830 831 /** 832 * Configuration property: Ignore unknown properties. 833 * 834 * <p> 835 * Shortcut for calling <code>ignoreUnknownBeanProperties(<jk>true</jk>)</code>. 836 * 837 * <h5 class='section'>See Also:</h5> 838 * <ul> 839 * <li class='jf'>{@link BeanContext#BEAN_ignoreUnknownBeanProperties} 840 * </ul> 841 * 842 * @return This object (for method chaining). 843 */ 844 public BeanContextBuilder ignoreUnknownBeanProperties() { 845 return set(BEAN_ignoreUnknownBeanProperties, true); 846 } 847 848 /** 849 * Configuration property: Ignore unknown properties with null values. 850 * 851 * <p> 852 * If <jk>true</jk>, trying to set a <jk>null</jk> value on a non-existent bean property will silently be ignored. 853 * <br>Otherwise, a {@code BeanRuntimeException} is thrown. 854 * 855 * <h5 class='section'>See Also:</h5> 856 * <ul> 857 * <li class='jf'>{@link BeanContext#BEAN_ignoreUnknownNullBeanProperties} 858 * </ul> 859 * 860 * @param value 861 * The new value for this property. 862 * <br>The default is <jk>true</jk>. 863 * @return This object (for method chaining). 864 */ 865 public BeanContextBuilder ignoreUnknownNullBeanProperties(boolean value) { 866 return set(BEAN_ignoreUnknownNullBeanProperties, value); 867 } 868 869 /** 870 * Configuration property: Implementation classes. 871 * 872 * <h5 class='section'>See Also:</h5> 873 * <ul> 874 * <li class='jf'>{@link BeanContext#BEAN_implClasses} 875 * </ul> 876 * 877 * @param interfaceClass The interface class. 878 * @param implClass The implementation class. 879 * @param <I> The class type of the interface. 880 * @return This object (for method chaining). 881 */ 882 public <I> BeanContextBuilder implClass(Class<I> interfaceClass, Class<? extends I> implClass) { 883 return addTo(BEAN_implClasses, interfaceClass.getName(), implClass); 884 } 885 886 /** 887 * Configuration property: Implementation classes. 888 * 889 * <p> 890 * For interfaces and abstract classes this method can be used to specify an implementation class for the 891 * interface/abstract class so that instances of the implementation class are used when instantiated (e.g. during a 892 * parse). 893 * 894 * <h5 class='section'>See Also:</h5> 895 * <ul> 896 * <li class='jf'>{@link BeanContext#BEAN_implClasses} 897 * </ul> 898 * 899 * @param values The new value for this property. 900 * @return This object (for method chaining). 901 */ 902 public BeanContextBuilder implClasses(Map<String,Class<?>> values) { 903 return set(BEAN_implClasses, values); 904 } 905 906 /** 907 * Configuration property: Bean property includes. 908 * 909 * <p> 910 * Specifies the set and order of names of properties associated with the bean class. 911 * 912 * <h5 class='section'>See Also:</h5> 913 * <ul> 914 * <li class='jf'>{@link BeanContext#BEAN_includeProperties} 915 * </ul> 916 * 917 * @param beanClass The bean class. 918 * @param value Comma-delimited list of property names. 919 * @return This object (for method chaining). 920 */ 921 public BeanContextBuilder includeProperties(Class<?> beanClass, String value) { 922 return addTo(BEAN_includeProperties, beanClass.getName(), value); 923 } 924 925 /** 926 * Configuration property: Bean property includes. 927 * 928 * <p> 929 * Specifies the set and order of names of properties associated with the bean class. 930 * 931 * <h5 class='section'>See Also:</h5> 932 * <ul> 933 * <li class='jf'>{@link BeanContext#BEAN_includeProperties} 934 * </ul> 935 * 936 * @param values The new value for this property. 937 * @return This object (for method chaining). 938 */ 939 public BeanContextBuilder includeProperties(Map<String,String> values) { 940 return set(BEAN_includeProperties, values); 941 } 942 943 /** 944 * Configuration property: Bean property includes. 945 * 946 * <p> 947 * Specifies the set and order of names of properties associated with the bean class. 948 * 949 * <h5 class='section'>See Also:</h5> 950 * <ul> 951 * <li class='jf'>{@link BeanContext#BEAN_includeProperties} 952 * </ul> 953 * 954 * @param beanClassName 955 * The bean class name. 956 * <br>Can be a simple name, fully-qualified name, or <js>"*"</js> for all beans. 957 * @param value Comma-delimited list of property names. 958 * @return This object (for method chaining). 959 */ 960 public BeanContextBuilder includeProperties(String beanClassName, String value) { 961 return addTo(BEAN_includeProperties, beanClassName, value); 962 } 963 964 /** 965 * Configuration property: Locale. 966 * 967 * <p> 968 * Specifies a default locale for serializer and parser sessions. 969 * 970 * <h5 class='section'>See Also:</h5> 971 * <ul> 972 * <li class='jf'>{@link BeanContext#BEAN_locale} 973 * </ul> 974 * 975 * @param value The new value for this property. 976 * @return This object (for method chaining). 977 */ 978 public BeanContextBuilder locale(Locale value) { 979 return set(BEAN_locale, value); 980 } 981 982 /** 983 * Configuration property: Media type. 984 * 985 * <p> 986 * Specifies a default media type value for serializer and parser sessions. 987 * 988 * <h5 class='section'>See Also:</h5> 989 * <ul> 990 * <li class='jf'>{@link BeanContext#BEAN_mediaType} 991 * </ul> 992 * 993 * @param value The new value for this property. 994 * @return This object (for method chaining). 995 */ 996 public BeanContextBuilder mediaType(MediaType value) { 997 return set(BEAN_mediaType, value); 998 } 999 1000 /** 1001 * Configuration property: Bean class exclusions. 1002 * 1003 * <p> 1004 * Not-bean classes are converted to <code>Strings</code> during serialization even if they appear to be 1005 * bean-like. 1006 * 1007 * <h5 class='section'>See Also:</h5> 1008 * <ul> 1009 * <li class='jf'>{@link BeanContext#BEAN_notBeanClasses} 1010 * </ul> 1011 * 1012 * @param append 1013 * If <jk>true</jk>, the previous value is appended to. 1014 * <br>Otherwise, the previous value is replaced. 1015 * @param values 1016 * The new value for this property. 1017 * <br>Values can consist of any of the following types: 1018 * <ul> 1019 * <li>Classes. 1020 * <li>Arrays and collections of classes. 1021 * </ul> 1022 * @return This object (for method chaining). 1023 */ 1024 public BeanContextBuilder notBeanClasses(boolean append, Object...values) { 1025 return set(append, BEAN_notBeanClasses, values); 1026 } 1027 1028 /** 1029 * Configuration property: Bean class exclusions. 1030 * 1031 * <p> 1032 * List of classes that should not be treated as beans even if they appear to be bean-like. 1033 * <br>Not-bean classes are converted to <code>Strings</code> during serialization. 1034 * 1035 * <h5 class='section'>See Also:</h5> 1036 * <ul> 1037 * <li class='jf'>{@link BeanContext#BEAN_notBeanClasses} 1038 * </ul> 1039 * 1040 * @param values The values to add to this property. 1041 * @return This object (for method chaining). 1042 */ 1043 public BeanContextBuilder notBeanClasses(Class<?>...values) { 1044 return addTo(BEAN_notBeanClasses, values); 1045 } 1046 1047 /** 1048 * Configuration property: Bean class exclusions. 1049 * 1050 * <p> 1051 * List of classes that should not be treated as beans even if they appear to be bean-like. 1052 * <br>Not-bean classes are converted to <code>Strings</code> during serialization. 1053 * 1054 * <h5 class='section'>See Also:</h5> 1055 * <ul> 1056 * <li class='jf'>{@link BeanContext#BEAN_notBeanClasses} 1057 * </ul> 1058 * 1059 * @param values 1060 * The values to add to this property. 1061 * <br>Values can consist of any of the following types: 1062 * <ul> 1063 * <li>Classes. 1064 * <li>Arrays and collections of classes. 1065 * </ul> 1066 * @return This object (for method chaining). 1067 */ 1068 public BeanContextBuilder notBeanClasses(Object...values) { 1069 return addTo(BEAN_notBeanClasses, values); 1070 } 1071 1072 /** 1073 * Configuration property: Bean class exclusions. 1074 * 1075 * <h5 class='section'>See Also:</h5> 1076 * <ul> 1077 * <li class='jf'>{@link BeanContext#BEAN_notBeanClasses} 1078 * </ul> 1079 * 1080 * @param values 1081 * The values to remove from this property. 1082 * <br>Values can consist of any of the following types: 1083 * <ul> 1084 * <li>Classes. 1085 * <li>Arrays and collections of classes. 1086 * </ul> 1087 * @return This object (for method chaining). 1088 */ 1089 public BeanContextBuilder notBeanClassesRemove(Object...values) { 1090 return removeFrom(BEAN_notBeanClasses, values); 1091 } 1092 1093 /** 1094 * Configuration property: Bean package exclusions. 1095 * 1096 * <p> 1097 * When specified, the current list of ignore packages are appended to. 1098 * 1099 * <h5 class='section'>See Also:</h5> 1100 * <ul> 1101 * <li class='jf'>{@link BeanContext#BEAN_notBeanPackages} 1102 * </ul> 1103 * 1104 * @param append 1105 * If <jk>true</jk>, the previous value is appended to. 1106 * <br>Otherwise, the previous value is replaced. 1107 * @param values 1108 * The new values for this property. 1109 * <br>Values can consist of any of the following types: 1110 * <ul> 1111 * <li>Classes. 1112 * <li>Arrays and collections of classes. 1113 * </ul> 1114 * @return This object (for method chaining). 1115 */ 1116 public BeanContextBuilder notBeanPackages(boolean append, Object...values) { 1117 return set(append, BEAN_notBeanPackages, values); 1118 } 1119 1120 /** 1121 * Configuration property: Bean package exclusions. 1122 * 1123 * <h5 class='section'>See Also:</h5> 1124 * <ul> 1125 * <li class='jf'>{@link BeanContext#BEAN_notBeanPackages} 1126 * </ul> 1127 * 1128 * @param values 1129 * The values to add to this property. 1130 * <br>Values can consist of any of the following types: 1131 * <ul> 1132 * <li>Strings. 1133 * <li>Arrays and collections of strings. 1134 * </ul> 1135 * @return This object (for method chaining). 1136 */ 1137 public BeanContextBuilder notBeanPackages(Object...values) { 1138 return addTo(BEAN_notBeanPackages, values); 1139 } 1140 1141 /** 1142 * Configuration property: Bean package exclusions. 1143 * 1144 * <h5 class='section'>See Also:</h5> 1145 * <ul> 1146 * <li class='jf'>{@link BeanContext#BEAN_notBeanPackages} 1147 * </ul> 1148 * 1149 * @param values 1150 * The values to add to this property. 1151 * @return This object (for method chaining). 1152 */ 1153 public BeanContextBuilder notBeanPackages(String...values) { 1154 return addTo(BEAN_notBeanPackages, values); 1155 } 1156 1157 /** 1158 * Configuration property: Bean package exclusions. 1159 * 1160 * <h5 class='section'>See Also:</h5> 1161 * <ul> 1162 * <li class='jf'>{@link BeanContext#BEAN_notBeanPackages} 1163 * </ul> 1164 * 1165 * @param values 1166 * <br>Values can consist of any of the following types: 1167 * <br>Possible values are: 1168 * <ul> 1169 * <li>Strings. 1170 * <li>Arrays and collections of strings. 1171 * </ul> 1172 * @return This object (for method chaining). 1173 */ 1174 public BeanContextBuilder notBeanPackagesRemove(Object...values) { 1175 return removeFrom(BEAN_notBeanPackages, values); 1176 } 1177 1178 /** 1179 * Configuration property: POJO swaps. 1180 * 1181 * <p> 1182 * POJO swaps are used to "swap out" non-serializable classes with serializable equivalents during serialization, 1183 * and "swap in" the non-serializable class during parsing. 1184 * 1185 * <p> 1186 * An example of a POJO swap would be a <code>Calendar</code> object that gets swapped out for an ISO8601 string. 1187 * 1188 * <h5 class='section'>See Also:</h5> 1189 * <ul> 1190 * <li class='jf'>{@link BeanContext#BEAN_pojoSwaps} 1191 * </ul> 1192 * 1193 * @param append 1194 * If <jk>true</jk>, the previous value is appended to. 1195 * <br>Otherwise, the previous value is replaced. 1196 * @param values 1197 * The new value for this property. 1198 * <br>Values can consist of any of the following types: 1199 * <ul> 1200 * <li>Strings. 1201 * <li>Arrays and collections of strings. 1202 * </ul> 1203 * @return This object (for method chaining). 1204 */ 1205 public BeanContextBuilder pojoSwaps(boolean append, Object...values) { 1206 return set(append, BEAN_pojoSwaps, values); 1207 } 1208 1209 /** 1210 * Configuration property: POJO swaps. 1211 * 1212 * <h5 class='section'>See Also:</h5> 1213 * <ul> 1214 * <li class='jf'>{@link BeanContext#BEAN_pojoSwaps} 1215 * </ul> 1216 * 1217 * @param values The values to add to this property. 1218 * @return This object (for method chaining). 1219 */ 1220 public BeanContextBuilder pojoSwaps(Class<?>...values) { 1221 return addTo(BEAN_pojoSwaps, values); 1222 } 1223 1224 /** 1225 * Configuration property: POJO swaps. 1226 * 1227 * <h5 class='section'>See Also:</h5> 1228 * <ul> 1229 * <li class='jf'>{@link BeanContext#BEAN_pojoSwaps} 1230 * </ul> 1231 * 1232 * @param values 1233 * The values to add to this property. 1234 * <br>Values can consist of any of the following types: 1235 * <ul> 1236 * <li>Any subclass of {@link PojoSwap}. 1237 * <li>Any surrogate class. A shortcut for defining a {@link SurrogateSwap}. 1238 * <li>Any array or collection of the objects above. 1239 * </ul> 1240 * @return This object (for method chaining). 1241 */ 1242 public BeanContextBuilder pojoSwaps(Object...values) { 1243 return addTo(BEAN_pojoSwaps, values); 1244 } 1245 1246 /** 1247 * Configuration property: POJO swaps. 1248 * 1249 * <h5 class='section'>See Also:</h5> 1250 * <ul> 1251 * <li class='jf'>{@link BeanContext#BEAN_pojoSwaps} 1252 * </ul> 1253 * 1254 * @param values 1255 * The values to remove from this property. 1256 * <br>Values can consist of any of the following types: 1257 * <ul> 1258 * <li>Any subclass of {@link PojoSwap}. 1259 * <li>Any surrogate class. A shortcut for defining a {@link SurrogateSwap}. 1260 * <li>Any array or collection of the objects above. 1261 * </ul> 1262 * @return This object (for method chaining). 1263 */ 1264 public BeanContextBuilder pojoSwapsRemove(Object...values) { 1265 return removeFrom(BEAN_pojoSwaps, values); 1266 } 1267 1268 /** 1269 * Configuration property: Bean property namer 1270 * 1271 * <p> 1272 * The class to use for calculating bean property names. 1273 * 1274 * <h5 class='section'>See Also:</h5> 1275 * <ul> 1276 * <li class='jf'>{@link BeanContext#BEAN_propertyNamer} 1277 * </ul> 1278 * 1279 * @param value 1280 * The new value for this setting. 1281 * <br>The default is {@link PropertyNamerDefault}. 1282 * @return This object (for method chaining). 1283 */ 1284 public BeanContextBuilder propertyNamer(Class<? extends PropertyNamer> value) { 1285 return set(BEAN_propertyNamer, value); 1286 } 1287 1288 /** 1289 * Configuration property: Sort bean properties. 1290 * 1291 * <p> 1292 * When <jk>true</jk>, all bean properties will be serialized and access in alphabetical order. 1293 * Otherwise, the natural order of the bean properties is used which is dependent on the JVM vendor. 1294 * 1295 * <h5 class='section'>See Also:</h5> 1296 * <ul> 1297 * <li class='jf'>{@link BeanContext#BEAN_sortProperties} 1298 * </ul> 1299 * 1300 * @param value 1301 * The new value for this property. 1302 * <br>The default is <jk>false</jk>. 1303 * @return This object (for method chaining). 1304 */ 1305 public BeanContextBuilder sortProperties(boolean value) { 1306 return set(BEAN_sortProperties, value); 1307 } 1308 1309 /** 1310 * Configuration property: Sort bean properties. 1311 * 1312 * <p> 1313 * Shortcut for calling <code>sortProperties(<jk>true</jk>)</code>. 1314 * 1315 * <h5 class='section'>See Also:</h5> 1316 * <ul> 1317 * <li class='jf'>{@link BeanContext#BEAN_sortProperties} 1318 * </ul> 1319 * 1320 * @return This object (for method chaining). 1321 */ 1322 public BeanContextBuilder sortProperties() { 1323 return set(BEAN_sortProperties, true); 1324 } 1325 1326 /** 1327 * Configuration property: TimeZone. 1328 * 1329 * <h5 class='section'>See Also:</h5> 1330 * <ul> 1331 * <li class='jf'>{@link BeanContext#BEAN_timeZone} 1332 * </ul> 1333 * 1334 * @param value The new value for this property. 1335 * @return This object (for method chaining). 1336 */ 1337 public BeanContextBuilder timeZone(TimeZone value) { 1338 return set(BEAN_timeZone, value); 1339 } 1340 1341 /** 1342 * Configuration property: Use enum names. 1343 * 1344 * <p> 1345 * When enabled, enums are always serialized by name instead of using {@link Object#toString()}. 1346 * 1347 * <h5 class='section'>See Also:</h5> 1348 * <ul> 1349 * <li class='jf'>{@link BeanContext#BEAN_useEnumNames} 1350 * </ul> 1351 * 1352 * @return This object (for method chaining). 1353 */ 1354 public BeanContextBuilder useEnumNames() { 1355 return set(BEAN_useEnumNames, true); 1356 } 1357 1358 /** 1359 * Configuration property: Use interface proxies. 1360 * 1361 * <p> 1362 * If <jk>true</jk>, then interfaces will be instantiated as proxy classes through the use of an 1363 * {@link InvocationHandler} if there is no other way of instantiating them. 1364 * 1365 * <h5 class='section'>See Also:</h5> 1366 * <ul> 1367 * <li class='jf'>{@link BeanContext#BEAN_useInterfaceProxies} 1368 * </ul> 1369 * 1370 * @param value 1371 * The new value for this property. 1372 * <br>The default is <jk>true</jk>. 1373 * @return This object (for method chaining). 1374 */ 1375 public BeanContextBuilder useInterfaceProxies(boolean value) { 1376 return set(BEAN_useInterfaceProxies, value); 1377 } 1378 1379 /** 1380 * Configuration property: Use Java Introspector. 1381 * 1382 * <p> 1383 * Using the built-in Java bean introspector will not pick up fields or non-standard getters/setters. 1384 * 1385 * <h5 class='section'>Notes:</h5> 1386 * <ul> 1387 * <li>Most {@link Bean @Bean} annotations will be ignored if you enable this setting. 1388 * </ul> 1389 * 1390 * <h5 class='section'>See Also:</h5> 1391 * <ul> 1392 * <li class='jf'>{@link BeanContext#BEAN_useJavaBeanIntrospector} 1393 * </ul> 1394 * 1395 * @param value 1396 * The new value for this property. 1397 * <br>The default is <jk>false</jk>. 1398 * @return This object (for method chaining). 1399 */ 1400 public BeanContextBuilder useJavaBeanIntrospector(boolean value) { 1401 return set(BEAN_useJavaBeanIntrospector, value); 1402 } 1403 1404 /** 1405 * Configuration property: Use Java Introspector. 1406 * 1407 * <p> 1408 * Shortcut for calling <code>useJavaBeanIntrospector(<jk>true</jk>)</code>. 1409 * 1410 * <h5 class='section'>See Also:</h5> 1411 * <ul> 1412 * <li class='jf'>{@link BeanContext#BEAN_useJavaBeanIntrospector} 1413 * </ul> 1414 * 1415 * @return This object (for method chaining). 1416 */ 1417 public BeanContextBuilder useJavaBeanIntrospector() { 1418 return set(BEAN_useJavaBeanIntrospector, true); 1419 } 1420 1421 @Override /* ContextBuilder */ 1422 public BeanContextBuilder set(String name, Object value) { 1423 super.set(name, value); 1424 return this; 1425 } 1426 1427 @Override /* ContextBuilder */ 1428 public BeanContextBuilder set(boolean append, String name, Object value) { 1429 super.set(append, name, value); 1430 return this; 1431 } 1432 1433 @Override /* ContextBuilder */ 1434 public BeanContextBuilder set(Map<String,Object> properties) { 1435 super.set(properties); 1436 return this; 1437 } 1438 1439 @Override /* ContextBuilder */ 1440 public BeanContextBuilder add(Map<String,Object> properties) { 1441 super.add(properties); 1442 return this; 1443 } 1444 1445 @Override /* ContextBuilder */ 1446 public BeanContextBuilder addTo(String name, Object value) { 1447 super.addTo(name, value); 1448 return this; 1449 } 1450 1451 @Override /* ContextBuilder */ 1452 public BeanContextBuilder addTo(String name, String key, Object value) { 1453 super.addTo(name, key, value); 1454 return this; 1455 } 1456 1457 @Override /* ContextBuilder */ 1458 public BeanContextBuilder removeFrom(String name, Object value) { 1459 super.removeFrom(name, value); 1460 return this; 1461 } 1462 1463 @Override /* ContextBuilder */ 1464 public BeanContextBuilder apply(PropertyStore copyFrom) { 1465 super.apply(copyFrom); 1466 return this; 1467 } 1468}