
package com.exedio.cope.lib;

/**
 * Is thrown, when a persistent modification tries to set a not-null attribute to null.
 */
public final class NotNullViolationException extends ConstraintViolationException
{
	private final Item item;
	private final Attribute notNullAttribute;
	
	/**
	 * Creates a new NotNullViolationException with the neccessary information about the violation.
	 * @param item initializes, what is returned by {@link #getItem()}.
	 * @param notNullAttribute initializes, what is returned by {@link #getNotNullAttribute()}.
	 */
	public NotNullViolationException(final Item item, final Attribute notNullAttribute)
	{
		this.item = item;
		this.notNullAttribute = notNullAttribute;
	}
	
	/**
	 * Returns the item that was tried to be modified.
	 */
	public final Item getItem()
	{
		return item;
	}

	/**
	 * Returns the attribute, that was tried to be written.
	 */
	public Attribute getNotNullAttribute()
	{
		return notNullAttribute;
	}

}

@@ -35,91 +35,301 @@
 %0A * 
-Is thrown, when a persistent modification tries to set a not-null attribute to 
+Signals, that an attempt to write an attribute has been failed,%0A * because it cannot be written with a null value.%0A *%0A * This exception will be thrown by %7B@link Item#setAttribute Item.setAttribute%7D methods%0A * and item constructors%0A * if that attribute is %7B@link Attribute#isNotNull() not-
 null
+%7D
 .%0A *
@@ -938,35 +938,39 @@
 e item that was 
-tri
+attempt
 ed to be modifie
@@ -1069,19 +1069,23 @@
 hat was 
-tri
+attempt
 ed to be

document NotNullViolationException