1 22 package org.jboss.test.xml.importing; 23 24 import javax.xml.namespace.QName ; 25 26 import org.jboss.kernel.plugins.deployment.xml.BeanHandler; 27 import org.jboss.kernel.plugins.deployment.xml.BeanSchemaBindingHelper; 28 import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; 29 import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; 30 import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingInitializer; 31 import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding; 32 33 39 public class ExtendedSchemaInitializer implements SchemaBindingInitializer 40 { 41 42 public static final String EXTENDED_NS = "urn:jboss:test-extended:1.0"; 43 44 45 private static final QName extendedTypeQName = new QName (EXTENDED_NS, "extendedType"); 46 47 public SchemaBinding init(SchemaBinding schema) 48 { 49 TypeBinding extendedType = schema.getType(extendedTypeQName); 51 BeanSchemaBindingHelper.initBeanHandlers(extendedType); 52 extendedType.setHandler(new BeanHandler() 53 { 54 public Object startElement(Object parent, QName name, ElementBinding element) 55 { 56 return new Extended(); 57 } 58 }); 59 60 64 65 return schema; 66 } 67 } 68 | Popular Tags |