All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.robobinding.viewattribute.grouped.AttributeGroupBindingException Maven / Gradle / Ivy

The newest version!
package org.robobinding.viewattribute.grouped;

import static org.robobinding.util.CollectionUtils.isNotEmpty;

import java.util.Collection;
import java.util.Collections;
import java.util.List;

import org.robobinding.util.Lists;
import org.robobinding.viewattribute.AttributeBindingException;

/**
 * 
 * @since 1.0
 * @version $Revision: 1.0 $
 * @author Cheng Wei
 */
@SuppressWarnings("serial")
public class AttributeGroupBindingException extends RuntimeException {
	private List childAttributeErrors;

	public AttributeGroupBindingException() {
		childAttributeErrors = Lists.newArrayList();
	}

	void addChildAttributeError(String attributeName, Throwable cause) {
		childAttributeErrors.add(new AttributeBindingException(attributeName, cause));
	}

	void assertNoErrors() {
		if (hasErrors()) {
			throw this;
		}
	}

	private boolean hasErrors() {
		return isNotEmpty(childAttributeErrors);
	}

	public Collection getChildAttributeErrors() {
		return Collections.unmodifiableCollection(childAttributeErrors);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy