Package org.jboss.xb.binding.metadata.unmarshalling

Examples of org.jboss.xb.binding.metadata.unmarshalling.DocumentBinding


         return this;
      }

      public DocumentBindingStack push(Class documentBindingClass, DocumentBinder binder)
      {
         DocumentBinding newDoc = pushNewDocumentBinding(documentBindingClass);
         binder.bind(newDoc);
         return this;
      }
View Full Code Here


         if(!DocumentBinding.class.isAssignableFrom(documentBindingClass))
         {
            throw new JBossXBRuntimeException("The class must implement " + DocumentBinding.class);
         }

         DocumentBinding doc;
         try
         {
            Constructor ctor = documentBindingClass.getConstructor(new Class[]{DocumentBinding.class});
            doc = (DocumentBinding)ctor.newInstance(new Object[]{this});
            push(doc);
View Full Code Here

         this.elementDecl = elementDecl;
      }

      private void init()
      {
         DocumentBinding doc = parent.getDocument();

         // first try to use XSD type
         XSTypeDefinition typeDef = elementDecl.getTypeDefinition();
         String typeBasedClsName = null;
         if("http://www.w3.org/2001/XMLSchema".equals(typeDef.getNamespace()))
         {
            javaType = SimpleTypeBindings.classForType(typeDef.getName());
         }
         else if(typeDef.getName() != null)
         {
            NamespaceBinding ns = doc.getNamespace(typeDef.getNamespace());
            typeBasedClsName = ns.getJavaPackage() + "." + Util.xmlNameToClassName(typeDef.getName(), true);
            try
            {
               javaType = Thread.currentThread().getContextClassLoader().loadClass(typeBasedClsName);
            }
            catch(ClassNotFoundException e)
            {
            }
         }

         String elBasedClsName = Util.xmlNameToClassName(elementDecl.getName(), true);
         if(javaType == null)
         {
            NamespaceBinding ns = doc.getNamespace(elementDecl.getNamespace());
            // using type didn't help, let's try element's name
            // note: here we use element's namespace, not type's one
            try
            {
               javaType =
View Full Code Here

         this.elementDecl = elementDecl;
      }

      private void init()
      {
         DocumentBinding doc = ns.getDocument();

         // first try to use XSD type
         XSTypeDefinition typeDef = elementDecl.getTypeDefinition();
         String typeBasedClsName = null;
         if("http://www.w3.org/2001/XMLSchema".equals(typeDef.getNamespace()))
         {
            javaType = SimpleTypeBindings.classForType(typeDef.getName());
         }
         else if(typeDef.getName() != null)
         {
            NamespaceBinding ns = doc.getNamespace(typeDef.getNamespace());
            typeBasedClsName = ns.getJavaPackage() + "." + Util.xmlNameToClassName(typeDef.getName(), true);
            try
            {
               javaType = Thread.currentThread().getContextClassLoader().loadClass(typeBasedClsName);
            }
            catch(ClassNotFoundException e)
            {
            }
         }

         if(javaType == null)
         {
            // using type didn't help, let's try element's name
            // note: here we use element's namespace, not type's one
            NamespaceBinding ns = doc.getNamespace(elementDecl.getNamespace());
            String elBasedClsName = ns.getJavaPackage() + "." + Util.xmlNameToClassName(elementDecl.getName(), true);
            try
            {
               javaType = Thread.currentThread().getContextClassLoader().loadClass(elBasedClsName);
            }
View Full Code Here

TOP

Related Classes of org.jboss.xb.binding.metadata.unmarshalling.DocumentBinding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.