Package org.jboss.xb.binding

Examples of org.jboss.xb.binding.JBossXBRuntimeException


      public void popModelGroup()
      {
         Object o = typeGroupStack.remove(typeGroupStack.size() - 1);
         if(!(o instanceof ModelGroupBinding))
   {
            throw new JBossXBRuntimeException("Should have poped model group binding but got " + o);
         }
      }
View Full Code Here


   public void addType(TypeBinding type)
   {
      QName qName = type.getQName();
      if(qName == null)
      {
         throw new JBossXBRuntimeException("Global type must have a name.");
      }
      types.put(qName, type);
   }
View Full Code Here

      {
         reader = parser.getXMLReader();
      }
      catch(SAXException e1)
      {
         throw new JBossXBRuntimeException("Failed to get parser's XMLReader", e1);
      }

      delegateHandler = new DelegatingContentHandler();
      reader.setContentHandler(delegateHandler);
      reader.setErrorHandler(MetaDataErrorHandler.INSTANCE);
View Full Code Here

      {
         reader.setProperty(name, value);
      }
      catch(SAXException e)
      {
         throw new JBossXBRuntimeException("Failed to set property on the XML reader", e);
      }
   }
View Full Code Here

      {
         reader.setFeature(name, value);
      }
      catch(SAXException e)
      {
         throw new JBossXBRuntimeException("Failed to set feature on the XMLReader", e);
      }
   }
View Full Code Here

      {
         reader = parser.getXMLReader();
      }
      catch(SAXException e1)
      {
         throw new JBossXBRuntimeException("Failed to get parser's XMLReader", e1);
      }

      delegateHandler = new DelegatingContentHandler();
      reader.setContentHandler(delegateHandler);
      reader.setErrorHandler(MetaDataErrorHandler.INSTANCE);
View Full Code Here

      {
         reader.setProperty(name, value);
      }
      catch(SAXException e)
      {
         throw new JBossXBRuntimeException("Failed to set property on the XML reader", e);
      }
   }
View Full Code Here

         reader.setFeature(name, value);
         log.debug(name+" set to: "+reader.getFeature(name));
      }
      catch(SAXException e)
      {
         throw new JBossXBRuntimeException("Failed to set feature on the XMLReader", e);
      }
   }
View Full Code Here

            catch(RuntimeException e)
            {
               String msg = "Failed to parse schema for nsURI="+nsURI
                  +", baseURI="+baseURI
                  +", schemaLocation="+schemaLocation;
               throw new JBossXBRuntimeException(msg, e);
            }
         }
      }

      if(schema != null)
View Full Code Here

   private void marshallInternal(Object root, SchemaBinding schema, Writer writer)
       throws IOException, SAXException
   {
      if(schema == null)
      {
         throw new JBossXBRuntimeException("XSModel is not available!");
      }

      this.schema = schema;
      this.root = root;

      content.startDocument();

      if(rootTypeQName != null)
      {
         if(rootQNames.isEmpty())
         {
            throw new JBossXBRuntimeException("If type name (" +
                rootTypeQName +
                ") for the root element is specified then the name for the root element is required!"
            );
         }
         QName rootQName = (QName)rootQNames.get(0);

         TypeBinding type = schema.getType(rootTypeQName);
         if(type == null)
         {
            throw new JBossXBRuntimeException("Global type definition is not found: " + rootTypeQName);
         }

         if(isArrayWrapper(type))
         {
            stack.push(root);
            marshalComplexType(rootQName, type, true, false);
            stack.pop();
         }
         else
         {
            ElementBinding element = new ElementBinding(schema, rootQName, type);
            ctx.particle = new ParticleBinding(element);
            marshalElementOccurence(element, root, false, true);
         }
      }
      else if(rootQNames.isEmpty())
      {
         Iterator elements = schema.getElementParticles();
         if(!elements.hasNext())
         {
            throw new JBossXBRuntimeException("The schema doesn't contain global element declarations.");
         }

         while(elements.hasNext())
         {
            ParticleBinding element = (ParticleBinding)elements.next();
View Full Code Here

TOP

Related Classes of org.jboss.xb.binding.JBossXBRuntimeException

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.