[JBoss-user] [Microcontainer] - Re: demandType Schema wondering
Hi, I see Bug report thank for your help:-) View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3927463#3927463 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3927463 --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Microcontainer] - Re: demandType Schema wondering
Thank you for telling me :-) So do this: |TypeBinding beanType = schemaBinding.getType(beanTypeQName); | | /* | ClassMetaData classMetaData = new ClassMetaData(); | classMetaData.setImpl(AbstractBeanMetaData.class.getName()); | beanType.setClassMetaData(classMetaData); | | QName CLASS = new QName("class"); | AttributeBinding attribute = beanType.getAttribute(CLASS); | PropertyMetaData propertyMetaData = new PropertyMetaData(); | propertyMetaData.setName("bean"); | attribute.setPropertyMetaData(propertyMetaData); | | QName MODE = new QName("mode"); | attribute = beanType.getAttribute(MODE); | ValueAdapter modeAdapter = new ValueAdapter() | { | public Object cast(Object o, Class c) | { | String string = (String) o; | return new ControllerMode(string); | } | }; | attribute.setValueAdapter(modeAdapter); | */ | beanType.setHandler(new DefaultElementHandler() | { | | public Object startElement(Object parent, QName name, ElementBinding element) | { | return new AbstractBeanMetaData(); | } | | public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) | { | AbstractBeanMetaData bean = (AbstractBeanMetaData) o; | for (int i = 0; i < attrs.getLength(); ++i) | { |String localName = attrs.getLocalName(i); |if ("name".equals(localName)) | bean.setName(attrs.getValue(i)); |else if ("class".equals(localName)) | bean.setBean(attrs.getValue(i)); |else if ("mode".equals(localName)) | bean.setMode(new ControllerMode(attrs.getValue(i))); |else if ("whenRequired".equals(localName)) | bean.set | } | } | }); | | | | |[CDATA[ |The bean is an instance of a pojo. | |e.g. | | | | | | | |]] | | | | | | | | | | | | | | | | | | | | | | | Or do this | public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) | { | AbstractDemandMetaData demand = (AbstractDemandMetaData) o; | for (int i = 0; i < attrs.getLength(); ++i) | { |String localName = attrs.getLocalName(i); |if ("whenRequired".equals(localName)) | demand.setWhenRequired(new ControllerState(attrs.getValue(i))); | } | } | View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3927456#3927456 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3927456 --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Microcontainer] - Re: demandType Schema wondering
Bug report: http://jira.jboss.com/jira/browse/JBMICROCONT-72 View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3927448#3927448 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3927448 --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Microcontainer] - Re: demandType Schema wondering
| e.g.: | ISupply must be installed before IDemand is constructed | theSupply | | The xsd is wrong. | public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) | { | AbstractDemandMetaData demand = (AbstractDemandMetaData) o; | for (int i = 0; i < attrs.getLength(); ++i) | { |String localName = attrs.getLocalName(i); |if ("state".equals(localName)) | demand.setWhenRequired(new ControllerState(attrs.getValue(i))); | } | } | So it should be: | e.g.: | ISupply must be installed before IDemand is constructed | theSupply | | View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3927445#3927445 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3927445 --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user