#85 Private constructor support when creating new instance

closed
None
5
2007-04-04
2007-03-29
No

For dest objects without a no arg public constructor, look for private no arg constructor.

Should this happen by default or does it need to be configurable via "is-accessible" ??

Discussion

  • Matt Tierney

    Matt Tierney - 2007-03-29

    Logged In: YES
    user_id=1236069
    Originator: YES

    What about being able to specify in the Global Configuration block a List of Classes that can instantiated via private constructors?

    It seems like a good idea

     
  • Matt Tierney

    Matt Tierney - 2007-03-30
    • assigned_to: nobody --> mhtierney
     
  • Matt Tierney

    Matt Tierney - 2007-03-30

    Logged In: YES
    user_id=1236069
    Originator: YES

    I am going to go down the path of automatically looking for a private no arg constructor if a public no arg constructor can be found

     
  • Matt Tierney

    Matt Tierney - 2007-03-30

    Logged In: YES
    user_id=1236069
    Originator: YES

    If no public no arg constructor is found, dozer will auto detect a private constructor and just use that one.

     
  • Matt Tierney

    Matt Tierney - 2007-03-30
    • status: open --> pending
     
  • Matt Tierney

    Matt Tierney - 2007-04-04
    • status: pending --> closed
     
  • Sreekar Muddu

    Sreekar Muddu - 2010-10-19

    How about adding support for the below cases?
    1. Class having only a private overloaded constructor. Class does not have a public or private no-arg constructor?
    2. Class has a static inner factory class. Dozer allows to specify a create method in a factory class but there is no way to do this if the factory class is a static inner class.
    <b create-method="com.dozer.test.Factory.create">field</b> - WORKING
    <class-a create-method="com.dozer.test.MyBean$Factory.fromValue"> - NOT WORKING

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks