[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: enums, generics and other animals
alesj
do-not-reply at jboss.com
Fri Mar 7 10:04:20 EST 2008
"adrian at jboss.org" wrote :
| You don't need to code this yourself. Just add @XmlEnumValues to the enum class.
| JBoss/AXB already knows how to parse enums.
Does this include the old JBossXB handlers?
e.g.
| public class InjectionHandler extends DefaultElementHandler
| {
| ...
|
| public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx)
| {
| AbstractInjectionValueMetaData injection = (AbstractInjectionValueMetaData) o;
| for (int i = 0; i < attrs.getLength(); ++i)
| {
| String localName = attrs.getLocalName(i);
| ...
| else if ("type".equals(localName))
| injection.setInjectionType(AutowireType.getInstance(attrs.getValue(i)));
| else if ("option".equals(localName))
| injection.setInjectionOption(InjectOption.getInstance(attrs.getValue(i)));
| else if ("fromContext".equals(localName))
| injection.setFromContext(FromContext.getInstance(attrs.getValue(i)));
| }
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134872#4134872
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4134872
More information about the jboss-dev-forums
mailing list