Top Description Fields Constructors Methods
tools.jackson.module.osgi

public Class OsgiInjectableValues

extends InjectableValues
Class Inheritance
Imports
org.osgi.framework.BundleContext, .InvalidSyntaxException, .ServiceReference, tools.jackson.databind.BeanProperty, .DeserializationContext, .InjectableValues

Injects OSGI services in deserialized objects
Use the com.fasterxml.jackson.annotation.JacksonInject in the constructor parameters or the class members ask for injecting a matching OSGI services. Use the com.fasterxml.jackson.annotation.JacksonInject#value() to specify an OSGI filter to select more accurately the OSGI services. Null is injected when no matching OSGI service is registered.

Field Summary

Modifier and TypeField and Description
private final BundleContext

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
findInjectableValue(DeserializationContext ctxt, Object valueId, BeanProperty forProperty, Object beanInstance, Boolean optional, Boolean useInput)

Implements abstract tools.jackson.databind.InjectableValues.findInjectableValue.

Method called to find value identified by id valueId to inject as value of specified property during deserialization, passing POJO instance in which value will be injected if it is available (will be available when injected via field or setter; not available when injected via constructor or factory method argument).

private Object
findService(String type, String filter)

private String
private static String
public InjectableValues
snapshot()

Implements tools.jackson.core.util.Snapshottable.snapshot.

Method to call to get an instance that may not be modified through any other object, including `this`.

Field Detail

bundleContextback to summary
private final BundleContext bundleContext

Constructor Detail

OsgiInjectableValuesback to summary
public OsgiInjectableValues(BundleContext bundleContext)

Method Detail

findInjectableValueback to summary
public Object findInjectableValue(DeserializationContext ctxt, Object valueId, BeanProperty forProperty, Object beanInstance, Boolean optional, Boolean useInput)

Implements abstract tools.jackson.databind.InjectableValues.findInjectableValue.

Doc from tools.jackson.databind.InjectableValues.findInjectableValue.

Method called to find value identified by id valueId to inject as value of specified property during deserialization, passing POJO instance in which value will be injected if it is available (will be available when injected via field or setter; not available when injected via constructor or factory method argument).

Annotations
@Override
findServiceback to summary
private Object findService(String type, String filter)
serviceFilterback to summary
private String serviceFilter(Object valueId)
serviceTypeback to summary
private static String serviceType(BeanProperty forProperty)
snapshotback to summary
public InjectableValues snapshot()

Implements tools.jackson.core.util.Snapshottable.snapshot.

Doc from tools.jackson.core.util.Snapshottable.snapshot.

Method to call to get an instance that may not be modified through any other object, including `this`. That instance may be `this` if (and only if) this instance is effectively immutable (unmodifiable) through its API: if this is not the case, a new copy with same configuration must be created and returned.

Annotations
@Override