001/*
002 * Copyright (c) 2004-2012, Willem Cazander
003 * All rights reserved.
004 *
005 * Redistribution and use in source and binary forms, with or without modification, are permitted provided
006 * that the following conditions are met:
007 * 
008 * * Redistributions of source code must retain the above copyright notice, this list of conditions and the
009 *   following disclaimer.
010 * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
011 *   the following disclaimer in the documentation and/or other materials provided with the distribution.
012 * 
013 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
014 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
015 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
016 * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
017 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
018 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
019 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
020 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
021 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
022 */
023
024package org.x4o.xml.element;
025
026
027/**
028 * ElementConfiguratorException.<br>
029 * 
030 * @author Willem Cazander
031 * @version 1.0 Aug 28, 2008
032 */
033@SuppressWarnings("serial")
034public class ElementConfiguratorException extends ElementException {
035        
036        private ElementConfigurator elementConfigurator = null;
037        
038        /**
039         * Creates an configurator exception.
040         * @param config        The ElementConfigurator.
041         * @param message       The error message.
042         */
043        public ElementConfiguratorException(ElementConfigurator config,String message) {
044                super(message);
045                this.elementConfigurator=config;
046        }
047        
048        /**
049         * Creates an configurator exception.
050         * @param config        The ElementConfigurator.
051         * @param message       The error message.
052         * @param exception     The error exception.
053         */
054        public ElementConfiguratorException(ElementConfigurator config,String message,Exception exception) {
055                super(message,exception);
056                this.elementConfigurator=config;
057        }
058        
059        /**
060         * Creates an configurator exception.
061         * @param config        The ElementConfigurator.
062         * @param message       The error message.
063         * @param exception     The wrapped element error exception.
064         */
065        public ElementConfiguratorException(ElementConfigurator config,String message,ElementException exception) {
066                super(message,exception);
067                this.elementConfigurator=config;
068        }
069        
070        /**
071         * Gets the ElementConfigurator which has thrown this exception.
072         * @return      The ElementConfigurator.
073         */
074        public ElementConfigurator getElementConfigurator() {
075                return elementConfigurator;
076        }
077}