JsonPostDeserialize Annotation

Annotation to denote to denote methods to run post deserialize

Лицензия

Лицензия

APLv2.0
Категории

Категории

Jackson Данные JSON
Группа

Группа

org.goots.jackson
Идентификатор

Идентификатор

deserializer
Последняя версия

Последняя версия

0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

JsonPostDeserialize Annotation
Annotation to denote to denote methods to run post deserialize
Ссылка на сайт

Ссылка на сайт

http://github.com/rnc/jackson-annotation
Система контроля версий

Система контроля версий

http://github.com/rnc/jackson-annotation

Скачать deserializer

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.goots.jackson/deserializer/ -->
<dependency>
    <groupId>org.goots.jackson</groupId>
    <artifactId>deserializer</artifactId>
    <version>0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.goots.jackson/deserializer/
implementation 'org.goots.jackson:deserializer:0.1'
// https://jarcasting.com/artifacts/org.goots.jackson/deserializer/
implementation ("org.goots.jackson:deserializer:0.1")
'org.goots.jackson:deserializer:jar:0.1'
<dependency org="org.goots.jackson" name="deserializer" rev="0.1">
  <artifact name="deserializer" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.goots.jackson', module='deserializer', version='0.1')
)
libraryDependencies += "org.goots.jackson" % "deserializer" % "0.1"
[org.goots.jackson/deserializer "0.1"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
com.fasterxml.jackson.core : jackson-databind jar 2.10.0.pr1
com.fasterxml.jackson.core : jackson-core jar 2.10.0.pr1
org.slf4j : slf4j-api jar 1.7.25

test (5)

Идентификатор библиотеки Тип Версия
org.codehaus.groovy : groovy jar 2.5.9
org.codehaus.groovy : groovy-json jar 2.5.9
ch.qos.logback : logback-classic jar 1.2.3
junit : junit jar 4.12
com.github.stefanbirkner : system-rules jar 1.18.0

Модули Проекта

Данный проект не имеет модулей.

Build Status (Travis CI)

Jackson Post Deserialization Annotation Hook

Overview

This code provides a simple annotation that may be placed upon a method (even a private method) which will be run upon completion of the deserialization.

This has been inspired by several stackoverflow posts:

and by the following Jackson issues

Usage

In order to use this annotation the ObjectMapper instance must be correctly configured. For example:

    ObjectMapper mapper = new ObjectMapper();
    mapper.registerModule( org.goots.jackson.deserializer.JacksonPostHookDeserializer.getSimpleModule() );

Then, place the annotation upon a method to run after deserialization e.g.

    @JsonPostDeserialize
    public void postDeserialize()
    {
        myObjects.forEach( { obj -> obj.postInit()})
    }

By default the annotation will not call private methods. To force access set the parameter as follows:

    @JsonPostDeserialize(forceAccess=true)
    private void postDeserialize()
    {
        myObjects.forEach( { obj -> obj.postInit()})
    }

Версии библиотеки

Версия
0.1