fr.whimtrip.ext.jwhthtmltopojo.annotation.AttrRegexCheck Maven / Gradle / Ivy
package fr.whimtrip.ext.jwhthtmltopojo.annotation;
import fr.whimtrip.ext.jwhthtmltopojo.impl.AcceptIfValidAttrRegexCheck;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
* Part of project jwht-htmltopojo
*
*
* Used together with {@link AcceptIfValidAttrRegexCheck},
* this annotation will provide a way to populate a given
* field only if the HTML element selected attribute value
* matches a custom regex.
*
*
* @author Louis-wht
* @since 1.0.0
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD })
public @interface AttrRegexCheck {
/**
* @return the regex that should be matched.
*/
String value() default "";
/**
* @return the attribute whose value should be looked at.
* Selected element will be the one mentionned in {@link Selector}
* annotation but you can provide a custom attribute to execute
* your regex matching check.
* @see Selector#attr()
*/
String attr() default "class";
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy