Package | Description |
---|---|
com.owlike.genson |
This package contains Genson base classes, to start
with have a look at
Genson . |
com.owlike.genson.ext |
This package contains features simplifying Genson integration into existing components.
|
com.owlike.genson.ext.guava | |
com.owlike.genson.ext.jaxb | |
com.owlike.genson.ext.jodatime | |
com.owlike.genson.ext.jsr353 |
Modifier and Type | Class and Description |
---|---|
static class |
Genson.Builder
Deprecated.
use GensonBuilder
|
Modifier and Type | Method and Description |
---|---|
GensonBuilder |
GensonBuilder.acceptSingleValueAsList(boolean enable)
Wrap a single value into a list when a list is expected.
|
GensonBuilder |
GensonBuilder.addAlias(String alias,
Class<?> forClass)
Alias used in serialized class metadata instead of the full class name.
|
GensonBuilder |
GensonBuilder.exclude(Class<?> fieldOfType) |
GensonBuilder |
GensonBuilder.exclude(String field) |
GensonBuilder |
GensonBuilder.exclude(String field,
Class<?> fromClass) |
GensonBuilder |
GensonBuilder.exclude(String field,
Class<?> fromClass,
Class<?> ofType) |
GensonBuilder |
GensonBuilder.failOnMissingProperty(boolean enable)
If set to true, Genson will throw a JsonBindingException when it encounters a property in the incoming json that does not match
a property in the class.
|
GensonBuilder |
GensonBuilder.failOnNullPrimitive(boolean enabled)
False by default.
|
GensonBuilder |
GensonBuilder.include(Class<?> fieldOfType) |
GensonBuilder |
GensonBuilder.include(String field) |
GensonBuilder |
GensonBuilder.include(String field,
Class<?> fromClass) |
GensonBuilder |
GensonBuilder.include(String field,
Class<?> fromClass,
Class<?> ofType) |
GensonBuilder |
GensonBuilder.rename(Class<?> fieldOfType,
String toName)
Renames all fields of type fieldOfType to toName.
|
GensonBuilder |
GensonBuilder.rename(String field,
Class<?> fromClass,
String toName)
Renames all fields named field declared in class fromClass to toName.
|
GensonBuilder |
GensonBuilder.rename(String field,
Class<?> fromClass,
String toName,
Class<?> ofType)
Renames all fields named field, of type fieldOfType and declared in fromClass to toName.
|
GensonBuilder |
GensonBuilder.rename(String field,
String toName)
Renames all fields named field to toName.
|
GensonBuilder |
GensonBuilder.rename(String field,
String toName,
Class<?> fieldOfType)
Renames all fields named field and of type fieldOfType to toName.
|
GensonBuilder |
GensonBuilder.set(BeanMutatorAccessorResolver resolver)
Replaces default
BeanMutatorAccessorResolver by the specified one. |
GensonBuilder |
GensonBuilder.set(PropertyNameResolver resolver)
Replaces default
PropertyNameResolver by the specified one. |
GensonBuilder |
GensonBuilder.setConstructorFilter(VisibilityFilter constructorFilter) |
GensonBuilder |
GensonBuilder.setFieldFilter(VisibilityFilter propertyFilter) |
GensonBuilder |
GensonBuilder.setHtmlSafe(boolean htmlSafe)
If true \,<,>,&,= characters will be replaced by ', <, >, &, =
|
GensonBuilder |
GensonBuilder.setMethodFilter(VisibilityFilter methodFilter) |
GensonBuilder |
GensonBuilder.setSkipNull(boolean skipNull)
If true will not serialize null values
|
GensonBuilder |
GensonBuilder.settersMustBeVoid(boolean settersMustBeVoid)
If true, only setters with a return type of void will be considered when deserializing.
|
GensonBuilder |
GensonBuilder.setThrowExceptionIfNoDebugInfo(boolean throwExcOnNoDebugInfo)
Used in conjunction with
useConstructorWithArguments(boolean) . |
GensonBuilder |
GensonBuilder.useBeanViews(boolean enabled)
If true
BeanView mechanism will be enabled. |
GensonBuilder |
GensonBuilder.useByteAsInt(boolean enable) |
GensonBuilder |
GensonBuilder.useClassMetadata(boolean enabled)
Indicates whether class metadata should be serialized and used during deserialization.
|
GensonBuilder |
GensonBuilder.useClassMetadataWithStaticType(boolean enable)
If set to false, during serialization class metadata will be serialized only for types where the runtime type differs from the static one.
|
GensonBuilder |
GensonBuilder.useConstructorWithArguments(boolean enabled)
If true constructor and method arguments name will be resolved from the generated debug
symbols during compilation.
|
GensonBuilder |
GensonBuilder.useDateAsTimestamp(boolean enabled) |
GensonBuilder |
GensonBuilder.useDateFormat(DateFormat dateFormat)
Specifies the data format that should be used for java.util.Date serialization and
deserialization.
|
GensonBuilder |
GensonBuilder.useDefaultValue(Object value,
Class<?> targetType)
Uses the passed value as the default value for this type.
|
GensonBuilder |
GensonBuilder.useFields(boolean enabled)
If true, fields will be used when no getter/setter is available, except if you specified
that no getter/setter should be used with
useMethods(boolean) , in
that case only fields will be used. |
GensonBuilder |
GensonBuilder.useFields(boolean enabled,
VisibilityFilter visibility) |
GensonBuilder |
GensonBuilder.useIndentation(boolean indent)
If true outputed json will be indented using two spaces, otherwise (by default) all is
printed on same line.
|
GensonBuilder |
GensonBuilder.useMetadata(boolean metadata) |
GensonBuilder |
GensonBuilder.useMethods(boolean enabled)
If true, getters and setters would be used during serialization/deserialization in favor
of fields.
|
GensonBuilder |
GensonBuilder.useMethods(boolean enabled,
VisibilityFilter visibility) |
GensonBuilder |
GensonBuilder.useRuntimePropertyFilter(RuntimePropertyFilter filter) |
GensonBuilder |
GensonBuilder.useRuntimeType(boolean enabled)
If true the concrete type of the serialized object will always be used.
|
GensonBuilder |
GensonBuilder.useStrictDoubleParse(boolean strictDoubleParse) |
GensonBuilder |
GensonBuilder.with(BeanMutatorAccessorResolver... resolvers)
Register additional BeanMutatorAccessorResolver that will be used before the standard
ones.
|
GensonBuilder |
GensonBuilder.with(PropertyNameResolver... resolvers)
Registers the specified resolvers in the order they were defined and before the standard
ones.
|
GensonBuilder |
GensonBuilder.withBeanPropertyFactory(BeanPropertyFactory... factories)
Allows you to register new BeanPropertyFactory responsible of creating BeanProperty
accessors, mutators and BeanCreators.
|
GensonBuilder |
GensonBuilder.withBundle(GensonBundle... bundles)
Register some genson bundles.
|
GensonBuilder |
GensonBuilder.withClassLoader(ClassLoader loader)
Override the default classloader
|
GensonBuilder |
GensonBuilder.withContextualFactory(ContextualFactory<?>... factories)
ContextualFactory is actually in a beta status, it will not be removed, but might be
refactored.
|
<T> GensonBuilder |
GensonBuilder.withConverter(Converter<T> converter,
Class<? extends T> type)
Register converter by mapping it to type argument.
|
<T> GensonBuilder |
GensonBuilder.withConverter(Converter<T> converter,
GenericType<? extends T> type)
Register converter by mapping it to the parameterized type of type argument.
|
GensonBuilder |
GensonBuilder.withConverterFactory(ChainedFactory chainedFactory)
A ChainedFactory provides a way to use custom Converters that have access to the default Converters.
|
GensonBuilder |
GensonBuilder.withConverterFactory(Factory<? extends Converter<?>> factory)
Registers converter factories.
|
GensonBuilder |
GensonBuilder.withConverters(Converter<?>... converter)
Registers converters mapping them to their corresponding parameterized type.
|
<T> GensonBuilder |
GensonBuilder.withDeserializer(Deserializer<T> deserializer,
Class<? extends T> type) |
<T> GensonBuilder |
GensonBuilder.withDeserializer(Deserializer<T> deserializer,
GenericType<? extends T> type) |
GensonBuilder |
GensonBuilder.withDeserializerFactory(Factory<? extends Deserializer<?>> factory)
Registers deserializer factories.
|
GensonBuilder |
GensonBuilder.withDeserializers(Deserializer<?>... deserializer) |
<T> GensonBuilder |
GensonBuilder.withSerializer(Serializer<T> serializer,
Class<? extends T> type) |
<T> GensonBuilder |
GensonBuilder.withSerializer(Serializer<T> serializer,
GenericType<? extends T> type) |
GensonBuilder |
GensonBuilder.withSerializerFactory(Factory<? extends Serializer<?>> factory)
Registers serializer factories.
|
GensonBuilder |
GensonBuilder.withSerializers(Serializer<?>... serializer) |
GensonBuilder |
GensonBuilder.wrapRootValues(String inputKey,
String outputKey)
Will wrap all the root objects under outputKey during serializaiton and unwrap the content under
inputKey during deserializaiton.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
GensonBundle.configure(GensonBuilder builder)
This method does not provide any guarantee to when it is called: before user config, during,
or after.
|
BeanDescriptorProvider |
GensonBundle.createBeanDescriptorProvider(AbstractBeanDescriptorProvider.ContextualConverterFactory contextualConverterFactory,
BeanPropertyFactory propertyFactory,
BeanMutatorAccessorResolver propertyResolver,
PropertyNameResolver nameResolver,
GensonBuilder builder) |
Modifier and Type | Method and Description |
---|---|
void |
GuavaBundle.configure(GensonBuilder builder) |
Modifier and Type | Method and Description |
---|---|
void |
JAXBBundle.configure(GensonBuilder builder) |
Modifier and Type | Method and Description |
---|---|
void |
JodaTimeBundle.configure(GensonBuilder builder) |
Modifier and Type | Method and Description |
---|---|
void |
JSR353Bundle.configure(GensonBuilder builder) |
Copyright © 2019. All rights reserved.