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

org.wicketstuff.jsr303.ViolationMessageRenderer Maven / Gradle / Ivy

There is a newer version: 6.30.0
Show newest version
/**
 * 
 */
package org.wicketstuff.jsr303;

import javax.validation.ConstraintViolation;

/**
 * Controls, how to use Messages as resolved by the Validation Framework.
 * 
 * @see Default
 */
public interface ViolationMessageRenderer
{
	String renderPropertyViolation(ConstraintViolation violation);

	String renderBeanViolation(final ConstraintViolation violation);

	class Default implements ViolationMessageRenderer
	{
		public String renderPropertyViolation(final ConstraintViolation violation)
		{
			return "'${label}' " + violation.getMessage();
		}

		public String renderBeanViolation(final ConstraintViolation violation)
		{
			return violation.getMessage();
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy