@@ -4,6 +4,7 @@ package uk.q3c.util.guice
44import com.google.inject.AbstractModule
55import com.google.inject.BindingAnnotation
66import com.google.inject.Inject
7+ import com.google.inject.Injector
78import com.google.inject.Key
89import com.google.inject.spi.InjectionPoint
910import org.apache.commons.lang3.reflect.FieldUtils
@@ -25,11 +26,12 @@ interface SerializationSupport : Serializable {
2526 * Simply combines the other two calls [injectTransientFields] and [checkForNullTransients]
2627 */
2728 fun deserialize (target : Any )
29+
30+ fun getInjector (): Injector
2831}
2932
3033
3134class DefaultSerializationSupport @Inject constructor(val injectorLocator : InjectorLocator ) : SerializationSupport {
32-
3335 private var log = LoggerFactory .getLogger(this .javaClass.name)
3436 private val candidateFieldKeys: MutableMap <Field , Key <* >> = mutableMapOf ()
3537 private val unResolvedFieldKeys: MutableMap <Field , Key <* >> = mutableMapOf ()
@@ -67,6 +69,11 @@ class DefaultSerializationSupport @Inject constructor(val injectorLocator: Injec
6769
6870 }
6971
72+ override fun getInjector (): Injector {
73+ return injectorLocator.get()
74+ }
75+
76+
7077 private fun createFieldKey (field : Field ): Key <* > {
7178 val genericType = field.genericType
7279 val fieldAnnotations = field.declaredAnnotations
0 commit comments