Closed GoogleCodeExporter closed 9 years ago
In case of a few constructors with 1 argument it requires more "artificial
intelligence" to pick up the proper one.
N.B. Instead of "ConstructCustom implements Construct" you can use
"ConstructCustom
extends AbstractConstruct". Then you do not have to implement
"construct2ndStep(Node
node, Object object)". (Anyway the ConstructCustom implementation does not
support
recursive structures)
Original comment by aso...@gmail.com
on 5 Aug 2009 at 12:24
in case there is more then 1 constructor with 1 argument to create an instance
for
scalar node and a global or local tag does not allow to rely on the implicit
type
then try to use the constructor with the String argument
Original comment by aso...@gmail.com
on 5 Aug 2009 at 12:59
but why does it work fine when the object is outside of a JavaBean? also, it
seems to
pick the correct constructor in version 1.3 and before..
Original comment by infinity0x@gmail.com
on 5 Aug 2009 at 1:54
You are right. Inside the JavaBean the custom constructor is not respected. I
will
try to improve it.
Original comment by aso...@gmail.com
on 5 Aug 2009 at 8:45
Fixed.
Now I create a Java instance with the following priority to choose the class:
Explicit tag -> Runtime class (defined in JavaBean) -> implicit tag
A custom constructor is always respected.
Please check YamlMapTest.
Original comment by py4fun@gmail.com
on 6 Aug 2009 at 12:41
yup, this is now fixed. thank you :)
Original comment by infinity0x@gmail.com
on 6 Aug 2009 at 2:54
Original comment by aso...@gmail.com
on 6 Aug 2009 at 9:58
Original comment by aso...@gmail.com
on 6 Aug 2009 at 10:03
Original issue reported on code.google.com by
infinity0x@gmail.com
on 5 Aug 2009 at 9:11