/* 701 */ beanType.pushInterceptor(dependsQName, new DefaultElementInterceptor()
/* */ {
/* */ public void add(Object parent, Object child, QName name)
/* */ {
/* 705 */ AbstractBeanMetaData bean = (AbstractBeanMetaData)parent;
/* 706 */ AbstractDependencyMetaData dependency = (AbstractDependencyMetaData)child;
/* 707 */ Set depends = bean.getDepends();
/* 708 */ if (depends == null)
/* */ {
/* 710 */ depends = new HashSet();
/* 711 */ bean.setDepends(depends);
/* */ }
/* 713 */ depends.add(dependency);
/* */ }
/* */ });
/* 718 */ beanFactoryType.pushInterceptor(dependsQName, new DefaultElementInterceptor()
/* */ {
/* */ public void add(Object parent, Object child, QName name)
/* */ {
/* 722 */ GenericBeanFactoryMetaData bean = (GenericBeanFactoryMetaData)parent;
/* 723 */ AbstractDependencyMetaData dependency = (AbstractDependencyMetaData)child;
/* 724 */ Set depends = bean.getDepends();
/* 725 */ if (depends == null)
/* */ {
/* 727 */ depends = new HashSet();
/* 728 */ bean.setDepends(depends);
/* */ }
/* 730 */ depends.add(dependency);
/* */ }
/* */ });
/* 735 */ beanType.pushInterceptor(demandQName, new DefaultElementInterceptor()
/* */ {
/* */ public void add(Object parent, Object child, QName name)
/* */ {
/* 739 */ AbstractBeanMetaData bean = (AbstractBeanMetaData)parent;
/* 740 */ AbstractDemandMetaData demand = (AbstractDemandMetaData)child;
/* 741 */ Set demands = bean.getDemands();
/* 742 */ if (demands == null)
/* */ {
/* 744 */ demands = new HashSet();
/* 745 */ bean.setDemands(demands);
/* */ }
/* 747 */ demands.add(demand);
/* */ }
/* */ });
/* 752 */ beanFactoryType.pushInterceptor(demandQName, new DefaultElementInterceptor()
/* */ {
/* */ public void add(Object parent, Object child, QName name)
/* */ {
/* 756 */ AbstractBeanMetaData bean = (AbstractBeanMetaData)parent;
/* 757 */ AbstractDemandMetaData demand = (AbstractDemandMetaData)child;
/* 758 */ Set demands = bean.getDemands();
/* 759 */ if (demands == null)
/* */ {
/* 761 */ demands = new HashSet();
/* 762 */ bean.setDemands(demands);
/* */ }
/* 764 */ demands.add(demand);
/* */ }
/* */ });
/* 769 */ beanType.pushInterceptor(supplyQName, new DefaultElementInterceptor()
/* */ {
/* */ public void add(Object parent, Object child, QName name)
/* */ {
/* 773 */ AbstractBeanMetaData bean = (AbstractBeanMetaData)parent;
/* 774 */ AbstractSupplyMetaData supply = (AbstractSupplyMetaData)child;
/* 775 */ Set supplies = bean.getSupplies();
/* 776 */ if (supplies == null)
/* */ {
/* 778 */ supplies = new HashSet();
/* 779 */ bean.setSupplies(supplies);
/* */ }
/* 781 */ supplies.add(supply);
/* */ }
/* */ });
/* 786 */ beanFactoryType.pushInterceptor(supplyQName, new DefaultElementInterceptor()
/* */ {
/* */ public void add(Object parent, Object child, QName name)
/* */ {
/* 790 */ AbstractBeanMetaData bean = (AbstractBeanMetaData)parent;
/* 791 */ AbstractSupplyMetaData supply = (AbstractSupplyMetaData)child;
/* 792 */ Set supplies = bean.getSupplies();
/* 793 */ if (supplies == null)
/* */ {
/* 795 */ supplies = new HashSet();
/* 796 */ bean.setSupplies(supplies);
/* */ }
/* 798 */ supplies.add(supply);
/* */ }
/* */ });
/* 803 */ TypeBinding propertyType = schemaBinding.getType(propertyTypeQName);
/* 804 */ configureValueBindings(propertyType);
/* 805 */ propertyType.setHandler(new DefaultElementHandler()
/* */ {
/* */ public Object startElement(Object parent, QName name, ElementBinding element)
/* */ {
/* 809 */ return new AbstractPropertyMetaData();
/* */ }
/* */
/* */ public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx)
/* */ {
/* 814 */ AbstractPropertyMetaData property = (AbstractPropertyMetaData)o;
/* 815 */ for (int i = 0; i < attrs.getLength(); i++)
/* */ {
/* 817 */ String localName = attrs.getLocalName(i);
/* 818 */ if ("name".equals(localName)) {
/* 819 */ property.setName(attrs.getValue(i));
/* 820 */ } else if ("preinstantiate".equals(localName)) {
/* 821 */ property.setPreInstantiate(Boolean.parseBoolean(attrs.getValue(i))); } else {
/* 822 */ if ((!"class".equals(localName)) && (!"replace".equals(localName)) && (!"trim".equals(localName))) {
/* */ continue;
/* */ }
/* 825 */ org.jboss.beans.metadata.spi.ValueMetaData vmd = property.getValue();
/* */ StringValueMetaData svmd;
/* 826 */ if ((vmd == null) || (!(vmd instanceof StringValueMetaData)))
/* */ {
/* 828 */ StringValueMetaData svmd = new StringValueMetaData();
/* 829 */ property.setValue(svmd);
/* */ }
/* */ else
/* */ {
/* 833 */ svmd = (StringValueMetaData)vmd;
/* */ }
/* 835 */ if ("class".equals(localName))
/* 836 */ svmd.setType(attrs.getValue(i));
/* 837 */ else if ("replace".equals(localName))
/* 838 */ svmd.setReplace(Boolean.parseBoolean(attrs.getValue(i)));
/* 839 */ else if ("trim".equals(localName))
/* 840 */ svmd.setTrim(Boolean.parseBoolean(attrs.getValue(i)));
/* */ }
/* */ }
/* */ }
/* */
/* */ public Object endElement(Object o, QName qName, ElementBinding element)
/* */ {
/* 847 */ AbstractPropertyMetaData x = (AbstractPropertyMetaData)o;
/* 848 */ String name = x.getName();
/* 849 */ if ((name == null) || (name.trim().length() == 0))
/* 850 */ throw new IllegalArgumentException("Null or empty property name.");
/* 851 */ return o;
/* */ }
/* */ });
/* 856 */ propertyType.setSimpleType(new CharactersHandler()
/* */ {
/* */ public Object unmarshal(QName qName, TypeBinding typeBinding, NamespaceContext nsCtx, org.jboss.xb.binding.metadata.ValueMetaData valueMetaData, String value)
/* */ {
/* 860 */ return new StringValueMetaData(value);
/* */ }
/* */
/* */ public void setValue(QName qName, ElementBinding element, Object owner, Object value)
/* */ {
/* 865 */ AbstractPropertyMetaData property = (AbstractPropertyMetaData)owner;
/* 866 */ StringValueMetaData svmd = (StringValueMetaData)value;
/* 867 */ org.jboss.beans.metadata.spi.ValueMetaData vmd = property.getValue();
/* 868 */ if ((vmd != null) && ((vmd instanceof StringValueMetaData)))
/* */ {
/* 870 */ StringValueMetaData previous = (StringValueMetaData)vmd;
/* 871 */ svmd.setReplace(previous.isReplace());
/* 872 */ svmd.setTrim(previous.isTrim());
/* 873 */ String type = previous.getType();
/* 874 */ if (type != null)
/* 875 */ svmd.setType(type);
/* */ }
/* 877 */ property.setValue(svmd);
/* */ }
/* */ });
/* 882 */ TypeBinding dependsType = schemaBinding.getType(dependsTypeQName);
/* 883 */ dependsType.setHandler(new DefaultElementHandler()
/* */ {
/* */ public Object startElement(Object parent, QName name, ElementBinding element)
/* */ {
/* 887 */ return new AbstractDependencyMetaData();
/* */ }
/* */
/* */ public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx)
/* */ {
/* */ }
/* */
/* */ public Object endElement(Object o, QName qName, ElementBinding element)
/* */ {
/* 896 */ AbstractDependencyMetaData x = (AbstractDependencyMetaData)o;
/* 897 */ String name = (String)x.getDependency();
/* 898 */ if ((name == null) || (name.trim().length() == 0))
/* 899 */ throw new IllegalArgumentException("Null or empty dependency.");
/* 900 */ return o;
/* */ }
/* */ });
/* 905 */ dependsType.setSimpleType(new CharactersHandler()
/* */ {
/* */ public Object unmarshal(QName qName, TypeBinding typeBinding, NamespaceContext nsCtx, org.jboss.xb.binding.metadata.ValueMetaData valueMetaData, String value)
/* */ {
/* 909 */ return value;
/* */ }
/* */
/* */ public void setValue(QName qname, ElementBinding element, Object owner, Object value)
/* */ {
/* 914 */ AbstractDependencyMetaData depends = (AbstractDependencyMetaData)owner;
/* 915 */ depends.setDependency(value);
/* */ }
/* */ });
/* 920 */ TypeBinding demandType = schemaBinding.getType(demandTypeQName);
/* 921 */ demandType.setHandler(new DefaultElementHandler()
/* */ {