Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8115029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:19:52+00:00 2026-06-06T03:19:52+00:00

I have a bunch of third-party Java classes that use different property names for

  • 0

I have a bunch of third-party Java classes that use different property names for what are essentially the same property:

public class Foo {
   public String getReferenceID();
   public void setReferenceID(String id);
   public String getFilename();
   public void setFilename(String fileName);
}

public class Bar {
   public String getRefID();
   public void setRefID(String id);
   public String getFileName();
   public void setFileName(String fileName);
}

I’d like to be able to address these in a canonicalized form, so that I can treat them polymorphically, and so that I can do stuff with Apache BeanUtils like:

PropertyUtils.copyProperties(object1,object2);

Clearly it would be trivial to write an Adapter for each class …

public class CanonicalizedBar implements CanonicalizedBazBean {
    public String getReferenceID() {
        return this.delegate.getRefID();
    }
    // etc.
}

But I wonder is there something out there more generalized and dynamic? Something that would take a one-to-many map of property name equivalences, and a delegate class, and produce the Adapter?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:19:54+00:00Added an answer on June 6, 2026 at 3:19 am

    I’ve never used it, but I think you’re looking for Dozer:

    Dozer is a Java Bean to Java Bean mapper that recursively copies data
    from one object to another. Typically, these Java Beans will be of
    different complex types.

    Dozer supports simple property mapping, complex type mapping,
    bi-directional mapping, implicit-explicit mapping, as well as
    recursive mapping. This includes mapping collection attributes that
    also need mapping at the element level.

    Dozer not only supports mapping between attribute names, but also
    automatically converting between types. Most conversion scenarios are
    supported out of the box, but Dozer also allows you to specify custom
    conversions via XML.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of images held on a third party server that I
I'm working on a third-party program that aggregates data from a bunch of different,
I have a WinForms application with a bunch of third party references. This makes
I have bunch of objects that return a DOM-tree that I then use to
We have a third party application that accept calls using an XML RPC mechanism
I have a category class that I want to Use that acts on a
we are using some third-party library that have some dependencies that must be referenced
I have a bunch of generic code that is used a lot, which i'd
I have a bunch of python methods that follow this pattern: def delete_session(guid): conn
I have a bunch of eclipse plugins that depend on a bundle that contains

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.