Package org.jboss.xb.binding

Examples of org.jboss.xb.binding.JBossXBRuntimeException


            {
            }

            public void error(SAXParseException e)
            {
               throw new JBossXBRuntimeException("Error", e);
            }

            public void fatalError(SAXParseException e)
            {
               throw new JBossXBRuntimeException("Fatal error", e);
            }

            public InputSource resolveEntity(String publicId, String systemId)
            {
               InputSource is = null;
               if (resolver != null)
               {
                  try
                  {
                     is = resolver.resolveEntity(publicId, systemId);
                  }
                  catch (Exception e)
                  {
                     throw new IllegalStateException("Failed to resolveEntity " + systemId + ": " + systemId);
                  }
               }

               if(is == null)
               {
                  fail("Failed to resolve entity: publicId=" + publicId + " systemId=" + systemId);
               }

               return is;
            }
         });
      }
      catch(JBossXBRuntimeException e)
      {
         throw e;
      }
      catch (SAXException e)
      {
         throw new JBossXBRuntimeException("Parsing failed.", e);
      }
      catch (IOException e)
      {
         throw new JBossXBRuntimeException("Parsing failed.", e);
      }
   }
View Full Code Here


                  ch.endElement(null, ge.getLocalName(), ge.getLocalName());
               }
               catch(Exception e)
               {
                  throw new JBossXBRuntimeException(e);
               }
            }
         }
      );
   }
View Full Code Here

               type.equals("java.lang.Long") ||
               type.equals("java.lang.Float") ||
               type.equals("java.lang.Character"))
             this.type = type;
         else
            throw new JBossXBRuntimeException("config-property-type contains an invalid value");
      }
   }
View Full Code Here

      {
         if (authenticationMechanismType.equals("BasicPassword") ||
             authenticationMechanismType.equals("Kerbv5"))
             this.authenticationMechanismType = authenticationMechanismType;
         else
            throw new JBossXBRuntimeException("authentication-mechanism-type contains an invalid value");
      }
   }
View Full Code Here

         if (credentialInterfaceClass.equals("javax.resource.spi.security.PasswordCredential") ||
               credentialInterfaceClass.equals("org.ietf.jgss.GSSCredential") ||
               credentialInterfaceClass.equals("javax.resource.spi.security.GenericCredential"))
             this.credentialInterfaceClass = credentialInterfaceClass;
         else
            throw new JBossXBRuntimeException("credential-interface is set wrong property");
      }
   }
View Full Code Here

            {
            }

            public void error(SAXParseException e)
            {
               throw new JBossXBRuntimeException("Error", e);
            }

            public void fatalError(SAXParseException e)
            {
               throw new JBossXBRuntimeException("Fatal error", e);
            }

            public InputSource resolveEntity(String publicId, String systemId)
            {
               InputSource is = null;
               if (resolver != null)
               {
                  try
                  {
                     is = resolver.resolveEntity(publicId, systemId);
                  }
                  catch (Exception e)
                  {
                     throw new IllegalStateException("Failed to resolveEntity " + systemId + ": " + systemId);
                  }
               }

               if(is == null)
               {
                  fail("Failed to resolve entity: publicId=" + publicId + " systemId=" + systemId);
               }

               return is;
            }
         });
      }
      catch(JBossXBRuntimeException e)
      {
         throw e;
      }
      catch (SAXException e)
      {
         throw new JBossXBRuntimeException("Parsing failed.", e);
      }
      catch (IOException e)
      {
         throw new JBossXBRuntimeException("Parsing failed.", e);
      }
   }
View Full Code Here

                  InputStream is = getResource("xml/mbeanserver/user-roles.xsd");
                  return XsdBinder.bind(is, null, baseURI);
               }
               else
               {
                  throw new JBossXBRuntimeException("Unrecognized namespace: " + nsUri);
               }
            }
            catch(IOException e)
            {
               throw new JBossXBRuntimeException("IO error", e);
            }
         }

         public LSInput resolveAsLSInput(String nsUri, String baseUri, String schemaLocation)
         {
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

         {
            ((MapEntry)owner).setValue(value);
         }
         else
         {
            throw new JBossXBRuntimeException(
               "Parent object is a map entry but attribute " +
               attrName +
               " in element " +
               elemName +
               " bound to neither key nor value in a map entry."
View Full Code Here

            {
               log.warn("Neither getter/setter nor field were found for field " + prop + " in " + cls);
               return;
            }

            throw new JBossXBRuntimeException(
               "Neither getter/setter nor field were found for field " + prop + " in " + cls
            );
         }
      }

      if(colType != null ||
         // todo collections of collections
         Collection.class.isAssignableFrom(fieldType) &&
         !Collection.class.isAssignableFrom(value.getClass()))
      {
         Collection col = (Collection)get(o, getter, field);
         if(col == null)
         {
            if(colType == null)
            {
               col = new ArrayList();
            }
            else
            {
               Class colCls;
               try
               {
                  colCls = Thread.currentThread().getContextClassLoader().loadClass(colType);
               }
               catch(ClassNotFoundException e)
               {
                  throw new JBossXBRuntimeException("Failed to load collection type: " + colType);
               }

               try
               {
                  col = (Collection)colCls.newInstance();
               }
               catch(Exception e)
               {
                  throw new JBossXBRuntimeException("Failed to create an instance of " + colCls);
               }
            }

            set(o, col, setter, field);
         }
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.