Package org.apache.commons.configuration2.ex

Examples of org.apache.commons.configuration2.ex.ConfigurationRuntimeException


        XMLBuilderParametersImpl params = new XMLBuilderParametersImpl()
        {
            @Override
            public XMLBuilderParametersImpl clone()
            {
                throw new ConfigurationRuntimeException();
            }
        };
        assertSame("Wrong result", params,
                ConfigurationUtils.cloneIfPossible(params));
    }
View Full Code Here


            new FileHandler(c).load(TEST_FILE);
            return c;
        }
        catch (ConfigurationException cex)
        {
            throw new ConfigurationRuntimeException(cex);
        }
    }
View Full Code Here

        {
            FileSystemManager fsManager = VFS.getManager();
            String uri = resolveFileURI();
            if (uri == null)
            {
                throw new ConfigurationRuntimeException("Unable to determine file to monitor");
            }
            return fsManager.resolveFile(uri);
        }
        catch (FileSystemException fse)
        {
            String msg = "Unable to monitor " + getFileHandler().getURL().toString();
            log.error(msg);
            throw new ConfigurationRuntimeException(msg, fse);
        }
    }
View Full Code Here

                return copy;
            }
            catch (CloneNotSupportedException cnex)
            {
                // This cannot happen!
                throw new ConfigurationRuntimeException(cnex);
            }
        }
View Full Code Here

     * @return the exception with the error message
     */
    private static ConfigurationRuntimeException constructorMatchingException(
            Class<?> beanClass, BeanDeclaration data, String msg)
    {
        return new ConfigurationRuntimeException(String.format(FMT_CTOR_ERROR,
                msg, beanClass.getName(), getConstructorArgs(data).toString()));
    }
View Full Code Here

            String key)
    {
        List<ImmutableNode> targetNodes = fetchFilteredNodeResults(key);
        if (targetNodes.size() != 1)
        {
            throw new ConfigurationRuntimeException(
                    "Passed in key must select exactly one node: " + key);
        }
        BaseHierarchicalConfiguration sub =
                new BaseHierarchicalConfiguration(new InMemoryNodeModel(
                        targetNodes.get(0)));
View Full Code Here

            if (node.matchesConfigRootNode(config))
            {
                return new XMLBeanDeclaration(config, node);
            }
        }
        throw new ConfigurationRuntimeException("Unable to match node for "
                + node.nodeName());
    }
View Full Code Here

     */
    private void checkResultInstance(Object inst)
    {
        if (!getResultClass().isInstance(inst))
        {
            throw new ConfigurationRuntimeException(
                    "Incompatible result object: " + inst);
        }
    }
View Full Code Here

     */
    private static void initProperty(Object bean, String propName, Object value)
    {
        if (!isPropertyWriteable(bean, propName))
        {
            throw new ConfigurationRuntimeException("Property " + propName
                    + " cannot be set on " + bean.getClass().getName());
        }

        try
        {
            BEAN_UTILS_BEAN.setProperty(bean, propName, value);
        }
        catch (IllegalAccessException iaex)
        {
            throw new ConfigurationRuntimeException(iaex);
        }
        catch (InvocationTargetException itex)
        {
            throw new ConfigurationRuntimeException(itex);
        }
    }
View Full Code Here

        {
            return factory.createBean(bcc);
        }
        catch (Exception ex)
        {
            throw new ConfigurationRuntimeException(ex);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.configuration2.ex.ConfigurationRuntimeException

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.