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 java.util.*;
016
017import org.apache.juneau.collections.*;
018import org.apache.juneau.http.*;
019import org.apache.juneau.httppart.*;
020import org.apache.juneau.internal.*;
021
022/**
023 * Runtime arguments common to all bean, serializer, and parser sessions.
024 */
025public class BeanSessionArgs extends SessionArgs {
026
027   /**
028    * Default empty session arguments.
029    */
030   public static final BeanSessionArgs DEFAULT = new BeanSessionArgs();
031
032   HttpPartSchema schema;
033
034   /**
035    * Constructor
036    */
037   public BeanSessionArgs() {}
038
039   /**
040    * Static creator method.
041    *
042    * @return A new {@link BeanSessionArgs} object.
043    */
044   public static BeanSessionArgs create() {
045      return new BeanSessionArgs();
046   }
047
048   //-----------------------------------------------------------------------------------------------------------------
049   // Properties.
050   //-----------------------------------------------------------------------------------------------------------------
051
052   /**
053    * HTTP-part schema.
054    *
055    * <p>
056    * Used for schema-based serializers and parsers to define additional formatting.
057    *
058    * @param value
059    *    The new value for this property.
060    *    <br>Can be <jk>null</jk>.
061    * @return This object (for method chaining).
062    */
063   @FluentSetter
064   public BeanSessionArgs schema(HttpPartSchema value) {
065      this.schema = value;
066      return this;
067   }
068
069   // <FluentSetters>
070
071   @Override /* GENERATED - SessionArgs */
072   public BeanSessionArgs debug(Boolean value) {
073      super.debug(value);
074      return this;
075   }
076
077   @Override /* GENERATED - SessionArgs */
078   public BeanSessionArgs locale(Locale value) {
079      super.locale(value);
080      return this;
081   }
082
083   @Override /* GENERATED - SessionArgs */
084   public BeanSessionArgs mediaType(MediaType value) {
085      super.mediaType(value);
086      return this;
087   }
088
089   @Override /* GENERATED - SessionArgs */
090   public BeanSessionArgs properties(OMap value) {
091      super.properties(value);
092      return this;
093   }
094
095   @Override /* GENERATED - SessionArgs */
096   public BeanSessionArgs property(String key, Object value) {
097      super.property(key, value);
098      return this;
099   }
100
101   @Override /* GENERATED - SessionArgs */
102   public BeanSessionArgs timeZone(TimeZone value) {
103      super.timeZone(value);
104      return this;
105   }
106
107   // </FluentSetters>
108
109   @Override /* SessionArgs */
110   public OMap toMap() {
111      return super.toMap()
112         .a("BeanSessionArgs", new DefaultFilteringOMap()
113            .a("schema", schema)
114         );
115   }
116}