It doesn't change without changes being made somewhere?
And why is this a problem? Serializable is nothing but a "marker" interface.
You should be able to write your application as if the getter would always
return
a List<?>. So, if you have
List<Serializable> getList1(){...}
List<Object> getList2(){...}
you can both use like this:
List<?> list1 = ls.getList1();
List<?> list2 = ls.getList2();
-W
On Wed, Mar 10, 2010 at 8:31 AM, eugene_626 <engeue_at_gmail.com> wrote:
>
> I got a problem when using maven-jaxb2-plugin to generate source code from
> xsd. I have a xs:choice in my xsd file and I specific serializable in my
> globalbindings. But when maven plugin generate code, some times the
> xs:choice element is unmarshel to List<Serializable> and some times the
> xs:choice element is unmarshel to List.
>
> My plugin in the pom.xml is like this:
> <plugin>
> <groupId>org.jvnet.jaxb2.maven2</groupId>
> <artifactId>maven-jaxb2-plugin</artifactId>
> <version>0.6.1</version>
> <executions>
> <execution>
> <phase>generate-sources</phase>
> <goals>
> <goal>generate</goal>
> </goals>
> </execution>
> </executions>
> <configuration>
> <schemaDirectory>src/main/resources/wsdl</schemaDirectory>
> <schemaIncludes>
> <include>adi2msg.xsd</include>
> </schemaIncludes>
> <bindingDirectory>src/main/resources/bindings</bindingDirectory>
> <bindingIncludes>
> <include>xsd-binding.xml</include>
> </bindingIncludes>
> </configuration>
> </plugin>
>
> adi2msg.xsd file is like this:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns="http://userstory/2006-05-05/try2"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://userstory/2006-05-05/try2"
> elementFormDefault="qualified" attributeFormDefault="unqualified">
> <xs:complexType name="ContentAssetType">
> <xs:attribute name="type" type="xs:string" use="required" />
> </xs:complexType>
> <xs:complexType name="MetadataAssetType">
> <xs:attribute name="type" type="xs:string" use="required" />
> </xs:complexType>
>
> <xs:element name="ADI2">
> <xs:complexType>
> <xs:sequence>
> <xs:choice minOccurs="0" maxOccurs="unbounded">
> <xs:element ref="ReplaceMetadataAsset"/>
> <xs:element ref="DestroyContentAsset" />
> </xs:choice>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="ReplaceMetadataAsset" type="MetadataAssetType" />
> <xs:element name="DestroyContentAsset" type="ContentAssetType" />
> </xs:schema>
>
> xsd-binding.xml file is like this:
> <?xml version="1.0" encoding="UTF-8"?>
> <jxb:bindings version="1.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <jxb:globalBindings>
> <jxb:serializable uid="1"/>
> </jxb:globalBindings>
> </jxb:bindings>
>
> When I using the plugin to generate code, some times the type of attribute
> replaceMetadataAssetOrDestroyContentAsset in ADI2.java is
> List<Serializable>, but some times is List.
>
> Why it is unstable when generating code?
> Please help me, thanks!
> --
> View this message in context:
> http://old.nabble.com/Unstable-when-generating--List%3CSerializable%3E-tp27846392p27846392.html
> Sent from the java.net - jaxb users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>