users@jaxb.java.net

More unmarshalling errors

From: Spies, Brennan <Brennan.Spies_at_ejgallo.com>
Date: Wed, 24 Oct 2007 13:47:36 -0700

Hi all,

 

Having 2 problems...

 

1) Unmarshalling a collection that is wrapped by an @XmlElementWrapper

 

      @XmlElementWrapper(name="Transitions", required=true)

      @XmlAnyElement()

      public Collection<TransitionDefinition<? extends Node>>
getTransitions() { //TransitionDefinition is an interface

                  return transitions;

      }

 

      Unmarshalling from XML like this:

 

             <Transitions>

        <Transition to="route_1" from="task_1"/>

        <BranchedTransition from="task_2">

            <Case to="task_branch_1" condition="$TASK.count = 5"/>

            <Case to="task_branch_2" condition="$TASK.count = 0"/>

            <Default>auto_task_default</Default>

        </BranchedTransition>

    </Transitions>

 

      is always giving me a null return value from getTransitions().

 

2) Unmarshalling a simple element that has an xsi type (always getting
null) to a generic type

 

public class AttributeDefinition<T> {

      T value;

      @XmlElement(name="Value")

      public T getValue() {

                  return value;

      }

}

 

Unmarshalling from this XML

 

   <Attribute name="num">

       <Value xsi:type="xs:int">5</Value>

</Attribute>

 

always gives me a null for Value.

 

Suggestions?

 

Thx,

 

Brennan