Package javax.xml.bind

Examples of javax.xml.bind.UnmarshalException


  public Object unmarshal(Source pSource) throws JAXBException {
    if (pSource instanceof SAXSource) {
      SAXSource ss = (SAXSource) pSource;
      InputSource is = ss.getInputSource();
      if (is == null) {
        throw new UnmarshalException("The SAXResult doesn't have its InputSource set.");
      }
      XMLReader xr = ss.getXMLReader();
      if (xr == null) {
        return unmarshal(is);
      } else {
View Full Code Here


   *   was not declared or creating the instance caused an exception.
   */
  public JMHandler getJMHandler(QName pQName) throws UnmarshalException {
    JMManager mgr = getManagerByQName(pQName);
    if (mgr == null) {
      throw new UnmarshalException("No manager configured for " + pQName);
    }
    Class c = mgr.getHandlerClass();
    if (c == null) {
      throw new UnmarshalException("No handler class configured for " + pQName);
    }
    try {
      return (JMHandler) c.newInstance();
    } catch (Exception e) {
      throw new UnmarshalException("Could not instantiate handler class " +
                                      c.getName(), e);
    }
  }
View Full Code Here

   *   was not declared or creating the instance caused an exception.
   */
  public JMHandler getJMHandler(Class pElementInterface) throws UnmarshalException {
    Class c = getManagerByInterface(pElementInterface).getHandlerClass();
    if (c == null) {
      throw new UnmarshalException("No handler class configured for " +
                                    pElementInterface.getName());
    }
    try {
      return (JMHandler) c.newInstance();
    } catch (Exception e) {
      throw new UnmarshalException("Could not instantiate handler class " +
                                    c.getName(), e);
    }
  }
View Full Code Here

  /** <p>Returns a new JMUnmarshaller.</p>
   */
  public JMUnmarshaller getJMUnmarshaller() throws UnmarshalException {
    Class c = getJMUnmarshallerClass();
    if (c == null) {
      throw new UnmarshalException("A JMUnmarshaller class is not set.");
    }
    try {
      return (JMUnmarshaller) c.newInstance();
    } catch (Exception e) {
      throw new UnmarshalException("Failed to instantiate JMUnmarshaller class " + c, e);
    }
  }
View Full Code Here

   protected UnmarshalException createUnmarshalException(SAXException pException) {
     Exception ex = pException.getException();
     if (ex != null  &&  ex instanceof UnmarshalException) {
       return (UnmarshalException) ex;
     } else {
       return new UnmarshalException(pException);
     }
   }
View Full Code Here

    throws JAXBException
  {
    Object obj = _valueMap.get(in);

    if (obj == null)
      throw new UnmarshalException(L.l("Invalid enum string: {0}", in));

    return obj;
  }
View Full Code Here

  {
    try {
      return UUID.fromString(in);
    }
    catch (IllegalArgumentException e) {
      throw new UnmarshalException(e);
    }
  }
View Full Code Here

            throw new IllegalStateException();
       
        if(!aborted)       return result;
       
        // there was an error.
        throw new UnmarshalException((String)null);
    }
View Full Code Here

        // if the handler says "abort", we will not return the object
        // from the unmarshaller.getResult()
        if(!recover)    aborted = true;
       
        if( !canRecover || !recover )
            throw new SAXException( new UnmarshalException(
                event.getMessage(),
                event.getLinkedException() ) );
    }
View Full Code Here

    InputSource isource;
    try {
      isource = new InputSource(pURL.openStream());
      isource.setSystemId(pURL.toString());
    } catch (IOException e) {
      throw new UnmarshalException("Failed to open URL " + pURL, e);
    }
    return unmarshal(isource);
  }
View Full Code Here

TOP

Related Classes of javax.xml.bind.UnmarshalException

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.