/*
Copyright 2002-2005 The Members of the OSS through Java(TM) Initiative.
All rights reserved. Use is subject to license terms.
*/
package javax.oss;


/**
 * Similar to javax.oss.OssIllegalArgumentException,
 * except it specifically refers to a bad value associated
 * with an attribute name within an AttributeAccess object.
 *
 * This exception is thrown if an AttributeAccess object passed
 * to a remote method contains an attribute with a bad value.
 *
 * <p>
 * Note: This exception replaces the deprecated javax.oss.IllegalAttributeValueException
 *
 * @author OSS through Java Initiative, Vincent Perrot Sun Microsystems Inc.
 * @version 1.2
 * @since August 2005
 * @ossj:exception
 */

//AB decision 2005-08-12: Use OSS prefix for all OSSJ exception and respect the Exception inheritence
public class OssIllegalAttributeValueException extends javax.oss.OssIllegalArgumentException {
    //public class OssIllegalAttributeValueException extends IllegalAttributeValueException {
    private String attributeName;

    /**
     * Constructs an OssIllegalAttributeValueException with no detail message.
     */
    public OssIllegalAttributeValueException() {
        super();
    }

    /**
     * Constructs an OssIllegalAttributeValueException with the attribute name in error and the specified detail message.
     *
     * @param nameOfBadAttribute the name of the attribute with the bad value.
     * @param message description of the problem.
     */
    public OssIllegalAttributeValueException(String nameOfBadAttribute, String message) {
        super(message);
        attributeName = nameOfBadAttribute;
    }

    /**
     * Returns the name of the Illegal attribute
     *
     * @return the illegal attribute name
     *
     * @ossj:minOccursField value=1
     * @ossj:nillableField value=false
     */
    public String getIllegalAttributeName() {
        return attributeName;
    }
}
