-
1. Re: Map annotations
aloubyansky Jan 22, 2008 6:55 PM (in response to aloubyansky)I've done what I had in mind. There are some other things that are not mentioned in the first post.
All the tests are here jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlmapentry/test/JBossXmlMapEntryUnitTestCase.java -
2. Re: Map annotations
alesj Jan 22, 2008 7:17 PM (in response to aloubyansky)Can you update the MC with your changes once you've released the update?
So that we close the MC+JAXB issue. :-) -
3. Re: Map annotations
aloubyansky Jan 23, 2008 4:04 AM (in response to aloubyansky)Ok, I'll have a look. Let me know if there is a jira issue for that.
-
4. Re: Map annotations
alesj Jan 23, 2008 5:31 AM (in response to aloubyansky)"alex.loubyansky@jboss.com" wrote:
Let me know if there is a jira issue for that.
http://jira.jboss.com/jira/browse/JBMICROCONT-219 -
5. Re: Map annotations
aloubyansky Jan 25, 2008 8:30 AM (in response to aloubyansky)I had to fix some issues based on the MC tests. I've updated the XB snapshot in the maven2 repository.
"mvn" wrote:
https://snapshots.jboss.org/maven2/org/jboss/jbossxb/2.0.0-SNAPSHOT/jbossxb-2.0.0-20080125.124437-7.jar
But I haven't updated the MC since it uses 2.0.0.CR5. This is what I did to make sure the MC tests passIndex: kernel/src/main/org/jboss/beans/metadata/plugins/MapEntry.java =================================================================== --- kernel/src/main/org/jboss/beans/metadata/plugins/MapEntry.java (revision 69169) +++ kernel/src/main/org/jboss/beans/metadata/plugins/MapEntry.java (working copy) @@ -24,6 +24,8 @@ import javax.xml.bind.annotation.XmlType; import org.jboss.beans.metadata.spi.ValueMetaData; +import org.jboss.xb.annotations.JBossXmlMapKey; +import org.jboss.xb.annotations.JBossXmlMapValue; /** @@ -41,6 +43,7 @@ /** The value */ private ValueMetaData value; + @JBossXmlMapKey public ValueMetaData getKey() { return key; @@ -51,6 +54,7 @@ this.key = key; } + @JBossXmlMapValue public ValueMetaData getValue() { return value; Index: kernel/src/main/org/jboss/beans/metadata/plugins/AbstractMapMetaData.java =================================================================== --- kernel/src/main/org/jboss/beans/metadata/plugins/AbstractMapMetaData.java (revision 69169) +++ kernel/src/main/org/jboss/beans/metadata/plugins/AbstractMapMetaData.java (working copy) @@ -29,6 +29,7 @@ import java.util.Map; import java.util.Set; import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import org.jboss.beans.metadata.spi.MetaDataVisitor; @@ -36,9 +37,7 @@ import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.TypeInfo; -import org.jboss.xb.annotations.JBossXmlChild; -import org.jboss.xb.annotations.JBossXmlChildren; -import org.jboss.xb.annotations.JBossXmlNoElements; +import org.jboss.xb.annotations.JBossXmlMapEntry; /** * Map metadata. @@ -48,11 +47,12 @@ * @version $Revision$ */ @XmlType -@JBossXmlNoElements -@JBossXmlChildren -({ - @JBossXmlChild(name="entry", type=MapEntry.class) -}) +@JBossXmlMapEntry(name = "entry", type=MapEntry.class) +//@JBossXmlNoElements +//@JBossXmlChildren +//({ +// @JBossXmlChild(name="entry", type=MapEntry.class) +//}) public class AbstractMapMetaData extends AbstractTypeMetaData implements Map<MetaDataVisitorNode, MetaDataVisitorNode>, Serializable { @@ -199,6 +199,7 @@ return map.values(); } + @XmlTransient public Iterator<? extends MetaDataVisitorNode> getChildren() { ArrayList<MetaDataVisitorNode> children = new ArrayList<MetaDataVisitorNode>(keySet()); @@ -236,11 +237,13 @@ * * @return the class instance */ + @XmlTransient protected Object getDefaultInstance() { return new HashMap<Object, Object>(); } + @XmlTransient protected Class<? extends Map> getExpectedClass() { return Map.class;
-
6. Re: Map annotations
alesj Jan 25, 2008 9:16 AM (in response to aloubyansky)Is this ready for CR6?
Or what should the release be named?
I guess this can wait, for us to completely change the MC's metadata parsing with JAXB.
But on the other hand it would be nice to have this already in AS5_beta4, if people want to fully (including Maps) experiment with our JAXB support.
e.g. the JMS config could be reduced to simple <queue) or <topic) elements. -
7. Re: Map annotations
aloubyansky Jan 25, 2008 10:06 AM (in response to aloubyansky)Yes, we can release CR6.