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

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

There is a newer version: 5.3.2
Show newest version
/*
 * Copyright (C) 2011 All rights reserved
 * VPRO The Netherlands
 */
package nl.vpro.validation;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

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

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

@Target({METHOD, FIELD, ANNOTATION_TYPE, TYPE_USE})
@Retention(RUNTIME)
@Constraint(validatedBy = NoHtmlValidator.class)
@Documented
public @interface NoHtml {
    String message() default "{nl.vpro.constraints.nohtml}";

    Class[] groups() default {};

    Class[] payload() default {};

    /**
     * If 'aggressive' no html is set, then all kind of even remotely like html are rejected. This is the original behaviour.
     * 

* When this is false, the checking will be more subtle, and things like 'email: ' will be accepted. Basically text is only invalid, if jsoup suceeeds finding html tags or entities. * @since 4.3 */ boolean aggressive() default true; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy