#296 Add ability to define is-accessible at the type level

Dozer v5.3.2
closed-fixed
5
2010-12-28
2010-12-01
Anonymous
No

Hi

Add ability to define is-accessible at the type level (ie for all the fields of a given type)
Sometimes the use (or not ) of getter and setter is more a programming style, and we may wish to apply this style to the entire type,
without defining all fields.

Possible syntax :
<mapping>
<class-a is-all-accessible="false">org.dozer.vo.TestObject</class-a>
<class-b is-all-accessible="true">org.dozer.vo.TestObjectPrime</class-b>
</mapping>

Thanks

Discussion

  • dmitry (lv)

    dmitry (lv) - 2010-12-28
    • milestone: 1323099 --> Dozer v5.3.2
    • assigned_to: nobody --> buzdin
    • status: open --> closed-fixed
     
  • dmitry (lv)

    dmitry (lv) - 2010-12-28

    done. the same attribute name is-accessible is used.
    you can override the behavior of particular fields even if is-accessible is set for the whole class.

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2011-08-04

    Hey, not sure if I'm miss understanding this feature as it was released in 5.3.2...

    I'm trying to map a class that has only public fields with no getters/setters to another class that has getters/setters. I provide a mapping similar to this in xml:
    <mapping>
    <class-a is-accessible="true">Object.that.has.no.getters.setters</class-a>
    <class-b>object.with.getters.setters</class-b>
    </mapping>

    When I perform the map in the program I don't get any data in the produced object. Isn't the class level is-accessible flag supposed to act as if i had explicitly put the flag for each of the fields? Is the behavior I'm seeing a bug?

    Explicitly using the flag on the fields does work but this requires me to define field mappings for all the fields.

     

Log in to post a comment.

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

Sign up for the SourceForge newsletter:





No, thanks