org.apache.juneau.uon.UonSerializerBuilder 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.uon;
import static org.apache.juneau.uon.UonSerializer.*;
import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.http.*;
import org.apache.juneau.serializer.*;
/**
* Builder class for building instances of UON serializers.
*/
public class UonSerializerBuilder extends WriterSerializerBuilder {
/**
* Constructor, default settings.
*/
public UonSerializerBuilder() {
super();
}
/**
* Constructor.
*
* @param ps The initial configuration settings for this builder.
*/
public UonSerializerBuilder(PropertyStore ps) {
super(ps);
}
@Override /* ContextBuilder */
public UonSerializer build() {
return build(UonSerializer.class);
}
//-----------------------------------------------------------------------------------------------------------------
// Properties
//-----------------------------------------------------------------------------------------------------------------
/**
* Configuration property: Encode non-valid URI characters.
*
*
* Encode non-valid URI characters with "%xx" constructs.
*
*
See Also:
*
* - {@link UonSerializer#UON_encoding}
*
*
* @param value
* The new value for this property.
*
The default value is false .
* @return This object (for method chaining).
*/
public UonSerializerBuilder encoding(boolean value) {
return set(UON_encoding, value);
}
/**
* Configuration property: Encode non-valid URI characters.
*
*
* Shortcut for calling encoding(true )
.
*
*
See Also:
*
* - {@link UonSerializer#UON_encoding}
*
*
* @return This object (for method chaining).
*/
public UonSerializerBuilder encoding() {
return set(UON_encoding, true);
}
/**
* Configuration property: Format to use for query/form-data/header values.
*
*
* Specifies the format to use for URL GET parameter keys and values.
*
*
See Also:
*
* - {@link UonSerializer#UON_paramFormat}
*
*
* @param value
* The new value for this property.
*
The default value is {@link ParamFormat#UON}.
* @return This object (for method chaining).
*/
public UonSerializerBuilder paramFormat(ParamFormat value) {
return set(UON_paramFormat, value);
}
/**
* Configuration property: Format to use for query/form-data/header values.
*
*
* Shortcut for calling paramFormat(PLAINTEXT )
.
*
*
See Also:
*
* - {@link UonSerializer#UON_paramFormat}
*
*
* @return This object (for method chaining).
*/
public UonSerializerBuilder paramFormatPlain() {
return set(UON_paramFormat, ParamFormat.PLAINTEXT);
}
@Override /* WriterSerializerBuilder */
public UonSerializerBuilder maxIndent(int value) {
super.maxIndent(value);
return this;
}
@Override /* WriterSerializerBuilder */
public UonSerializerBuilder quoteChar(char value) {
super.quoteChar(value);
return this;
}
@Override /* WriterSerializerBuilder */
public UonSerializerBuilder sq() {
super.sq();
return this;
}
@Override /* WriterSerializerBuilder */
public UonSerializerBuilder useWhitespace(boolean value) {
super.useWhitespace(value);
return this;
}
@Override /* WriterSerializerBuilder */
public UonSerializerBuilder useWhitespace() {
super.useWhitespace();
return this;
}
@Override /* WriterSerializerBuilder */
public UonSerializerBuilder ws() {
super.ws();
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder addBeanTypes(boolean value) {
super.addBeanTypes(value);
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder addBeanTypes() {
super.addBeanTypes();
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder addRootType(boolean value) {
super.addRootType(value);
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder addRootType() {
super.addRootType();
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder detectRecursions(boolean value) {
super.detectRecursions(value);
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder detectRecursions() {
super.detectRecursions();
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder ignoreRecursions(boolean value) {
super.ignoreRecursions(value);
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder ignoreRecursions() {
super.ignoreRecursions();
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder initialDepth(int value) {
super.initialDepth(value);
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder listener(Class extends SerializerListener> value) {
super.listener(value);
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder maxDepth(int value) {
super.maxDepth(value);
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder sortCollections(boolean value) {
super.sortCollections(value);
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder sortCollections() {
super.sortCollections();
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder sortMaps(boolean value) {
super.sortMaps(value);
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder sortMaps() {
super.sortMaps();
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder trimEmptyCollections(boolean value) {
super.trimEmptyCollections(value);
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder trimEmptyCollections() {
super.trimEmptyCollections();
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder trimEmptyMaps(boolean value) {
super.trimEmptyMaps(value);
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder trimEmptyMaps() {
super.trimEmptyMaps();
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder trimNullProperties(boolean value) {
super.trimNullProperties(value);
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder trimStrings(boolean value) {
super.trimStrings(value);
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder trimStrings() {
super.trimStrings();
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder uriContext(UriContext value) {
super.uriContext(value);
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder uriRelativity(UriRelativity value) {
super.uriRelativity(value);
return this;
}
@Override /* SerializerBuilder */
public UonSerializerBuilder uriResolution(UriResolution value) {
super.uriResolution(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beanClassVisibility(Visibility value) {
super.beanClassVisibility(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beanConstructorVisibility(Visibility value) {
super.beanConstructorVisibility(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beanDictionary(boolean append, Object...values) {
super.beanDictionary(append, values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beanDictionary(Class>...values) {
super.beanDictionary(values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beanDictionary(Object...values) {
super.beanDictionary(values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beanDictionaryRemove(Object...values) {
super.beanDictionaryRemove(values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beanFieldVisibility(Visibility value) {
super.beanFieldVisibility(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beanFilters(boolean append, Object...values) {
super.beanFilters(append, values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beanFilters(Class>...values) {
super.beanFilters(values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beanFilters(Object...values) {
super.beanFilters(values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beanFiltersRemove(Object...values) {
super.beanFiltersRemove(values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beanMapPutReturnsOldValue(boolean value) {
super.beanMapPutReturnsOldValue(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beanMapPutReturnsOldValue() {
super.beanMapPutReturnsOldValue();
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beanMethodVisibility(Visibility value) {
super.beanMethodVisibility(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beansRequireDefaultConstructor(boolean value) {
super.beansRequireDefaultConstructor(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beansRequireDefaultConstructor() {
super.beansRequireDefaultConstructor();
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beansRequireSerializable(boolean value) {
super.beansRequireSerializable(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beansRequireSerializable() {
super.beansRequireSerializable();
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beansRequireSettersForGetters(boolean value) {
super.beansRequireSettersForGetters(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beansRequireSettersForGetters() {
super.beansRequireSettersForGetters();
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beansRequireSomeProperties(boolean value) {
super.beansRequireSomeProperties(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder beanTypePropertyName(String value) {
super.beanTypePropertyName(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder debug() {
super.debug();
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder example(Class c, T o) {
super.example(c, o);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder ignoreInvocationExceptionsOnGetters(boolean value) {
super.ignoreInvocationExceptionsOnGetters(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder ignoreInvocationExceptionsOnGetters() {
super.ignoreInvocationExceptionsOnGetters();
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder ignoreInvocationExceptionsOnSetters(boolean value) {
super.ignoreInvocationExceptionsOnSetters(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder ignoreInvocationExceptionsOnSetters() {
super.ignoreInvocationExceptionsOnSetters();
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder ignorePropertiesWithoutSetters(boolean value) {
super.ignorePropertiesWithoutSetters(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder ignoreUnknownBeanProperties(boolean value) {
super.ignoreUnknownBeanProperties(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder ignoreUnknownBeanProperties() {
super.ignoreUnknownBeanProperties();
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder ignoreUnknownNullBeanProperties(boolean value) {
super.ignoreUnknownNullBeanProperties(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder implClass(Class interfaceClass, Class extends T> implClass) {
super.implClass(interfaceClass, implClass);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder implClasses(Map> values) {
super.implClasses(values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder locale(Locale value) {
super.locale(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder mediaType(MediaType value) {
super.mediaType(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder notBeanClasses(boolean append, Object...values) {
super.notBeanClasses(append, values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder notBeanClasses(Class>...values) {
super.notBeanClasses(values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder notBeanClasses(Object...values) {
super.notBeanClasses(values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder notBeanClassesRemove(Object...values) {
super.notBeanClassesRemove(values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder notBeanPackages(boolean append, Object...values) {
super.notBeanPackages(append, values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder notBeanPackages(Object...values) {
super.notBeanPackages(values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder notBeanPackages(String...values) {
super.notBeanPackages(values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder notBeanPackagesRemove(Object...values) {
super.notBeanPackagesRemove(values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder pojoSwaps(boolean append, Object...values) {
super.pojoSwaps(append, values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder pojoSwaps(Class>...values) {
super.pojoSwaps(values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder pojoSwaps(Object...values) {
super.pojoSwaps(values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder pojoSwapsRemove(Object...values) {
super.pojoSwapsRemove(values);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder sortProperties(boolean value) {
super.sortProperties(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder sortProperties() {
super.sortProperties();
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder timeZone(TimeZone value) {
super.timeZone(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder useEnumNames() {
super.useEnumNames();
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder useInterfaceProxies(boolean value) {
super.useInterfaceProxies(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder useJavaBeanIntrospector(boolean value) {
super.useJavaBeanIntrospector(value);
return this;
}
@Override /* BeanContextBuilder */
public UonSerializerBuilder useJavaBeanIntrospector() {
super.useJavaBeanIntrospector();
return this;
}
@Override /* ContextBuilder */
public UonSerializerBuilder set(String name, Object value) {
super.set(name, value);
return this;
}
@Override /* ContextBuilder */
public UonSerializerBuilder set(boolean append, String name, Object value) {
super.set(append, name, value);
return this;
}
@Override /* ContextBuilder */
public UonSerializerBuilder set(Map properties) {
super.set(properties);
return this;
}
@Override /* ContextBuilder */
public UonSerializerBuilder add(Map properties) {
super.add(properties);
return this;
}
@Override /* ContextBuilder */
public UonSerializerBuilder addTo(String name, Object value) {
super.addTo(name, value);
return this;
}
@Override /* ContextBuilder */
public UonSerializerBuilder addTo(String name, String key, Object value) {
super.addTo(name, key, value);
return this;
}
@Override /* ContextBuilder */
public UonSerializerBuilder removeFrom(String name, Object value) {
super.removeFrom(name, value);
return this;
}
@Override /* ContextBuilder */
public UonSerializerBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
}