Sitelet https://github.com/KrailOrg/q3c-util/commit/a5cb148dc86c10d89febea39a468723135f303f5
Skip to content

Commit a5cb148

Browse files
author
David Sowerby
committed
Updated Kotlin. Fix #11 getInjector() added to SerializationSupport
1 parent 77e494d commit a5cb148

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

‎build.gradle‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
buildscript {
2-
ext.kotlin_version = '1.2.31'
2+
ext.kotlin_version = '1.2.40'
33
ext.kaytee_plugin_version = "0.20.1.0"
44

55
repositories {
@@ -22,7 +22,7 @@ group = 'uk.q3c.util'
2222

2323
kaytee {
2424
version {
25-
number = "1.1.0.0"
25+
number = "1.2.0.0"
2626
}
2727
}
2828

‎src/main/kotlin/uk/q3c/util/guice/SerializationSupport.kt‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package uk.q3c.util.guice
44
import com.google.inject.AbstractModule
55
import com.google.inject.BindingAnnotation
66
import com.google.inject.Inject
7+
import com.google.inject.Injector
78
import com.google.inject.Key
89
import com.google.inject.spi.InjectionPoint
910
import 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

3134
class 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

Comments
 (0)