You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2005/04/13 23:04:00 UTC

DO NOT REPLY [Bug 34443] New: - [betwixt] Betwixt does not support polymorphic references

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34443>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34443

           Summary: [betwixt] Betwixt does not support polymorphic
                    references
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: major
          Priority: P2
         Component: Betwixt
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: tomdz@apache.org


Attached is a patch to commons-betwixt, SVN Head, that enables betwixt
to map polymorphic references. I.e. a class has a field of a type,
that itself or some of its subtypes are mapped:

class A
{
  private B obj;
}

interface B
{}

class C implements B
{}

class D implements B
{}

This in effect makes it necessary to make the 'name' attribute completely
optional (using the property name when necessary) in order to be able to use the
element definition from the class descriptor of the reference type:

<?xml version="1.0"?>
<betwixt-config>
  <class name="A">
    <element name="a">
      <element property="obj"/>
    </element>
  </class>
  <class name="C">
    <element name="c"/>
  </class>
  <class name="D">
    <element name="d"/>
  </class>
</betwixt-config>

In the current betwixt version, the name attribute of the element for obj is
requires so that the name of the created subelement does not depend on the
actual type of the reference.
The attached TestReferenceMapping provides a unit test for this
scenario.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org