Top Inners Fields Constructors Methods
tools.jackson.dataformat.javaprop

public Class JavaPropsMapper

extends ObjectMapper
Class Inheritance
Imports
java.io.IOException, java.util.*, tools.jackson.core.JsonParser, .Version, tools.jackson.databind.DeserializationContext, .DeserializationFeature, .JavaType, .ObjectMapper, tools.jackson.databind.cfg.*, tools.jackson.databind.ser.SerializationContextExt

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
JavaPropsMapper.Builder

Base implementation for "Vanilla" ObjectMapper, used with Java Properties backend.

private static class
JavaPropsMapper.SharedWrapper

Helper class to contain dynamically constructed "shared" instance of mapper, should one be needed via shared.

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from tools.jackson.databind.ObjectMapper:
_deserializationConfig_deserializationContexts_injectableValues_rootDeserializers_savedBuilderState_serializationConfig_serializationContexts_streamFactory_typeFactory

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
protected Properties
_env()

public static JavaPropsMapper.Builder
public static JavaPropsMapper.Builder
builder(JavaPropsFactory streamFactory)

public <T> T
readEnvVariablesAs(JavaPropsSchema schema, Class<T> valueType)

Convenience method, functionally equivalent to:

   readPropertiesAs(convertMapToProperties(System.getenv()), schema, valueType);
public <T> T
readEnvVariablesAs(JavaPropsSchema schema, JavaType valueType)

Convenience method, functionally equivalent to:

   readPropertiesAs(convertMapToProperties(System.getenv()), schema, valueType);
public <T> T
readMapAs(Map<String, String> map, JavaPropsSchema schema, Class<T> valueType)

Convenience method which uses given `Properties` as the source as if they had been read from an external source, processes them (splits paths etc), and then binds as given result value.

public <T> T
readMapAs(Map<String, String> map, JavaPropsSchema schema, JavaType valueType)

Convenience method which uses given `Properties` as the source as if they had been read from an external source, processes them (splits paths etc), and then binds as given result value.

public <T> T
readMapAs(Map<String, String> map, Class<T> valueType)

Convenience method, functionally equivalent to:

   readPropertiesAs(props, JavaPropsSchema.emptySchema(), valueType);
public <T> T
readMapAs(Map<String, String> map, JavaType valueType)

Convenience method, functionally equivalent to:

   readPropertiesAs(props, JavaPropsSchema.emptySchema(), valueType);
public <T> T
readPropertiesAs(Properties props, JavaPropsSchema schema, Class<T> valueType)

Convenience method which uses given `Properties` as the source as if they had been read from an external source, processes them (splits paths etc), and then binds as given result value.

public <T> T
readPropertiesAs(Properties props, JavaPropsSchema schema, JavaType valueType)

Convenience method which uses given `Properties` as the source as if they had been read from an external source, processes them (splits paths etc), and then binds as given result value.

public <T> T
readPropertiesAs(Properties props, Class<T> valueType)

Convenience method, functionally equivalent to:

   readPropertiesAs(props, JavaPropsSchema.emptySchema(), valueType);
public <T> T
readPropertiesAs(Properties props, JavaType valueType)

Convenience method, functionally equivalent to:

   readPropertiesAs(props, JavaPropsSchema.emptySchema(), valueType);
protected Object
public <T> T
readSystemPropertiesAs(JavaPropsSchema schema, Class<T> valueType)

Convenience method, functionally equivalent to:

   readPropertiesAs(System.getProperties(), schema, valueType);
public <T> T
readSystemPropertiesAs(JavaPropsSchema schema, JavaType valueType)

Convenience method, functionally equivalent to:

   readPropertiesAs(System.getProperties(), schema, valueType);
public JavaPropsMapper.Builder
rebuild()

Overrides tools.jackson.databind.ObjectMapper.rebuild.

Method for creating a new MapperBuilder for constructing differently configured ObjectMapper instance, starting with current configuration including base settings and registered modules.

public static JavaPropsMapper
shared()

Accessor method for getting globally shared "default" JavaPropsMapper instance: one that has default configuration, no modules registered, no config overrides.

public JavaPropsFactory
tokenStreamFactory()

Overrides tools.jackson.databind.ObjectMapper.tokenStreamFactory.

Method that can be used to get hold of TokenStreamFactory that this mapper uses if it needs to construct JsonParsers and/or JsonGenerators.

public Version
version()

Overrides tools.jackson.databind.ObjectMapper.version.

Implements tools.jackson.core.Versioned.version.

Method that will return version information stored in and read from jar that contains this class.

protected Object
public void
writeValue(Map<?, ?> target, Object value)

Convenience method that "writes" given `value` as properties in given Map object.

public void
writeValue(Map<?, ?> target, Object value, JavaPropsSchema schema)

Convenience method that "writes" given `value` as properties in given Map object.

public Map<String, String>
writeValueAsMap(Object value)

Convenience method that serializes given value but so that results are stored in a newly constructed Properties.

public Map<String, String>
writeValueAsMap(Object value, JavaPropsSchema schema)

Convenience method that serializes given value but so that results are stored in given Properties instance.

public Properties
writeValueAsProperties(Object value)

Convenience method that serializes given value but so that results are stored in a newly constructed Properties.

public Properties
writeValueAsProperties(Object value, JavaPropsSchema schema)

Convenience method that serializes given value but so that results are stored in given Properties instance.

Inherited from tools.jackson.databind.ObjectMapper:
_assertNotNull_configAndWriteValue_convert_deserializationContext_deserializationContext_deserializationContext_findRootDeserializer_initForReading_newReader_newReader_newWriter_newWriter_newWriter_readMapAndClose_readTreeAndClose_readValue_serializationContext_serializationContext_verifyNoTrailingTokens_verifySchemaType_writeCloseableValueacceptJsonFormatVisitoracceptJsonFormatVisitoracceptJsonFormatVisitorbooleanNodeclearCachesconstructTypeconstructTypeconvertValueconvertValueconvertValuecreateArrayNodecreateGeneratorcreateGeneratorcreateGeneratorcreateGeneratorcreateGeneratorcreateGeneratorcreateNonBlockingByteArrayParsercreateNonBlockingByteBufferParsercreateObjectNodecreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParserdeserializationConfiggetInjectableValuesgetNodeFactorygetTypeFactoryisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledmissingNodenullNodereaderreaderreaderreaderreaderreaderreaderreaderreaderreaderForreaderForreaderForreaderForArrayOfreaderForListOfreaderForMapOfreaderForUpdatingreaderWithViewreadTreereadTreereadTreereadTreereadTreereadTreereadTreereadTreereadTreereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuesreadValuesreadValuesregisteredModulesserializationConfigstringNodetreeAsTokenstreeToValuetreeToValuetreeToValueupdateValuevalueToTreewriterwriterwriterwriterwriterwriterwriterwriterwriterwriterwriterForwriterForwriterForwriterWithDefaultPrettyPrinterwriterWithViewwriteTreewriteValuewriteValuewriteValuewriteValuewriteValuewriteValuewriteValueAsByteswriteValueAsStringwriteValueIntoBuffer

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides tools.jackson.databind.ObjectMapper.serialVersionUID.

Constructor Detail

JavaPropsMapperback to summary
public JavaPropsMapper()
JavaPropsMapperback to summary
public JavaPropsMapper(JavaPropsFactory f)
JavaPropsMapperback to summary
public JavaPropsMapper(JavaPropsMapper.Builder b)

Method Detail

_envback to summary
protected Properties _env()
builderback to summary
public static JavaPropsMapper.Builder builder()
builderback to summary
public static JavaPropsMapper.Builder builder(JavaPropsFactory streamFactory)
readEnvVariablesAsback to summary
public <T> T readEnvVariablesAs(JavaPropsSchema schema, Class<T> valueType) throws IOException

Convenience method, functionally equivalent to:

   readPropertiesAs(convertMapToProperties(System.getenv()), schema, valueType);
readEnvVariablesAsback to summary
public <T> T readEnvVariablesAs(JavaPropsSchema schema, JavaType valueType) throws IOException

Convenience method, functionally equivalent to:

   readPropertiesAs(convertMapToProperties(System.getenv()), schema, valueType);
readMapAsback to summary
public <T> T readMapAs(Map<String, String> map, JavaPropsSchema schema, Class<T> valueType) throws IOException

Convenience method which uses given `Properties` as the source as if they had been read from an external source, processes them (splits paths etc), and then binds as given result value.

Note that this is NOT identical to calling convertValue(Object, Class); rather, it would be similar to writing `Properties` out into a File, then calling `readValue()` on this mapper to bind contents.

Annotations
@SuppressWarnings:resource
readMapAsback to summary
public <T> T readMapAs(Map<String, String> map, JavaPropsSchema schema, JavaType valueType) throws IOException

Convenience method which uses given `Properties` as the source as if they had been read from an external source, processes them (splits paths etc), and then binds as given result value.

Note that this is NOT identical to calling convertValue(Object, Class); rather, it would be similar to writing `Properties` out into a File, then calling `readValue()` on this mapper to bind contents.

Annotations
@SuppressWarnings:resource, unchecked
readMapAsback to summary
public <T> T readMapAs(Map<String, String> map, Class<T> valueType) throws IOException

Convenience method, functionally equivalent to:

   readPropertiesAs(props, JavaPropsSchema.emptySchema(), valueType);
readMapAsback to summary
public <T> T readMapAs(Map<String, String> map, JavaType valueType) throws IOException

Convenience method, functionally equivalent to:

   readPropertiesAs(props, JavaPropsSchema.emptySchema(), valueType);
readPropertiesAsback to summary
public <T> T readPropertiesAs(Properties props, JavaPropsSchema schema, Class<T> valueType) throws IOException

Convenience method which uses given `Properties` as the source as if they had been read from an external source, processes them (splits paths etc), and then binds as given result value.

Note that this is NOT identical to calling convertValue(Object, Class); rather, it would be similar to writing `Properties` out into a File, then calling `readValue()` on this mapper to bind contents.

Annotations
@SuppressWarnings:resource
readPropertiesAsback to summary
public <T> T readPropertiesAs(Properties props, JavaPropsSchema schema, JavaType valueType) throws IOException

Convenience method which uses given `Properties` as the source as if they had been read from an external source, processes them (splits paths etc), and then binds as given result value.

Note that this is NOT identical to calling convertValue(Object, Class); rather, it would be similar to writing `Properties` out into a File, then calling `readValue()` on this mapper to bind contents.

Annotations
@SuppressWarnings:resource, unchecked
readPropertiesAsback to summary
public <T> T readPropertiesAs(Properties props, Class<T> valueType) throws IOException

Convenience method, functionally equivalent to:

   readPropertiesAs(props, JavaPropsSchema.emptySchema(), valueType);
readPropertiesAsback to summary
public <T> T readPropertiesAs(Properties props, JavaType valueType) throws IOException

Convenience method, functionally equivalent to:

   readPropertiesAs(props, JavaPropsSchema.emptySchema(), valueType);
readResolveback to summary
protected Object readResolve()

Overrides tools.jackson.databind.ObjectMapper.readResolve.

Annotations
@Override
readSystemPropertiesAsback to summary
public <T> T readSystemPropertiesAs(JavaPropsSchema schema, Class<T> valueType) throws IOException

Convenience method, functionally equivalent to:

   readPropertiesAs(System.getProperties(), schema, valueType);
readSystemPropertiesAsback to summary
public <T> T readSystemPropertiesAs(JavaPropsSchema schema, JavaType valueType) throws IOException

Convenience method, functionally equivalent to:

   readPropertiesAs(System.getProperties(), schema, valueType);
rebuildback to summary
public JavaPropsMapper.Builder rebuild()

Overrides tools.jackson.databind.ObjectMapper.rebuild.

Doc from tools.jackson.databind.ObjectMapper.rebuild.

Method for creating a new MapperBuilder for constructing differently configured ObjectMapper instance, starting with current configuration including base settings and registered modules.

Annotations
@SuppressWarnings:unchecked
@Override
sharedback to summary
public static JavaPropsMapper shared()

Accessor method for getting globally shared "default" JavaPropsMapper instance: one that has default configuration, no modules registered, no config overrides. Usable mostly when dealing "untyped" or Tree-style content reading and writing.

tokenStreamFactoryback to summary
public JavaPropsFactory tokenStreamFactory()

Overrides tools.jackson.databind.ObjectMapper.tokenStreamFactory.

Doc from tools.jackson.databind.ObjectMapper.tokenStreamFactory.

Method that can be used to get hold of TokenStreamFactory that this mapper uses if it needs to construct JsonParsers and/or JsonGenerators.

Warning

note that all ObjectReader and ObjectWriter instances created by this mapper usually share the same configured TokenStreamFactory, so changes to its configuration will "leak". To avoid such observed changes you should always use "with()" and "without()" method of ObjectReader and ObjectWriter for changing StreamReadFeature and StreamWriteFeature settings to use on per-call basis.

Annotations
@Override
versionback to summary
public Version version()

Overrides tools.jackson.databind.ObjectMapper.version.

Implements tools.jackson.core.Versioned.version.

Doc from tools.jackson.databind.ObjectMapper.version.

Method that will return version information stored in and read from jar that contains this class.

Annotations
@Override
writeReplaceback to summary
protected Object writeReplace()

Overrides tools.jackson.databind.ObjectMapper.writeReplace.

Annotations
@Override
writeValueback to summary
public void writeValue(Map<?, ?> target, Object value) throws IOException

Convenience method that "writes" given `value` as properties in given Map object.

writeValueback to summary
public void writeValue(Map<?, ?> target, Object value, JavaPropsSchema schema) throws IOException

Convenience method that "writes" given `value` as properties in given Map object.

writeValueAsMapback to summary
public Map<String, String> writeValueAsMap(Object value) throws IOException

Convenience method that serializes given value but so that results are stored in a newly constructed Properties. Functionally equivalent to serializing in a File and reading contents into Properties.

writeValueAsMapback to summary
public Map<String, String> writeValueAsMap(Object value, JavaPropsSchema schema) throws IOException

Convenience method that serializes given value but so that results are stored in given Properties instance.

writeValueAsPropertiesback to summary
public Properties writeValueAsProperties(Object value) throws IOException

Convenience method that serializes given value but so that results are stored in a newly constructed Properties. Functionally equivalent to serializing in a File and reading contents into Properties.

writeValueAsPropertiesback to summary
public Properties writeValueAsProperties(Object value, JavaPropsSchema schema) throws IOException

Convenience method that serializes given value but so that results are stored in given Properties instance.

tools.jackson.dataformat.javaprop back to summary

public Class JavaPropsMapper.Builder

extends MapperBuilder<JavaPropsMapper, JavaPropsMapper.Builder>
Class Inheritance

Base implementation for "Vanilla" ObjectMapper, used with Java Properties backend.
Since
3.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class

Field Summary

Inherited from tools.jackson.databind.cfg.MapperBuilder:
_abstractTypeResolvers_baseSettings_classIntrospector_coercionConfigs_configOverrides_datatypeFeatures_defaultAttributes_defaultPrettyPrinter_deserFeatures_deserializationContexts_deserializerFactory_filterProvider_formatReadFeatures_formatWriteFeatures_injectableValues_mapperFeatures_mixInHandler_modules_problemHandlers_savedState_serFeatures_serializationContexts_serializerFactory_streamFactory_streamReadFeatures_streamWriteFeatures_subtypeResolver_typeFactory_typeResolverProviderDEFAULT_ACCESSOR_NAMINGDEFAULT_ANNOTATION_INTROSPECTORDEFAULT_BASE_SETTINGSDEFAULT_DESER_FEATURESDEFAULT_MAPPER_FEATURESDEFAULT_PRETTY_PRINTERDEFAULT_SER_FEATURESDEFAULT_TYPE_RESOLVER_PROVIDERDEFAULT_TYPE_VALIDATORNO_ABSTRACT_TYPE_RESOLVERS

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
protected MapperBuilderState
public JavaPropsMapper
build()

Implements abstract tools.jackson.databind.cfg.MapperBuilder.build.

Method to call to create actual mapper instance.

Inherited from tools.jackson.databind.cfg.MapperBuilder:
_constructModuleContext_defaultClassIntrospector_defaultDefaultAttributes_defaultDefaultTypingResolver_defaultDefaultTypingResolver_defaultDeserializationContexts_defaultMixInHandler_defaultPrettyPrinter_defaultSerializationContexts_defaultSerializerFactory_defaultSubtypeResolver_defaultTypeFactory_defaultTypeResolverProvider_thisaccessorNamingactivateDefaultTypingactivateDefaultTypingactivateDefaultTypingactivateDefaultTypingAsPropertyaddAbstractTypeResolveraddHandleraddMixInaddMixInsaddModuleaddModulesaddModulesaddTypeModifierannotationIntrospectorannotationIntrospectorbaseSettingsbaseSettingsbuildDeserializationConfigbuildSerializationConfigcacheProviderchangeDefaultNullHandlingchangeDefaultPropertyInclusionchangeDefaultVisibilityclassIntrospectorclassIntrospectorclearProblemHandlersconfigureconfigureconfigureconfigureconfigureconfigureconfigureForJackson2constructorDetectordatatypeFeaturesdeactivateDefaultTypingdefaultAttributesdefaultAttributesdefaultBase64VariantdefaultDateFormatdefaultLeniencydefaultLocaledefaultMergeabledefaultPrettyPrinterdefaultPrettyPrinterdefaultTimeZonedeserializationContextsdeserializationContextsdeserializationProblemHandlersdeserializerFactorydeserializerFactorydisabledisabledisabledisabledisabledisableenableenableenableenableenableenableenumNamingStrategyfilterProviderfilterProviderfindAndAddModulesfindAndAddModulesfindModulesfindModuleshandlerInstantiatorinjectableValuesinjectableValuesisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledmixInHandlermixInHandlermixInOverridesnodeFactorypolymorphicTypeValidatorpropertyNamingStrategyregisterSubtypesregisterSubtypesregisterSubtypesremoveAllModulesremoveMixInsaveStateApplyModulesserializationContextsserializationContextsserializerFactoryserializerFactorysetDefaultTypingstreamFactorysubtypeResolversubtypeResolvertypeFactorytypeFactorytypeResolverProvidertypeResolverProviderwithAllCoercionConfigswithAllConfigOverrideswithCoercionConfigwithCoercionConfigwithCoercionConfigDefaultswithConfigOverridewithModules

Constructor Detail

Builderback to summary
public Builder(JavaPropsFactory f)
Builderback to summary
public Builder(JavaPropsMapper.Builder.StateImpl state)

Method Detail

_saveStateback to summary
protected MapperBuilderState _saveState()

Implements abstract tools.jackson.databind.cfg.MapperBuilder._saveState.

Annotations
@Override
buildback to summary
public JavaPropsMapper build()

Implements abstract tools.jackson.databind.cfg.MapperBuilder.build.

Doc from tools.jackson.databind.cfg.MapperBuilder.build.

Method to call to create actual mapper instance.

Implementation detail: usually construction occurs by passing this builder instance to constructor of specific mapper type builder builds.

Annotations
@Override
tools.jackson.dataformat.javaprop back to summary

protected Class JavaPropsMapper.Builder.StateImpl

extends MapperBuilderState
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected Object
readResolve()

Implements abstract tools.jackson.databind.cfg.MapperBuilderState.readResolve.

Method required to support JDK deserialization; made `abstract` here to ensure sub-classes must implement it.

Inherited from tools.jackson.databind.cfg.MapperBuilderState:
modules

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides tools.jackson.databind.cfg.MapperBuilderState.serialVersionUID.

Constructor Detail

StateImplback to summary
public StateImpl(JavaPropsMapper.Builder src)

Method Detail

readResolveback to summary
protected Object readResolve()

Implements abstract tools.jackson.databind.cfg.MapperBuilderState.readResolve.

Doc from tools.jackson.databind.cfg.MapperBuilderState.readResolve.

Method required to support JDK deserialization; made `abstract` here to ensure sub-classes must implement it.

Annotations
@Override
tools.jackson.dataformat.javaprop back to summary

private final Class JavaPropsMapper.SharedWrapper

extends Object
Class Inheritance
  • java.lang.Object
  • tools.jackson.dataformat.javaprop.JavaPropsMapper.SharedWrapper

Helper class to contain dynamically constructed "shared" instance of mapper, should one be needed via shared.

Field Summary

Modifier and TypeField and Description
private static final JavaPropsMapper

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static JavaPropsMapper
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MAPPERback to summary
private static final JavaPropsMapper MAPPER

Constructor Detail

SharedWrapperback to summary
private SharedWrapper()

Method Detail

wrappedback to summary
public static JavaPropsMapper wrapped()