Top Description Fields Constructors Methods
tools.jackson.datatype.moneta

public final Class MonetaMoneyModule

extends JacksonModule
Class Inheritance
Annotations
@API
status:STABLE
Imports
javax.money.MonetaryAmount, .MonetaryOperator, .MonetaryRounding, javax.money.format.MonetaryFormats, org.apiguardian.api.API, org.javamoney.moneta.FastMoney, .Money, .RoundedMoney, tools.jackson.core.Version, tools.jackson.databind.JacksonModule, tools.jackson.databind.module.SimpleDeserializers, tools.jackson.datatype.javax.money.AmountWriter, .FieldNames, .JavaxMoneyModule, .MonetaryAmountDeserializer, .MonetaryAmountFactory, .MonetaryAmountFormatFactory

Module that adds support for Moneta types (FastMoney, Money, RoundedMoney) on top of the JavaxMoneyModule. Contains helper methods like withFastMoney(), withMoney(), withRoundedMoney() and withRoundedMoney(MonetaryOperator) that can be used to configure the module.

Field Summary

Modifier and TypeField and Description
private final JavaxMoneyModule
private final MonetaryAmountFactory<FastMoney>
private final MonetaryAmountFactory<Money>
private final FieldNames
private final MonetaryAmountFactory<RoundedMoney>

Constructor Summary

AccessConstructor and Description
public
private
MonetaMoneyModule(final JavaxMoneyModule baseModule, final FieldNames names, final MonetaryAmountFactory<FastMoney> fastMoneyFactory, final MonetaryAmountFactory<Money> moneyFactory, final MonetaryAmountFactory<RoundedMoney> roundedMoneyFactory)

Method Summary

Modifier and TypeMethod and Description
public String
getModuleName()

Implements abstract tools.jackson.databind.JacksonModule.getModuleName.

Method that returns a display that can be used by Jackson for informational purposes, as well as in associating extensions with module that provides them.

public void
setupModule(final JacksonModule.SetupContext context)

Implements abstract tools.jackson.databind.JacksonModule.setupModule.

Method called by ObjectMapper when module is registered.

public Version
version()

Implements abstract tools.jackson.databind.JacksonModule.version.

Implements tools.jackson.core.Versioned.version.

Method that returns version of this module.

public MonetaMoneyModule
public MonetaMoneyModule
public MonetaMoneyModule
public MonetaMoneyModule
public MonetaMoneyModule
public MonetaMoneyModule
public MonetaMoneyModule
private <T extends MonetaryAmount> MonetaMoneyModule
public MonetaMoneyModule

Returns:

new MonetaMoneyModule using Money
withMoney
()

public MonetaMoneyModule
withNumbers(final AmountWriter<?> writer)

public MonetaMoneyModule
public MonetaMoneyModule
public MonetaMoneyModule
public MonetaMoneyModule

Returns:

new MonetaMoneyModule using RoundedMoney with the given MonetaryRounding
withRoundedMoney
(final MonetaryOperator
the rounding operator
rounding
)

Inherited from tools.jackson.databind.JacksonModule:
getDependenciesgetRegistrationId

Field Detail

baseModuleback to summary
private final JavaxMoneyModule baseModule
fastMoneyFactoryback to summary
private final MonetaryAmountFactory<FastMoney> fastMoneyFactory
moneyFactoryback to summary
private final MonetaryAmountFactory<Money> moneyFactory
namesback to summary
private final FieldNames names
roundedMoneyFactoryback to summary
private final MonetaryAmountFactory<RoundedMoney> roundedMoneyFactory

Constructor Detail

MonetaMoneyModuleback to summary
public MonetaMoneyModule()
MonetaMoneyModuleback to summary
private MonetaMoneyModule(final JavaxMoneyModule baseModule, final FieldNames names, final MonetaryAmountFactory<FastMoney> fastMoneyFactory, final MonetaryAmountFactory<Money> moneyFactory, final MonetaryAmountFactory<RoundedMoney> roundedMoneyFactory)

Method Detail

getModuleNameback to summary
public String getModuleName()

Implements abstract tools.jackson.databind.JacksonModule.getModuleName.

Doc from tools.jackson.databind.JacksonModule.getModuleName.

Method that returns a display that can be used by Jackson for informational purposes, as well as in associating extensions with module that provides them.

Annotations
@Override
setupModuleback to summary
public void setupModule(final JacksonModule.SetupContext context)

Implements abstract tools.jackson.databind.JacksonModule.setupModule.

Doc from tools.jackson.databind.JacksonModule.setupModule.

Method called by ObjectMapper when module is registered. It is called to let module register functionality it provides, using callback methods passed-in context object exposes.

Annotations
@Override
versionback to summary
public Version version()

Implements abstract tools.jackson.databind.JacksonModule.version.

Implements tools.jackson.core.Versioned.version.

Doc from tools.jackson.databind.JacksonModule.version.

Method that returns version of this module. Can be used by Jackson for informational purposes.

Annotations
@Override
withAmountFieldNameback to summary
public MonetaMoneyModule withAmountFieldName(final String name)
withCurrencyFieldNameback to summary
public MonetaMoneyModule withCurrencyFieldName(final String name)
withDecimalNumbersback to summary
public MonetaMoneyModule withDecimalNumbers()
withDefaultFormattingback to summary
public MonetaMoneyModule withDefaultFormatting()
withFastMoneyback to summary
public MonetaMoneyModule withFastMoney()
Returns:MonetaMoneyModule

new MonetaMoneyModule using FastMoney

See Also
FastMoney
withFormattedFieldNameback to summary
public MonetaMoneyModule withFormattedFieldName(final String name)
withFormattingback to summary
public MonetaMoneyModule withFormatting(final MonetaryAmountFormatFactory formatFactory)
withMonetaryAmountFactoryback to summary
private <T extends MonetaryAmount> MonetaMoneyModule withMonetaryAmountFactory(final MonetaryAmountFactory<T> amountFactory)
withMoneyback to summary
public MonetaMoneyModule withMoney()
Returns:MonetaMoneyModule

new MonetaMoneyModule using Money

See Also
Money
withNumbersback to summary
public MonetaMoneyModule withNumbers(final AmountWriter<?> writer)
Annotations
@API
status:EXPERIMENTAL
withoutFormattingback to summary
public MonetaMoneyModule withoutFormatting()
withQuotedDecimalNumbersback to summary
public MonetaMoneyModule withQuotedDecimalNumbers()
withRoundedMoneyback to summary
public MonetaMoneyModule withRoundedMoney()
Returns:MonetaMoneyModule

new MonetaMoneyModule using RoundedMoney

See Also
RoundedMoney
withRoundedMoneyback to summary
public MonetaMoneyModule withRoundedMoney(final MonetaryOperator rounding)
Parameters
rounding:MonetaryOperator

the rounding operator

Returns:MonetaMoneyModule

new MonetaMoneyModule using RoundedMoney with the given MonetaryRounding

See Also
RoundedMoney