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.soap; 014 015import static org.apache.juneau.collections.JsonMap.*; 016 017import java.lang.annotation.*; 018import java.lang.reflect.*; 019import java.nio.charset.*; 020import java.util.*; 021import java.util.concurrent.*; 022 023import org.apache.juneau.*; 024import org.apache.juneau.collections.*; 025import org.apache.juneau.internal.*; 026import org.apache.juneau.utils.*; 027import org.apache.juneau.xml.*; 028 029/** 030 * Serializes POJOs to HTTP responses as XML+SOAP. 031 * 032 * <h5 class='topic'>Media types</h5> 033 * 034 * Handles <c>Accept</c> types: <bc>text/xml+soap</bc> 035 * <p> 036 * Produces <c>Content-Type</c> types: <bc>text/xml+soap</bc> 037 * 038 * <h5 class='topic'>Description</h5> 039 * 040 * Essentially the same output as {@link XmlDocSerializer}, except wrapped in a standard SOAP envelope. 041 * 042 * <h5 class='section'>Notes:</h5><ul> 043 * <li class='note'>This class is thread safe and reusable. 044 * </ul> 045 * 046 * <h5 class='section'>See Also:</h5><ul> 047 048 * </ul> 049 */ 050public class SoapXmlSerializer extends XmlSerializer implements SoapXmlMetaProvider { 051 052 //------------------------------------------------------------------------------------------------------------------- 053 // Static 054 //------------------------------------------------------------------------------------------------------------------- 055 056 /** 057 * Creates a new builder for this object. 058 * 059 * @return A new builder. 060 */ 061 public static Builder create() { 062 return new Builder(); 063 } 064 065 //------------------------------------------------------------------------------------------------------------------- 066 // Builder 067 //------------------------------------------------------------------------------------------------------------------- 068 069 /** 070 * Builder class. 071 */ 072 @FluentSetters 073 public static class Builder extends XmlSerializer.Builder { 074 075 private static final Cache<HashKey,SoapXmlSerializer> CACHE = Cache.of(HashKey.class, SoapXmlSerializer.class).build(); 076 077 String soapAction; 078 079 /** 080 * Constructor, default settings. 081 */ 082 protected Builder() { 083 super(); 084 produces("text/xml"); 085 accept("text/xml+soap"); 086 soapAction = "http://www.w3.org/2003/05/soap-envelope"; 087 } 088 089 /** 090 * Copy constructor. 091 * 092 * @param copyFrom The bean to copy from. 093 */ 094 protected Builder(SoapXmlSerializer copyFrom) { 095 super(copyFrom); 096 soapAction = copyFrom.soapAction; 097 } 098 099 /** 100 * Copy constructor. 101 * 102 * @param copyFrom The builder to copy from. 103 */ 104 protected Builder(Builder copyFrom) { 105 super(copyFrom); 106 soapAction = copyFrom.soapAction; 107 } 108 109 @Override /* Context.Builder */ 110 public Builder copy() { 111 return new Builder(this); 112 } 113 114 @Override /* Context.Builder */ 115 public SoapXmlSerializer build() { 116 return cache(CACHE).build(SoapXmlSerializer.class); 117 } 118 119 @Override /* Context.Builder */ 120 public HashKey hashKey() { 121 return HashKey.of( 122 super.hashKey(), 123 soapAction 124 ); 125 } 126 127 //----------------------------------------------------------------------------------------------------------------- 128 // Properties 129 //----------------------------------------------------------------------------------------------------------------- 130 131 /** 132 * The <c>SOAPAction</c> HTTP header value to set on responses. 133 * 134 * @param value 135 * The new value for this property. 136 * <br>The default is <js>"http://www.w3.org/2003/05/soap-envelope"</js>. 137 * @return This object. 138 */ 139 @FluentSetter 140 public Builder soapAction(String value) { 141 soapAction = value; 142 return this; 143 } 144 145 // <FluentSetters> 146 147 @Override /* GENERATED - org.apache.juneau.Context.Builder */ 148 public Builder annotations(Annotation...values) { 149 super.annotations(values); 150 return this; 151 } 152 153 @Override /* GENERATED - org.apache.juneau.Context.Builder */ 154 public Builder apply(AnnotationWorkList work) { 155 super.apply(work); 156 return this; 157 } 158 159 @Override /* GENERATED - org.apache.juneau.Context.Builder */ 160 public Builder applyAnnotations(java.lang.Class<?>...fromClasses) { 161 super.applyAnnotations(fromClasses); 162 return this; 163 } 164 165 @Override /* GENERATED - org.apache.juneau.Context.Builder */ 166 public Builder applyAnnotations(Method...fromMethods) { 167 super.applyAnnotations(fromMethods); 168 return this; 169 } 170 171 @Override /* GENERATED - org.apache.juneau.Context.Builder */ 172 public Builder cache(Cache<HashKey,? extends org.apache.juneau.Context> value) { 173 super.cache(value); 174 return this; 175 } 176 177 @Override /* GENERATED - org.apache.juneau.Context.Builder */ 178 public Builder debug() { 179 super.debug(); 180 return this; 181 } 182 183 @Override /* GENERATED - org.apache.juneau.Context.Builder */ 184 public Builder debug(boolean value) { 185 super.debug(value); 186 return this; 187 } 188 189 @Override /* GENERATED - org.apache.juneau.Context.Builder */ 190 public Builder impl(Context value) { 191 super.impl(value); 192 return this; 193 } 194 195 @Override /* GENERATED - org.apache.juneau.Context.Builder */ 196 public Builder type(Class<? extends org.apache.juneau.Context> value) { 197 super.type(value); 198 return this; 199 } 200 201 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 202 public Builder beanClassVisibility(Visibility value) { 203 super.beanClassVisibility(value); 204 return this; 205 } 206 207 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 208 public Builder beanConstructorVisibility(Visibility value) { 209 super.beanConstructorVisibility(value); 210 return this; 211 } 212 213 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 214 public Builder beanContext(BeanContext value) { 215 super.beanContext(value); 216 return this; 217 } 218 219 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 220 public Builder beanContext(BeanContext.Builder value) { 221 super.beanContext(value); 222 return this; 223 } 224 225 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 226 public Builder beanDictionary(java.lang.Class<?>...values) { 227 super.beanDictionary(values); 228 return this; 229 } 230 231 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 232 public Builder beanFieldVisibility(Visibility value) { 233 super.beanFieldVisibility(value); 234 return this; 235 } 236 237 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 238 public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.BeanInterceptor<?>> value) { 239 super.beanInterceptor(on, value); 240 return this; 241 } 242 243 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 244 public Builder beanMapPutReturnsOldValue() { 245 super.beanMapPutReturnsOldValue(); 246 return this; 247 } 248 249 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 250 public Builder beanMethodVisibility(Visibility value) { 251 super.beanMethodVisibility(value); 252 return this; 253 } 254 255 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 256 public Builder beanProperties(Map<String,Object> values) { 257 super.beanProperties(values); 258 return this; 259 } 260 261 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 262 public Builder beanProperties(Class<?> beanClass, String properties) { 263 super.beanProperties(beanClass, properties); 264 return this; 265 } 266 267 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 268 public Builder beanProperties(String beanClassName, String properties) { 269 super.beanProperties(beanClassName, properties); 270 return this; 271 } 272 273 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 274 public Builder beanPropertiesExcludes(Map<String,Object> values) { 275 super.beanPropertiesExcludes(values); 276 return this; 277 } 278 279 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 280 public Builder beanPropertiesExcludes(Class<?> beanClass, String properties) { 281 super.beanPropertiesExcludes(beanClass, properties); 282 return this; 283 } 284 285 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 286 public Builder beanPropertiesExcludes(String beanClassName, String properties) { 287 super.beanPropertiesExcludes(beanClassName, properties); 288 return this; 289 } 290 291 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 292 public Builder beanPropertiesReadOnly(Map<String,Object> values) { 293 super.beanPropertiesReadOnly(values); 294 return this; 295 } 296 297 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 298 public Builder beanPropertiesReadOnly(Class<?> beanClass, String properties) { 299 super.beanPropertiesReadOnly(beanClass, properties); 300 return this; 301 } 302 303 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 304 public Builder beanPropertiesReadOnly(String beanClassName, String properties) { 305 super.beanPropertiesReadOnly(beanClassName, properties); 306 return this; 307 } 308 309 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 310 public Builder beanPropertiesWriteOnly(Map<String,Object> values) { 311 super.beanPropertiesWriteOnly(values); 312 return this; 313 } 314 315 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 316 public Builder beanPropertiesWriteOnly(Class<?> beanClass, String properties) { 317 super.beanPropertiesWriteOnly(beanClass, properties); 318 return this; 319 } 320 321 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 322 public Builder beanPropertiesWriteOnly(String beanClassName, String properties) { 323 super.beanPropertiesWriteOnly(beanClassName, properties); 324 return this; 325 } 326 327 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 328 public Builder beansRequireDefaultConstructor() { 329 super.beansRequireDefaultConstructor(); 330 return this; 331 } 332 333 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 334 public Builder beansRequireSerializable() { 335 super.beansRequireSerializable(); 336 return this; 337 } 338 339 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 340 public Builder beansRequireSettersForGetters() { 341 super.beansRequireSettersForGetters(); 342 return this; 343 } 344 345 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 346 public Builder dictionaryOn(Class<?> on, java.lang.Class<?>...values) { 347 super.dictionaryOn(on, values); 348 return this; 349 } 350 351 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 352 public Builder disableBeansRequireSomeProperties() { 353 super.disableBeansRequireSomeProperties(); 354 return this; 355 } 356 357 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 358 public Builder disableIgnoreMissingSetters() { 359 super.disableIgnoreMissingSetters(); 360 return this; 361 } 362 363 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 364 public Builder disableIgnoreTransientFields() { 365 super.disableIgnoreTransientFields(); 366 return this; 367 } 368 369 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 370 public Builder disableIgnoreUnknownNullBeanProperties() { 371 super.disableIgnoreUnknownNullBeanProperties(); 372 return this; 373 } 374 375 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 376 public Builder disableInterfaceProxies() { 377 super.disableInterfaceProxies(); 378 return this; 379 } 380 381 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 382 public <T> Builder example(Class<T> pojoClass, T o) { 383 super.example(pojoClass, o); 384 return this; 385 } 386 387 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 388 public <T> Builder example(Class<T> pojoClass, String json) { 389 super.example(pojoClass, json); 390 return this; 391 } 392 393 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 394 public Builder findFluentSetters() { 395 super.findFluentSetters(); 396 return this; 397 } 398 399 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 400 public Builder findFluentSetters(Class<?> on) { 401 super.findFluentSetters(on); 402 return this; 403 } 404 405 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 406 public Builder ignoreInvocationExceptionsOnGetters() { 407 super.ignoreInvocationExceptionsOnGetters(); 408 return this; 409 } 410 411 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 412 public Builder ignoreInvocationExceptionsOnSetters() { 413 super.ignoreInvocationExceptionsOnSetters(); 414 return this; 415 } 416 417 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 418 public Builder ignoreUnknownBeanProperties() { 419 super.ignoreUnknownBeanProperties(); 420 return this; 421 } 422 423 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 424 public Builder ignoreUnknownEnumValues() { 425 super.ignoreUnknownEnumValues(); 426 return this; 427 } 428 429 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 430 public Builder implClass(Class<?> interfaceClass, Class<?> implClass) { 431 super.implClass(interfaceClass, implClass); 432 return this; 433 } 434 435 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 436 public Builder implClasses(Map<Class<?>,Class<?>> values) { 437 super.implClasses(values); 438 return this; 439 } 440 441 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 442 public Builder interfaceClass(Class<?> on, Class<?> value) { 443 super.interfaceClass(on, value); 444 return this; 445 } 446 447 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 448 public Builder interfaces(java.lang.Class<?>...value) { 449 super.interfaces(value); 450 return this; 451 } 452 453 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 454 public Builder locale(Locale value) { 455 super.locale(value); 456 return this; 457 } 458 459 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 460 public Builder mediaType(MediaType value) { 461 super.mediaType(value); 462 return this; 463 } 464 465 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 466 public Builder notBeanClasses(java.lang.Class<?>...values) { 467 super.notBeanClasses(values); 468 return this; 469 } 470 471 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 472 public Builder notBeanPackages(String...values) { 473 super.notBeanPackages(values); 474 return this; 475 } 476 477 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 478 public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) { 479 super.propertyNamer(value); 480 return this; 481 } 482 483 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 484 public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) { 485 super.propertyNamer(on, value); 486 return this; 487 } 488 489 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 490 public Builder sortProperties() { 491 super.sortProperties(); 492 return this; 493 } 494 495 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 496 public Builder sortProperties(java.lang.Class<?>...on) { 497 super.sortProperties(on); 498 return this; 499 } 500 501 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 502 public Builder stopClass(Class<?> on, Class<?> value) { 503 super.stopClass(on, value); 504 return this; 505 } 506 507 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 508 public <T, S> Builder swap(Class<T> normalClass, Class<S> swappedClass, ThrowingFunction<T,S> swapFunction) { 509 super.swap(normalClass, swappedClass, swapFunction); 510 return this; 511 } 512 513 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 514 public <T, S> Builder swap(Class<T> normalClass, Class<S> swappedClass, ThrowingFunction<T,S> swapFunction, ThrowingFunction<S,T> unswapFunction) { 515 super.swap(normalClass, swappedClass, swapFunction, unswapFunction); 516 return this; 517 } 518 519 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 520 public Builder swaps(java.lang.Class<?>...values) { 521 super.swaps(values); 522 return this; 523 } 524 525 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 526 public Builder timeZone(TimeZone value) { 527 super.timeZone(value); 528 return this; 529 } 530 531 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 532 public Builder typeName(Class<?> on, String value) { 533 super.typeName(on, value); 534 return this; 535 } 536 537 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 538 public Builder typePropertyName(String value) { 539 super.typePropertyName(value); 540 return this; 541 } 542 543 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 544 public Builder typePropertyName(Class<?> on, String value) { 545 super.typePropertyName(on, value); 546 return this; 547 } 548 549 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 550 public Builder useEnumNames() { 551 super.useEnumNames(); 552 return this; 553 } 554 555 @Override /* GENERATED - org.apache.juneau.BeanContextable.Builder */ 556 public Builder useJavaBeanIntrospector() { 557 super.useJavaBeanIntrospector(); 558 return this; 559 } 560 561 @Override /* GENERATED - org.apache.juneau.BeanTraverseContext.Builder */ 562 public Builder detectRecursions() { 563 super.detectRecursions(); 564 return this; 565 } 566 567 @Override /* GENERATED - org.apache.juneau.BeanTraverseContext.Builder */ 568 public Builder detectRecursions(boolean value) { 569 super.detectRecursions(value); 570 return this; 571 } 572 573 @Override /* GENERATED - org.apache.juneau.BeanTraverseContext.Builder */ 574 public Builder ignoreRecursions() { 575 super.ignoreRecursions(); 576 return this; 577 } 578 579 @Override /* GENERATED - org.apache.juneau.BeanTraverseContext.Builder */ 580 public Builder ignoreRecursions(boolean value) { 581 super.ignoreRecursions(value); 582 return this; 583 } 584 585 @Override /* GENERATED - org.apache.juneau.BeanTraverseContext.Builder */ 586 public Builder initialDepth(int value) { 587 super.initialDepth(value); 588 return this; 589 } 590 591 @Override /* GENERATED - org.apache.juneau.BeanTraverseContext.Builder */ 592 public Builder maxDepth(int value) { 593 super.maxDepth(value); 594 return this; 595 } 596 597 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 598 public Builder accept(String value) { 599 super.accept(value); 600 return this; 601 } 602 603 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 604 public Builder addBeanTypes() { 605 super.addBeanTypes(); 606 return this; 607 } 608 609 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 610 public Builder addBeanTypes(boolean value) { 611 super.addBeanTypes(value); 612 return this; 613 } 614 615 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 616 public Builder addRootType() { 617 super.addRootType(); 618 return this; 619 } 620 621 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 622 public Builder addRootType(boolean value) { 623 super.addRootType(value); 624 return this; 625 } 626 627 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 628 public Builder keepNullProperties() { 629 super.keepNullProperties(); 630 return this; 631 } 632 633 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 634 public Builder keepNullProperties(boolean value) { 635 super.keepNullProperties(value); 636 return this; 637 } 638 639 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 640 public Builder listener(Class<? extends org.apache.juneau.serializer.SerializerListener> value) { 641 super.listener(value); 642 return this; 643 } 644 645 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 646 public Builder produces(String value) { 647 super.produces(value); 648 return this; 649 } 650 651 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 652 public Builder sortCollections() { 653 super.sortCollections(); 654 return this; 655 } 656 657 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 658 public Builder sortCollections(boolean value) { 659 super.sortCollections(value); 660 return this; 661 } 662 663 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 664 public Builder sortMaps() { 665 super.sortMaps(); 666 return this; 667 } 668 669 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 670 public Builder sortMaps(boolean value) { 671 super.sortMaps(value); 672 return this; 673 } 674 675 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 676 public Builder trimEmptyCollections() { 677 super.trimEmptyCollections(); 678 return this; 679 } 680 681 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 682 public Builder trimEmptyCollections(boolean value) { 683 super.trimEmptyCollections(value); 684 return this; 685 } 686 687 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 688 public Builder trimEmptyMaps() { 689 super.trimEmptyMaps(); 690 return this; 691 } 692 693 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 694 public Builder trimEmptyMaps(boolean value) { 695 super.trimEmptyMaps(value); 696 return this; 697 } 698 699 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 700 public Builder trimStrings() { 701 super.trimStrings(); 702 return this; 703 } 704 705 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 706 public Builder trimStrings(boolean value) { 707 super.trimStrings(value); 708 return this; 709 } 710 711 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 712 public Builder uriContext(UriContext value) { 713 super.uriContext(value); 714 return this; 715 } 716 717 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 718 public Builder uriRelativity(UriRelativity value) { 719 super.uriRelativity(value); 720 return this; 721 } 722 723 @Override /* GENERATED - org.apache.juneau.serializer.Serializer.Builder */ 724 public Builder uriResolution(UriResolution value) { 725 super.uriResolution(value); 726 return this; 727 } 728 729 @Override /* GENERATED - org.apache.juneau.serializer.WriterSerializer.Builder */ 730 public Builder fileCharset(Charset value) { 731 super.fileCharset(value); 732 return this; 733 } 734 735 @Override /* GENERATED - org.apache.juneau.serializer.WriterSerializer.Builder */ 736 public Builder maxIndent(int value) { 737 super.maxIndent(value); 738 return this; 739 } 740 741 @Override /* GENERATED - org.apache.juneau.serializer.WriterSerializer.Builder */ 742 public Builder quoteChar(char value) { 743 super.quoteChar(value); 744 return this; 745 } 746 747 @Override /* GENERATED - org.apache.juneau.serializer.WriterSerializer.Builder */ 748 public Builder quoteCharOverride(char value) { 749 super.quoteCharOverride(value); 750 return this; 751 } 752 753 @Override /* GENERATED - org.apache.juneau.serializer.WriterSerializer.Builder */ 754 public Builder sq() { 755 super.sq(); 756 return this; 757 } 758 759 @Override /* GENERATED - org.apache.juneau.serializer.WriterSerializer.Builder */ 760 public Builder streamCharset(Charset value) { 761 super.streamCharset(value); 762 return this; 763 } 764 765 @Override /* GENERATED - org.apache.juneau.serializer.WriterSerializer.Builder */ 766 public Builder useWhitespace() { 767 super.useWhitespace(); 768 return this; 769 } 770 771 @Override /* GENERATED - org.apache.juneau.serializer.WriterSerializer.Builder */ 772 public Builder useWhitespace(boolean value) { 773 super.useWhitespace(value); 774 return this; 775 } 776 777 @Override /* GENERATED - org.apache.juneau.serializer.WriterSerializer.Builder */ 778 public Builder ws() { 779 super.ws(); 780 return this; 781 } 782 783 @Override /* GENERATED - org.apache.juneau.xml.XmlSerializer.Builder */ 784 public Builder addBeanTypesXml() { 785 super.addBeanTypesXml(); 786 return this; 787 } 788 789 @Override /* GENERATED - org.apache.juneau.xml.XmlSerializer.Builder */ 790 public Builder addBeanTypesXml(boolean value) { 791 super.addBeanTypesXml(value); 792 return this; 793 } 794 795 @Override /* GENERATED - org.apache.juneau.xml.XmlSerializer.Builder */ 796 public Builder addNamespaceUrisToRoot() { 797 super.addNamespaceUrisToRoot(); 798 return this; 799 } 800 801 @Override /* GENERATED - org.apache.juneau.xml.XmlSerializer.Builder */ 802 public Builder addNamespaceUrisToRoot(boolean value) { 803 super.addNamespaceUrisToRoot(value); 804 return this; 805 } 806 807 @Override /* GENERATED - org.apache.juneau.xml.XmlSerializer.Builder */ 808 public Builder defaultNamespace(Namespace value) { 809 super.defaultNamespace(value); 810 return this; 811 } 812 813 @Override /* GENERATED - org.apache.juneau.xml.XmlSerializer.Builder */ 814 public Builder disableAutoDetectNamespaces() { 815 super.disableAutoDetectNamespaces(); 816 return this; 817 } 818 819 @Override /* GENERATED - org.apache.juneau.xml.XmlSerializer.Builder */ 820 public Builder disableAutoDetectNamespaces(boolean value) { 821 super.disableAutoDetectNamespaces(value); 822 return this; 823 } 824 825 @Override /* GENERATED - org.apache.juneau.xml.XmlSerializer.Builder */ 826 public Builder enableNamespaces() { 827 super.enableNamespaces(); 828 return this; 829 } 830 831 @Override /* GENERATED - org.apache.juneau.xml.XmlSerializer.Builder */ 832 public Builder enableNamespaces(boolean value) { 833 super.enableNamespaces(value); 834 return this; 835 } 836 837 @Override /* GENERATED - org.apache.juneau.xml.XmlSerializer.Builder */ 838 public Builder namespaces(Namespace...values) { 839 super.namespaces(values); 840 return this; 841 } 842 843 @Override /* GENERATED - org.apache.juneau.xml.XmlSerializer.Builder */ 844 public Builder ns() { 845 super.ns(); 846 return this; 847 } 848 849 // </FluentSetters> 850 } 851 852 //------------------------------------------------------------------------------------------------------------------- 853 // Instance 854 //------------------------------------------------------------------------------------------------------------------- 855 856 final String soapAction; 857 858 private final Map<ClassMeta<?>,SoapXmlClassMeta> soapXmlClassMetas = new ConcurrentHashMap<>(); 859 private final Map<BeanPropertyMeta,SoapXmlBeanPropertyMeta> soapXmlBeanPropertyMetas = new ConcurrentHashMap<>(); 860 861 /** 862 * Constructor. 863 * 864 * @param builder The builder for this object. 865 */ 866 public SoapXmlSerializer(Builder builder) { 867 super(builder); 868 soapAction = builder.soapAction; 869 } 870 871 @Override /* Context */ 872 public Builder copy() { 873 return new Builder(this); 874 } 875 876 @Override /* Context */ 877 public SoapXmlSerializerSession.Builder createSession() { 878 return SoapXmlSerializerSession.create(this); 879 } 880 881 @Override /* Context */ 882 public SoapXmlSerializerSession getSession() { 883 return createSession().build(); 884 } 885 886 //----------------------------------------------------------------------------------------------------------------- 887 // Extended metadata 888 //----------------------------------------------------------------------------------------------------------------- 889 890 @Override /* SoapXmlMetaProvider */ 891 public SoapXmlClassMeta getSoapXmlClassMeta(ClassMeta<?> cm) { 892 SoapXmlClassMeta m = soapXmlClassMetas.get(cm); 893 if (m == null) { 894 m = new SoapXmlClassMeta(cm, this); 895 soapXmlClassMetas.put(cm, m); 896 } 897 return m; 898 } 899 900 @Override /* SoapXmlMetaProvider */ 901 public SoapXmlBeanPropertyMeta getSoapXmlBeanPropertyMeta(BeanPropertyMeta bpm) { 902 if (bpm == null) 903 return SoapXmlBeanPropertyMeta.DEFAULT; 904 SoapXmlBeanPropertyMeta m = soapXmlBeanPropertyMetas.get(bpm); 905 if (m == null) { 906 m = new SoapXmlBeanPropertyMeta(bpm.getDelegateFor(), this); 907 soapXmlBeanPropertyMetas.put(bpm, m); 908 } 909 return m; 910 } 911 912 //----------------------------------------------------------------------------------------------------------------- 913 // Properties 914 //----------------------------------------------------------------------------------------------------------------- 915 916 /** 917 * The SOAPAction HTTP header value to set on responses. 918 * 919 * @see Builder#soapAction(String) 920 * @return 921 * The SOAPAction HTTP header value to set on responses. 922 */ 923 public String getSoapAction() { 924 return soapAction; 925 } 926 927 //----------------------------------------------------------------------------------------------------------------- 928 // Other methods 929 //----------------------------------------------------------------------------------------------------------------- 930 931 @Override /* Context */ 932 protected JsonMap properties() { 933 return filteredMap("soapAction", soapAction); 934 } 935}