org.apache.juneau.yaml.proto.YamlSerializerBuilder Maven / Gradle / Ivy
// ***************************************************************************************************************************
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
// * specific language governing permissions and limitations under the License. *
// ***************************************************************************************************************************
package org.apache.juneau.yaml.proto;
import static org.apache.juneau.yaml.proto.YamlSerializer.*;
import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.http.*;
import org.apache.juneau.serializer.*;
/**
* Builder class for building instances of JSON serializers.
*/
public class YamlSerializerBuilder extends SerializerBuilder {
/**
* Constructor, default settings.
*/
public YamlSerializerBuilder() {
super();
}
/**
* Constructor.
*
* @param propertyStore The initial configuration settings for this builder.
*/
public YamlSerializerBuilder(PropertyStore propertyStore) {
super(propertyStore);
}
@Override /* CoreObjectBuilder */
public YamlSerializer build() {
return new YamlSerializer(propertyStore);
}
//--------------------------------------------------------------------------------
// Properties
//--------------------------------------------------------------------------------
/**
* Configuration property: Simple JSON mode.
*
*
* - Name:
"JsonSerializer.simpleMode"
* - Data type:
Boolean
* - Default:
false
* - Session-overridable:
true
*
*
*
* If true , JSON attribute names will only be quoted when necessary.
* Otherwise, they are always quoted.
*
*
Notes:
*
* - This is equivalent to calling
property(JSON_simpleMode , value)
.
*
*
* @param value The new value for this property.
* @return This object (for method chaining).
* @see #YAML_simpleMode
*/
public YamlSerializerBuilder simple(boolean value) {
return property(YAML_simpleMode, value);
}
/**
* Shortcut for calling setSimpleMode(true ).sq()
.
*
* @return This object (for method chaining).
*/
public YamlSerializerBuilder simple() {
return simple(true).sq();
}
/**
* Configuration property: Prefix solidus '/' characters with escapes.
*
*
* - Name:
"JsonSerializer.escapeSolidus"
* - Data type:
Boolean
* - Default:
false
* - Session-overridable:
true
*
*
*
* If true , solidus (e.g. slash) characters should be escaped.
* The JSON specification allows for either format.
* However, if you're embedding JSON in an HTML script tag, this setting prevents confusion when trying to
* serialize <\/script> .
*
*
Notes:
*
* - This is equivalent to calling
property(JSON_escapeSolidus , value)
.
*
*
* @param value The new value for this property.
* @return This object (for method chaining).
* @see #YAML_escapeSolidus
*/
public YamlSerializerBuilder escapeSolidus(boolean value) {
return property(YAML_escapeSolidus, value);
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder maxDepth(int value) {
super.maxDepth(value);
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder initialDepth(int value) {
super.initialDepth(value);
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder detectRecursions(boolean value) {
super.detectRecursions(value);
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder ignoreRecursions(boolean value) {
super.ignoreRecursions(value);
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder useWhitespace(boolean value) {
super.useWhitespace(value);
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder ws() {
super.ws();
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder maxIndent(int value) {
super.maxIndent(value);
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder addBeanTypeProperties(boolean value) {
super.addBeanTypeProperties(value);
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder quoteChar(char value) {
super.quoteChar(value);
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder sq() {
super.sq();
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder trimNullProperties(boolean value) {
super.trimNullProperties(value);
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder trimEmptyCollections(boolean value) {
super.trimEmptyCollections(value);
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder trimEmptyMaps(boolean value) {
super.trimEmptyMaps(value);
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder trimStrings(boolean value) {
super.trimStrings(value);
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder uriContext(UriContext value) {
super.uriContext(value);
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder uriResolution(UriResolution value) {
super.uriResolution(value);
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder uriRelativity(UriRelativity value) {
super.uriRelativity(value);
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder sortCollections(boolean value) {
super.sortCollections(value);
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder sortMaps(boolean value) {
super.sortMaps(value);
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder abridged(boolean value) {
super.abridged(value);
return this;
}
@Override /* SerializerBuilder */
public YamlSerializerBuilder listener(Class extends SerializerListener> value) {
super.listener(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder beansRequireDefaultConstructor(boolean value) {
super.beansRequireDefaultConstructor(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder beansRequireSerializable(boolean value) {
super.beansRequireSerializable(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder beansRequireSettersForGetters(boolean value) {
super.beansRequireSettersForGetters(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder beansRequireSomeProperties(boolean value) {
super.beansRequireSomeProperties(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder beanMapPutReturnsOldValue(boolean value) {
super.beanMapPutReturnsOldValue(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder beanConstructorVisibility(Visibility value) {
super.beanConstructorVisibility(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder beanClassVisibility(Visibility value) {
super.beanClassVisibility(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder beanFieldVisibility(Visibility value) {
super.beanFieldVisibility(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder methodVisibility(Visibility value) {
super.methodVisibility(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder useJavaBeanIntrospector(boolean value) {
super.useJavaBeanIntrospector(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder useInterfaceProxies(boolean value) {
super.useInterfaceProxies(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder ignoreUnknownBeanProperties(boolean value) {
super.ignoreUnknownBeanProperties(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder ignoreUnknownNullBeanProperties(boolean value) {
super.ignoreUnknownNullBeanProperties(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder ignorePropertiesWithoutSetters(boolean value) {
super.ignorePropertiesWithoutSetters(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder ignoreInvocationExceptionsOnGetters(boolean value) {
super.ignoreInvocationExceptionsOnGetters(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder ignoreInvocationExceptionsOnSetters(boolean value) {
super.ignoreInvocationExceptionsOnSetters(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder sortProperties(boolean value) {
super.sortProperties(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder notBeanPackages(String...values) {
super.notBeanPackages(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder notBeanPackages(Collection values) {
super.notBeanPackages(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder setNotBeanPackages(String...values) {
super.setNotBeanPackages(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder setNotBeanPackages(Collection values) {
super.setNotBeanPackages(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder removeNotBeanPackages(String...values) {
super.removeNotBeanPackages(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder removeNotBeanPackages(Collection values) {
super.removeNotBeanPackages(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder notBeanClasses(Class>...values) {
super.notBeanClasses(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder notBeanClasses(Collection> values) {
super.notBeanClasses(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder setNotBeanClasses(Class>...values) {
super.setNotBeanClasses(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder setNotBeanClasses(Collection> values) {
super.setNotBeanClasses(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder removeNotBeanClasses(Class>...values) {
super.removeNotBeanClasses(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder removeNotBeanClasses(Collection> values) {
super.removeNotBeanClasses(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder beanFilters(Class>...values) {
super.beanFilters(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder beanFilters(Collection> values) {
super.beanFilters(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder setBeanFilters(Class>...values) {
super.setBeanFilters(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder setBeanFilters(Collection> values) {
super.setBeanFilters(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder removeBeanFilters(Class>...values) {
super.removeBeanFilters(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder removeBeanFilters(Collection> values) {
super.removeBeanFilters(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder pojoSwaps(Class>...values) {
super.pojoSwaps(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder pojoSwaps(Collection> values) {
super.pojoSwaps(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder setPojoSwaps(Class>...values) {
super.setPojoSwaps(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder setPojoSwaps(Collection> values) {
super.setPojoSwaps(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder removePojoSwaps(Class>...values) {
super.removePojoSwaps(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder removePojoSwaps(Collection> values) {
super.removePojoSwaps(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder implClasses(Map,Class>> values) {
super.implClasses(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder implClass(Class interfaceClass, Class extends T> implClass) {
super.implClass(interfaceClass, implClass);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder includeProperties(Map values) {
super.includeProperties(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder includeProperties(String beanClassName, String properties) {
super.includeProperties(beanClassName, properties);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder includeProperties(Class> beanClass, String properties) {
super.includeProperties(beanClass, properties);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder excludeProperties(Map values) {
super.excludeProperties(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder excludeProperties(String beanClassName, String properties) {
super.excludeProperties(beanClassName, properties);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder excludeProperties(Class> beanClass, String properties) {
super.excludeProperties(beanClass, properties);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder beanDictionary(Class>...values) {
super.beanDictionary(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder beanDictionary(Collection> values) {
super.beanDictionary(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder setBeanDictionary(Class>...values) {
super.setBeanDictionary(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder setBeanDictionary(Collection> values) {
super.setBeanDictionary(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder removeFromBeanDictionary(Class>...values) {
super.removeFromBeanDictionary(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder removeFromBeanDictionary(Collection> values) {
super.removeFromBeanDictionary(values);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder beanTypePropertyName(String value) {
super.beanTypePropertyName(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder defaultParser(Class> value) {
super.defaultParser(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder locale(Locale value) {
super.locale(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder timeZone(TimeZone value) {
super.timeZone(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder mediaType(MediaType value) {
super.mediaType(value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder debug() {
super.debug();
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder property(String name, Object value) {
super.property(name, value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder properties(Map properties) {
super.properties(properties);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder addToProperty(String name, Object value) {
super.addToProperty(name, value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder putToProperty(String name, Object key, Object value) {
super.putToProperty(name, key, value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder putToProperty(String name, Object value) {
super.putToProperty(name, value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder removeFromProperty(String name, Object value) {
super.removeFromProperty(name, value);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder classLoader(ClassLoader classLoader) {
super.classLoader(classLoader);
return this;
}
@Override /* CoreObjectBuilder */
public YamlSerializerBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
}