Closed
Description
(copied from [http://jira.codehaus.org/browse/JACKSON-304] -- see details)
(by James Strachan, Greg Zoller)
It doesn't feel very dry doing Scala with Jackson...
@BeanInfo class Position {
@BeanProperty
var x: Double = _
@BeanProperty
var y: Double = _
override def toString = "Position(" + x + "," + y + ")"
}
when it would be much nicer to be able to do
case class Position(x: Double, y: Double)
The main issue is that this class is immutable and that (ii) there are no fields/setters to call when deserializing, just a constructor.
Though when serializing the fields can be used.
Unfortunately Scala doesn't yet seem to support an easy way to iterate through the product field names & constructor argument names AFAIK so until Scala offers more reflection help this might be tricky...
Metadata
Metadata
Assignees
Labels
No labels