Package org.apache.commons.lang.exception

Examples of org.apache.commons.lang.exception.NestableException


                              ClassLoader loader)
        throws NestableException
    {
        if (className == null)
        {
            throw new NestableException(
                new NullPointerException("String className"));
        }

        Factory factory = getFactory(className);
        if (factory == null)
        {
            if (loader != null)
            {
                Class clazz;
                try
                {
                    clazz = loadClass(className,loader);
                }
                catch (ClassNotFoundException x)
                {
                    throw new NestableException(
                        "Instantiation failed for class " + className,x);
                }
                return getInstance(clazz);
            }
            else
View Full Code Here


                              String[] signature)
        throws NestableException
    {
        if (className == null)
        {
            throw new NestableException(
                new NullPointerException("String className"));
        }

        Factory factory = getFactory(className);
        if (factory == null)
        {
            Class clazz;
            try
            {
                clazz = loadClass(className);
            }
            catch (ClassNotFoundException x)
            {
                throw new NestableException(
                    "Instantiation failed for class " + className,x);
            }
            return getInstance(clazz,params,signature);
        }
        else
View Full Code Here

                              String[] signature)
        throws NestableException
    {
        if (className == null)
        {
            throw new NestableException(
                new NullPointerException("String className"));
        }

        Factory factory = getFactory(className);
        if (factory == null)
        {
            if (loader != null)
            {
                Class clazz;
                try
                {
                    clazz = loadClass(className,loader);
                }
                catch (ClassNotFoundException x)
                {
                    throw new NestableException(
                        "Instantiation failed for class " + className,x);
                }
                return getInstance(clazz,params,signature);
            }
            else
View Full Code Here

        {
            return clazz.newInstance();
        }
        catch (Exception x)
        {
            throw new NestableException(
                "Instantiation failed for " + clazz.getName(),x);
        }
    }
View Full Code Here

            Class[] sign = getSignature(clazz,params,signature);
            return clazz.getConstructor(sign).newInstance(params);
        }
        catch (Exception x)
        {
            throw new NestableException(
                "Instantiation failed for " + clazz.getName(),x);
        }
    }
View Full Code Here

                    factory = (Factory) getInstance((String) factory);
                    ((Factory) factory).initialize(className);
                }
                catch (ClassCastException x)
                {
                    throw new NestableException(
                        "Incorrect factory " + (String) factory +
                            " for class " + className,x);
                }
                catch (Exception x)
                {
                    throw new NestableException(x);
                }
                // was here had to move up
                //catch (ClassCastException x)
                //{
                //    throw new NestableException(
View Full Code Here

    {
        InputStream result = null;
       
        if (name == null || name.length() == 0)
        {
            throw new NestableException ("No template name provided");
        }
       
        try
        {
            ClassLoader classLoader = getClass().getClassLoader();
            result= classLoader.getResourceAsStream( name );
        }
        catch( Exception fnfe )
        {
            // Log and convert to a general Velocity NestableException
            throw new NestableException(fnfe.getMessage());
        }
       
        return result;
    }
View Full Code Here

      cell.setCellStyle( style2 );
    }
    catch ( Exception e ) {
      e.printStackTrace();
      throw new NestableException( "Couldn't setCellStyleProperty.", e );
    }
  }
View Full Code Here

        }
        catch ( Exception e )
        {
            e.printStackTrace();

            throw new NestableException( "Couldn't setCellStyleProperty.", e );
        }
    }
View Full Code Here

            assertEquals("nested 2", messages[2]);
        }
    }
   
    public void testGetThrowable() {
        NotImplementedException ex = new NotImplementedException(new NestableException("nested 1", new NestableException("nested 2")));
       
        assertEquals(3, ex.getThrowableCount());
       
        assertEquals(NotImplementedException.class, ex.getThrowable(0).getClass());
        assertEquals("Code is not implemented", ex.getThrowable(0).getMessage());
View Full Code Here

TOP

Related Classes of org.apache.commons.lang.exception.NestableException

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.