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

nl.vpro.validation.HasTitle Maven / Gradle / Ivy

Go to download

The basic domain classes for 'media', the core of POMS. Also, the 'update' XML bindings for it. It also contains some closely related domain classes like the enum to contain NICAM kijkwijzer settings.

There is a newer version: 8.3.1
Show newest version
package nl.vpro.validation;


import java.lang.annotation.*;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import nl.vpro.domain.TextualObjectUpdate;
import nl.vpro.domain.media.support.TextualType;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Checks if the validated {@link TextualObjectUpdate} has at least one of title of the given {@link #type() types}.
 * @since 7.7
 */
@Target({ METHOD, FIELD, PARAMETER, TYPE_USE })
@Retention(RUNTIME)
@Constraint(validatedBy = HasTitleValidator.class)
@Documented
@Repeatable(HasTitle.List.class)
public @interface HasTitle {
    String message() default "{nl.vpro.constraints.hastitle}";

    Class[] groups() default {};

    Class[] payload() default {};

	/**
	 * The types of the title to require at least one of. Defaults to { {@link TextualType#SUB}, {@link TextualType#MAIN} }
	 */
    TextualType[] type() default {TextualType.SUB, TextualType.MAIN};

	/**
	 * Defines several {@link HasTitle} constraints on the same element.
	 *
	 * @see HasTitle
	 */
	@Target({ METHOD, FIELD, PARAMETER, TYPE_USE })
	@Retention(RUNTIME)
	@Documented
	@interface List {
		HasTitle[] value();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy