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