I have a JAR that contains the following Scala class:
class JsonAvroConverter(val sch : org.apache.avro.Schema) extends scala.AnyRef {
def toJson(avroData : org.json4s.JValue) : org.json4s.JValue = { /* compiled code */ }
}
Now I need to be able to call the methods in the class from inside a Java
project. I added Json4s
in my POM
and I have Json4s accessbile but I am not sure of a way to use that library from a Java context. I also tried doing something like this:
String myString = "{\"name\":\"bob\"}"
JsonMethods json = new Jsonmethods();
json.parse(myString);
But I am not able to instantiate JsonMethods
in the first place.