I'm trying to do the following to allow for several values in an xml attribute
| public enum QualifierPoint
| {
| @XmlEnumValue("Constructor") CONSTRUCTOR,
| @XmlEnumValue("Method") METHOD,
| @XmlEnumValue("Property") PROPERTY
| }
|
| @XmlType(name="qualifierType")
| public class AbstractInjectQualifierMetaData extends AbstractQualifierMetaData
| {
| private static final long serialVersionUID = 1L;
|
| protected List<QualifierPoint> points;
|
| @XmlAttribute(name="points")
| public void setPoints(List<QualifierPoint> points)
| {
| this.points = points;
| }
|
| public List<QualifierPoint> getPoints()
| {
| return points;
| }
| }
|
However
| <qualifier points="Method">123</qualifier>
|
fails with
| Caused by: java.lang.RuntimeException: QName points error setting property points with
value org.jboss.beans.metadata.plugins.QualifierPoint
| @3e5dc994 to
org.jboss.beans.metadata.plugins.AbstractInjectQualifierMetaData@2136814472
| at org.jboss.xb.builder.runtime.PropertyHandler.handle(PropertyHandler.java:60)
| at
org.jboss.xb.builder.runtime.AbstractPropertyHandler.doHandle(AbstractPropertyHandler.java:98)
| at
org.jboss.xb.builder.runtime.AbstractPropertyHandler.attribute(AbstractPropertyHandler.java:118)
| at
org.jboss.xb.binding.sunday.unmarshalling.AttributesHandler.attributes(AttributesHandler.java:51)
| at
org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler.attributes(DefaultElementHandler.java:65)
| at org.jboss.xb.builder.runtime.BeanHandler.startParticle(BeanHandler.java:109)
| at
org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:616)
| at
org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:401)
| at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
| at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
| at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
| at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
| at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
| at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
| at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:173)
| ... 29 more
| Caused by: java.lang.IllegalArgumentException: Wrong arguments. setPoints for target
org.jboss.beans.metadata.plugins.AbstractInjectQualifie
| rMetaData@57922f46 expected=[java.util.List]
actual=[org.jboss.beans.metadata.plugins.QualifierPoint]
| at
org.jboss.reflect.plugins.introspection.ReflectionUtils.handleErrors(ReflectionUtils.java:395)
| at
org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:69)
| at
org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:151)
| at
org.jboss.beans.info.plugins.DefaultPropertyInfo.set(DefaultPropertyInfo.java:143)
| at org.jboss.xb.spi.AbstractBeanAdapter.set(AbstractBeanAdapter.java:95)
| at org.jboss.xb.builder.runtime.PropertyHandler.handle(PropertyHandler.java:56)
| ... 47 more
|
and
| <qualifier points="Constructor, Property">123</qualifier>
|
fails with
| Caused by: java.lang.RuntimeException: Invalid value Constructor, Property valid are
[Method, Property, Constructor]
| at org.jboss.xb.builder.runtime.EnumValueAdapter.cast(EnumValueAdapter.java:136)
| at
org.jboss.xb.builder.runtime.AbstractPropertyHandler.attribute(AbstractPropertyHandler.java:115)
| at
org.jboss.xb.binding.sunday.unmarshalling.AttributesHandler.attributes(AttributesHandler.java:51)
| at
org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler.attributes(DefaultElementHandler.java:65)
| at org.jboss.xb.builder.runtime.BeanHandler.startParticle(BeanHandler.java:109)
| at
org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:616)
| at
org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:401)
| at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
| at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
| at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
| at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
| at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
| at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
| at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:173)
| ... 29 more
|
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4268071#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...