JiBX
  1. JiBX
  2. JIBX-36

Custom unmarshallar unmarshal method always gets passed null object reference

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-beta3c
    • Fix Version/s: 1.0-RC0
    • Component/s: core
    • Labels:
      None
    • Number of attachments :
      0

      Description

      When writing a custom unmarshaller the initial call to IUnmarshaller.unmarshal() alwasy has a null object refererence. This is a problem when the object has been instatiated by the constructor of the enclosing object.

      For example:
      The class file:

      public class Notation {
      private string name;
      private HTMLDocument notation;

      public Notation

      { notation = new HTMLDocument(); }

      }

      The Binding file:
      <binding>
      <mapping class="javax.swing.text.html.HTMLDocument" name="comment"
      marshaller="HTMLListMapper"
      unmarshaller="HTMLListMapper">
      </mapping>

      <mapping name="notation" class="Notation">
      <value name="name" field="name"/>
      <structure field="comment" usage="optional"/>
      </mapping>
      </binding>

      public class HTMLListMapper implements IMarshaller, IUnmarshaller, IAliasable
      {

      public Object unmarshal(Object obj, IUnmarshallingContext ictx);
      }

      When HTMLListMapper.unmarshal() gets called, obj is null and the unmarshal method is expected to create the HTMLDocument. What should happen in the HTMLDocument reference from the Notation class should be passed instead.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Dennis Sosnoski
            Reporter:
            Thomas Jones-Low
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: