All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.twitter.finatra.json.internal.caseclass.guice.GuiceInjectableValues.scala Maven / Gradle / Ivy

package com.twitter.finatra.json.internal.caseclass.guice

import com.fasterxml.jackson.databind.{BeanProperty, DeserializationContext, InjectableValues}
import com.google.inject.{Injector, Key}

class GuiceInjectableValues(injector: Injector) extends InjectableValues {
  override def findInjectableValue(valueId: Object, ctxt: DeserializationContext, forProperty: BeanProperty, beanInstance: Object): Object = {
    val key = valueId.asInstanceOf[Key[_]]
    injector.getInstance(key)
      .asInstanceOf[Object]
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy