001 /*
002 * jDTAUS - DTAUS fileformat.
003 * Copyright (c) 2005 Christian Schulte <cs@schulte.it>
004 *
005 * This library is free software; you can redistribute it and/or
006 * modify it under the terms of the GNU Lesser General Public
007 * License as published by the Free Software Foundation; either
008 * version 2.1 of the License, or any later version.
009 *
010 * This library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013 * Lesser General Public License for more details.
014 *
015 * You should have received a copy of the GNU Lesser General Public
016 * License along with this library; if not, write to the Free Software
017 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
018 *
019 */
020 package org.jdtaus.core.container;
021
022 import java.util.Locale;
023
024 /**
025 * Gets thrown for duplicate properties.
026 *
027 * @author <a href="mailto:cs@schulte.it">Christian Schulte</a>
028 * @version $Id: DuplicatePropertyException.java 1914 2007-03-01 02:20:44Z schulte2005 $
029 */
030 public class DuplicatePropertyException extends IllegalArgumentException
031 {
032
033 //--Constructors------------------------------------------------------------
034
035 /**
036 * Creates a new instance of {@code DuplicatePropertyException} taking the
037 * name of the duplicate property.
038 *
039 * @param name the name of the duplicate property.
040 */
041 public DuplicatePropertyException(final String name)
042 {
043 super(DuplicatePropertyExceptionBundle.
044 getDuplicatePropertyMessage(Locale.getDefault()).
045 format(new Object[] { name }));
046
047 this.name = name;
048 }
049
050 //------------------------------------------------------------Constructors--
051 //--DuplicatePropertyException----------------------------------------------
052
053 /***
054 * The name of the duplicate property.
055 * @serial
056 */
057 private String name;
058
059 /**
060 * Gets the name of the duplicate property.
061 *
062 * @return the name of the duplicate property or {@code null}.
063 */
064 public String getName()
065 {
066 return this.name;
067 }
068
069 //----------------------------------------------DuplicatePropertyException--
070
071 }