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.serializer;
014
015import static org.apache.juneau.serializer.OutputStreamSerializer.*;
016
017import java.lang.annotation.*;
018import java.lang.reflect.*;
019import java.util.*;
020
021import org.apache.juneau.*;
022import org.apache.juneau.http.*;
023import org.apache.juneau.reflect.*;
024import org.apache.juneau.svl.*;
025
026/**
027 * Base class for all stream-based serializer builders.
028 */
029public class OutputStreamSerializerBuilder extends SerializerBuilder {
030
031   /**
032    * Constructor, default settings.
033    */
034   public OutputStreamSerializerBuilder() {
035      super();
036   }
037
038   /**
039    * Constructor.
040    *
041    * @param ps The initial configuration settings for this builder.
042    */
043   public OutputStreamSerializerBuilder(PropertyStore ps) {
044      super(ps);
045   }
046
047   //-----------------------------------------------------------------------------------------------------------------
048   // Properties
049   //-----------------------------------------------------------------------------------------------------------------
050
051   /**
052    * Configuration property:  Binary output format.
053    *
054    * <p>
055    * When using the {@link Serializer#serializeToString(Object)} method on stream-based serializers, this defines the format to use
056    * when converting the resulting byte array to a string.
057    *
058    * <ul class='javatree'>
059    *    <li class='jf'>{@link OutputStreamSerializer#OSSERIALIZER_binaryFormat}
060    * </ul>
061    *
062    * @param value
063    *    The new value for this property.
064    *    <br>The default is {@link BinaryFormat#HEX}.
065    * @return This object (for method chaining).
066    */
067   public OutputStreamSerializerBuilder binaryFormat(BinaryFormat value) {
068      return set(OSSERIALIZER_binaryFormat, value);
069   }
070
071   /**
072    * Configuration property:  Binary output format.
073    *
074    * <p>
075    * When using the {@link Serializer#serializeToString(Object)} method on stream-based serializers, this defines the format to use
076    * when converting the resulting byte array to a string.
077    *
078    * <ul class='javatree'>
079    *    <li class='jf'>{@link OutputStreamSerializer#OSSERIALIZER_binaryFormat}
080    * </ul>
081    *
082    * @param value
083    *    The new value for this property.
084    *    <br>The default is {@link BinaryFormat#HEX}.
085    * @return This object (for method chaining).
086    */
087   public OutputStreamSerializerBuilder binaryFormat(String value) {
088      return set(OSSERIALIZER_binaryFormat, BinaryFormat.valueOf(value));
089   }
090
091   @Override /* BeanContextBuilder */
092   public OutputStreamSerializerBuilder annotations(Annotation...values) {
093      super.annotations(values);
094      return this;
095   }
096
097   @Override /* BeanContextBuilder */
098   public OutputStreamSerializerBuilder beanClassVisibility(Visibility value) {
099      super.beanClassVisibility(value);
100      return this;
101   }
102
103   @Override /* BeanContextBuilder */
104   public OutputStreamSerializerBuilder beanConstructorVisibility(Visibility value) {
105      super.beanConstructorVisibility(value);
106      return this;
107   }
108
109   @Override /* BeanContextBuilder */
110   @Deprecated
111   public OutputStreamSerializerBuilder beanDictionary(Class<?>...values) {
112      super.beanDictionary(values);
113      return this;
114   }
115
116   @Override /* BeanContextBuilder */
117   @Deprecated
118   public OutputStreamSerializerBuilder beanDictionary(Object...values) {
119      super.beanDictionary(values);
120      return this;
121   }
122
123   @Override /* BeanContextBuilder */
124   @Deprecated
125   public OutputStreamSerializerBuilder beanDictionaryReplace(Class<?>...values) {
126      super.beanDictionaryReplace(values);
127      return this;
128   }
129
130   @Override /* BeanContextBuilder */
131   @Deprecated
132   public OutputStreamSerializerBuilder beanDictionaryReplace(Object...values) {
133      super.beanDictionaryReplace(values);
134      return this;
135   }
136
137   @Override /* BeanContextBuilder */
138   @Deprecated
139   public OutputStreamSerializerBuilder beanDictionaryRemove(Class<?>...values) {
140      super.beanDictionaryRemove(values);
141      return this;
142   }
143
144   @Override /* BeanContextBuilder */
145   @Deprecated
146   public OutputStreamSerializerBuilder beanDictionaryRemove(Object...values) {
147      super.beanDictionaryRemove(values);
148      return this;
149   }
150
151   @Override /* BeanContextBuilder */
152   public OutputStreamSerializerBuilder beanFieldVisibility(Visibility value) {
153      super.beanFieldVisibility(value);
154      return this;
155   }
156
157   @Override /* BeanContextBuilder */
158   public OutputStreamSerializerBuilder beanFilters(Class<?>...values) {
159      super.beanFilters(values);
160      return this;
161   }
162
163   @Override /* BeanContextBuilder */
164   public OutputStreamSerializerBuilder beanFilters(Object...values) {
165      super.beanFilters(values);
166      return this;
167   }
168
169   @Override /* BeanContextBuilder */
170   public OutputStreamSerializerBuilder beanFiltersReplace(Class<?>...values) {
171      super.beanFiltersReplace(values);
172      return this;
173   }
174
175   @Override /* BeanContextBuilder */
176   public OutputStreamSerializerBuilder beanFiltersReplace(Object...values) {
177      super.beanFiltersReplace(values);
178      return this;
179   }
180
181   @Override /* BeanContextBuilder */
182   public OutputStreamSerializerBuilder beanFiltersRemove(Class<?>...values) {
183      super.beanFiltersRemove(values);
184      return this;
185   }
186
187   @Override /* BeanContextBuilder */
188   public OutputStreamSerializerBuilder beanFiltersRemove(Object...values) {
189      super.beanFiltersRemove(values);
190      return this;
191   }
192
193   @Override /* BeanContextBuilder */
194   public OutputStreamSerializerBuilder beanMapPutReturnsOldValue(boolean value) {
195      super.beanMapPutReturnsOldValue(value);
196      return this;
197   }
198
199   @Override /* BeanContextBuilder */
200   public OutputStreamSerializerBuilder beanMapPutReturnsOldValue() {
201      super.beanMapPutReturnsOldValue();
202      return this;
203   }
204
205   @Override /* BeanContextBuilder */
206   public OutputStreamSerializerBuilder beanMethodVisibility(Visibility value) {
207      super.beanMethodVisibility(value);
208      return this;
209   }
210
211   @Override /* BeanContextBuilder */
212   public OutputStreamSerializerBuilder beansRequireDefaultConstructor(boolean value) {
213      super.beansRequireDefaultConstructor(value);
214      return this;
215   }
216
217   @Override /* BeanContextBuilder */
218   public OutputStreamSerializerBuilder beansRequireDefaultConstructor() {
219      super.beansRequireDefaultConstructor();
220      return this;
221   }
222
223   @Override /* BeanContextBuilder */
224   public OutputStreamSerializerBuilder beansRequireSerializable(boolean value) {
225      super.beansRequireSerializable(value);
226      return this;
227   }
228
229   @Override /* BeanContextBuilder */
230   public OutputStreamSerializerBuilder beansRequireSerializable() {
231      super.beansRequireSerializable();
232      return this;
233   }
234
235   @Override /* BeanContextBuilder */
236   public OutputStreamSerializerBuilder beansRequireSettersForGetters(boolean value) {
237      super.beansRequireSettersForGetters(value);
238      return this;
239   }
240
241   @Override /* BeanContextBuilder */
242   public OutputStreamSerializerBuilder beansRequireSettersForGetters() {
243      super.beansRequireSettersForGetters();
244      return this;
245   }
246
247   @Override /* BeanContextBuilder */
248   public OutputStreamSerializerBuilder beansRequireSomeProperties(boolean value) {
249      super.beansRequireSomeProperties(value);
250      return this;
251   }
252
253   @Override /* BeanContextBuilder */
254   public OutputStreamSerializerBuilder beanTypePropertyName(String value) {
255      super.beanTypePropertyName(value);
256      return this;
257   }
258
259   @Override /* BeanContextBuilder */
260   public OutputStreamSerializerBuilder bpi(Class<?> beanClass, String value) {
261      super.bpi(beanClass, value);
262      return this;
263   }
264
265   @Override /* BeanContextBuilder */
266   public OutputStreamSerializerBuilder bpi(Map<String,String> values) {
267      super.bpi(values);
268      return this;
269   }
270
271   @Override /* BeanContextBuilder */
272   public OutputStreamSerializerBuilder bpi(String beanClassName, String value) {
273      super.bpi(beanClassName, value);
274      return this;
275   }
276
277   @Override /* BeanContextBuilder */
278   public OutputStreamSerializerBuilder bpx(Class<?> beanClass, String properties) {
279      super.bpx(beanClass, properties);
280      return this;
281   }
282
283   @Override /* BeanContextBuilder */
284   public OutputStreamSerializerBuilder bpx(Map<String,String> values) {
285      super.bpx(values);
286      return this;
287   }
288
289   @Override /* BeanContextBuilder */
290   public OutputStreamSerializerBuilder bpx(String beanClassName, String value) {
291      super.bpx(beanClassName, value);
292      return this;
293   }
294
295   @Override /* BeanContextBuilder */
296   public OutputStreamSerializerBuilder bpro(Class<?> beanClass, String value) {
297      super.bpro(beanClass, value);
298      return this;
299   }
300
301   @Override /* BeanContextBuilder */
302   public OutputStreamSerializerBuilder bpro(Map<String,String> values) {
303      super.bpro(values);
304      return this;
305   }
306
307   @Override /* BeanContextBuilder */
308   public OutputStreamSerializerBuilder bpro(String beanClassName, String value) {
309      super.bpro(beanClassName, value);
310      return this;
311   }
312
313   @Override /* BeanContextBuilder */
314   public OutputStreamSerializerBuilder bpwo(Class<?> beanClass, String properties) {
315      super.bpwo(beanClass, properties);
316      return this;
317   }
318
319   @Override /* BeanContextBuilder */
320   public OutputStreamSerializerBuilder bpwo(Map<String,String> values) {
321      super.bpwo(values);
322      return this;
323   }
324
325   @Override /* BeanContextBuilder */
326   public OutputStreamSerializerBuilder bpwo(String beanClassName, String value) {
327      super.bpwo(beanClassName, value);
328      return this;
329   }
330
331   @Override /* BeanContextBuilder */
332   public OutputStreamSerializerBuilder debug() {
333      super.debug();
334      return this;
335   }
336
337   @Override /* BeanContextBuilder */
338   public OutputStreamSerializerBuilder dictionary(Class<?>...values) {
339      super.dictionary(values);
340      return this;
341   }
342
343   @Override /* BeanContextBuilder */
344   public OutputStreamSerializerBuilder dictionary(Object...values) {
345      super.dictionary(values);
346      return this;
347   }
348
349   @Override /* BeanContextBuilder */
350   public OutputStreamSerializerBuilder dictionaryReplace(Class<?>...values) {
351      super.dictionaryReplace(values);
352      return this;
353   }
354
355   @Override /* BeanContextBuilder */
356   public OutputStreamSerializerBuilder dictionaryReplace(Object...values) {
357      super.dictionaryReplace(values);
358      return this;
359   }
360
361   @Override /* BeanContextBuilder */
362   public OutputStreamSerializerBuilder dictionaryRemove(Class<?>...values) {
363      super.dictionaryRemove(values);
364      return this;
365   }
366
367   @Override /* BeanContextBuilder */
368   public OutputStreamSerializerBuilder dictionaryRemove(Object...values) {
369      super.dictionaryRemove(values);
370      return this;
371   }
372
373   @Override /* BeanContextBuilder */
374   public <T> OutputStreamSerializerBuilder example(Class<T> c, T o) {
375      super.example(c, o);
376      return this;
377   }
378
379   @Override /* BeanContextBuilder */
380   public <T> OutputStreamSerializerBuilder exampleJson(Class<T> c, String value) {
381      super.exampleJson(c, value);
382      return this;
383   }
384
385   @Override /* BeanContextBuilder */
386   public OutputStreamSerializerBuilder ignoreInvocationExceptionsOnGetters(boolean value) {
387      super.ignoreInvocationExceptionsOnGetters(value);
388      return this;
389   }
390
391   @Override /* BeanContextBuilder */
392   public OutputStreamSerializerBuilder ignoreInvocationExceptionsOnGetters() {
393      super.ignoreInvocationExceptionsOnGetters();
394      return this;
395   }
396
397   @Override /* BeanContextBuilder */
398   public OutputStreamSerializerBuilder ignoreInvocationExceptionsOnSetters(boolean value) {
399      super.ignoreInvocationExceptionsOnSetters(value);
400      return this;
401   }
402
403   @Override /* BeanContextBuilder */
404   public OutputStreamSerializerBuilder ignoreInvocationExceptionsOnSetters() {
405      super.ignoreInvocationExceptionsOnSetters();
406      return this;
407   }
408
409   @Override /* BeanContextBuilder */
410   public OutputStreamSerializerBuilder ignorePropertiesWithoutSetters(boolean value) {
411      super.ignorePropertiesWithoutSetters(value);
412      return this;
413   }
414
415   @Override /* BeanContextBuilder */
416   public OutputStreamSerializerBuilder ignoreUnknownBeanProperties(boolean value) {
417      super.ignoreUnknownBeanProperties(value);
418      return this;
419   }
420
421   @Override /* BeanContextBuilder */
422   public OutputStreamSerializerBuilder ignoreUnknownBeanProperties() {
423      super.ignoreUnknownBeanProperties();
424      return this;
425   }
426
427   @Override /* BeanContextBuilder */
428   public OutputStreamSerializerBuilder ignoreUnknownNullBeanProperties(boolean value) {
429      super.ignoreUnknownNullBeanProperties(value);
430      return this;
431   }
432
433   @Override /* BeanContextBuilder */
434   public OutputStreamSerializerBuilder implClass(Class<?> interfaceClass, Class<?> implClass) {
435      super.implClass(interfaceClass, implClass);
436      return this;
437   }
438
439   @Override /* BeanContextBuilder */
440   public OutputStreamSerializerBuilder implClasses(Map<String,Class<?>> values) {
441      super.implClasses(values);
442      return this;
443   }
444
445   @Override /* BeanContextBuilder */
446   public OutputStreamSerializerBuilder locale(Locale value) {
447      super.locale(value);
448      return this;
449   }
450
451   @Override /* BeanContextBuilder */
452   public OutputStreamSerializerBuilder mediaType(MediaType value) {
453      super.mediaType(value);
454      return this;
455   }
456
457   @Override /* BeanContextBuilder */
458   public OutputStreamSerializerBuilder notBeanClasses(Class<?>...values) {
459      super.notBeanClasses(values);
460      return this;
461   }
462
463   @Override /* BeanContextBuilder */
464   public OutputStreamSerializerBuilder notBeanClasses(Object...values) {
465      super.notBeanClasses(values);
466      return this;
467   }
468
469   @Override /* BeanContextBuilder */
470   public OutputStreamSerializerBuilder notBeanClassesReplace(Class<?>...values) {
471      super.notBeanClassesReplace(values);
472      return this;
473   }
474
475   @Override /* BeanContextBuilder */
476   public OutputStreamSerializerBuilder notBeanClassesReplace(Object...values) {
477      super.notBeanClassesReplace(values);
478      return this;
479   }
480
481   @Override /* BeanContextBuilder */
482   public OutputStreamSerializerBuilder notBeanClassesRemove(Class<?>...values) {
483      super.notBeanClassesRemove(values);
484      return this;
485   }
486
487   @Override /* BeanContextBuilder */
488   public OutputStreamSerializerBuilder notBeanClassesRemove(Object...values) {
489      super.notBeanClassesRemove(values);
490      return this;
491   }
492
493   @Override /* BeanContextBuilder */
494   public OutputStreamSerializerBuilder notBeanPackages(Object...values) {
495      super.notBeanPackages(values);
496      return this;
497   }
498
499   @Override /* BeanContextBuilder */
500   public OutputStreamSerializerBuilder notBeanPackages(String...values) {
501      super.notBeanPackages(values);
502      return this;
503   }
504
505   @Override /* BeanContextBuilder */
506   public OutputStreamSerializerBuilder notBeanPackagesReplace(String...values) {
507      super.notBeanPackagesReplace(values);
508      return this;
509   }
510
511   @Override /* BeanContextBuilder */
512   public OutputStreamSerializerBuilder notBeanPackagesReplace(Object...values) {
513      super.notBeanPackagesReplace(values);
514      return this;
515   }
516
517   @Override /* BeanContextBuilder */
518   public OutputStreamSerializerBuilder notBeanPackagesRemove(String...values) {
519      super.notBeanPackagesRemove(values);
520      return this;
521   }
522
523   @Override /* BeanContextBuilder */
524   public OutputStreamSerializerBuilder notBeanPackagesRemove(Object...values) {
525      super.notBeanPackagesRemove(values);
526      return this;
527   }
528
529   @Override /* BeanContextBuilder */
530   public OutputStreamSerializerBuilder pojoSwaps(Class<?>...values) {
531      super.pojoSwaps(values);
532      return this;
533   }
534
535   @Override /* BeanContextBuilder */
536   public OutputStreamSerializerBuilder pojoSwaps(Object...values) {
537      super.pojoSwaps(values);
538      return this;
539   }
540
541   @Override /* BeanContextBuilder */
542   public OutputStreamSerializerBuilder pojoSwapsReplace(Class<?>...values) {
543      super.pojoSwapsReplace(values);
544      return this;
545   }
546
547   @Override /* BeanContextBuilder */
548   public OutputStreamSerializerBuilder pojoSwapsReplace(Object...values) {
549      super.pojoSwapsReplace(values);
550      return this;
551   }
552
553   @Override /* BeanContextBuilder */
554   public OutputStreamSerializerBuilder pojoSwapsRemove(Class<?>...values) {
555      super.pojoSwapsRemove(values);
556      return this;
557   }
558
559   @Override /* BeanContextBuilder */
560   public OutputStreamSerializerBuilder pojoSwapsRemove(Object...values) {
561      super.pojoSwapsRemove(values);
562      return this;
563   }
564
565   @Override /* BeanContextBuilder */
566   public OutputStreamSerializerBuilder sortProperties(boolean value) {
567      super.sortProperties(value);
568      return this;
569   }
570
571   @Override /* BeanContextBuilder */
572   public OutputStreamSerializerBuilder sortProperties() {
573      super.sortProperties();
574      return this;
575   }
576
577   @Override /* BeanContextBuilder */
578   public OutputStreamSerializerBuilder timeZone(TimeZone value) {
579      super.timeZone(value);
580      return this;
581   }
582
583   @Override /* BeanContextBuilder */
584   public OutputStreamSerializerBuilder useEnumNames(boolean value) {
585      super.useEnumNames(value);
586      return this;
587   }
588
589   @Override /* BeanContextBuilder */
590   public OutputStreamSerializerBuilder useEnumNames() {
591      super.useEnumNames();
592      return this;
593   }
594
595   @Override /* BeanContextBuilder */
596   public OutputStreamSerializerBuilder useInterfaceProxies(boolean value) {
597      super.useInterfaceProxies(value);
598      return this;
599   }
600
601   @Override /* BeanContextBuilder */
602   public OutputStreamSerializerBuilder useJavaBeanIntrospector(boolean value) {
603      super.useJavaBeanIntrospector(value);
604      return this;
605   }
606
607   @Override /* BeanContextBuilder */
608   public OutputStreamSerializerBuilder useJavaBeanIntrospector() {
609      super.useJavaBeanIntrospector();
610      return this;
611   }
612
613   @Override /* ContextBuilder */
614   public OutputStreamSerializerBuilder set(String name, Object value) {
615      super.set(name, value);
616      return this;
617   }
618
619   @Override /* ContextBuilder */
620   public OutputStreamSerializerBuilder set(Map<String,Object> properties) {
621      super.set(properties);
622      return this;
623   }
624
625   @Override /* ContextBuilder */
626   public OutputStreamSerializerBuilder add(Map<String,Object> properties) {
627      super.add(properties);
628      return this;
629   }
630
631   @Override /* ContextBuilder */
632   public OutputStreamSerializerBuilder addTo(String name, Object value) {
633      super.addTo(name, value);
634      return this;
635   }
636
637   @Override /* ContextBuilder */
638   public OutputStreamSerializerBuilder addTo(String name, String key, Object value) {
639      super.addTo(name, key, value);
640      return this;
641   }
642
643   @Override /* ContextBuilder */
644   public OutputStreamSerializerBuilder removeFrom(String name, Object value) {
645      super.removeFrom(name, value);
646      return this;
647   }
648
649   @Override /* ContextBuilder */
650   public OutputStreamSerializerBuilder apply(PropertyStore copyFrom) {
651      super.apply(copyFrom);
652      return this;
653   }
654
655   @Override /* ContextBuilder */
656   public OutputStreamSerializerBuilder applyAnnotations(AnnotationList al, VarResolverSession vrs) {
657      super.applyAnnotations(al, vrs);
658      return this;
659   }
660
661   @Override /* ContextBuilder */
662   public OutputStreamSerializerBuilder applyAnnotations(Class<?>...fromClasses) {
663      super.applyAnnotations(fromClasses);
664      return this;
665   }
666
667   @Override /* ContextBuilder */
668   public OutputStreamSerializerBuilder applyAnnotations(Method...fromMethods) {
669      super.applyAnnotations(fromMethods);
670      return this;
671   }
672
673   @Override /* Context */
674   public OutputStreamSerializer build() {
675      return null;
676   }
677}