|
| 1 | +/* |
| 2 | + * Copyright (C) 2009-2019 Slava Semushin <[email protected]> |
| 3 | + * |
| 4 | + * This program is free software; you can redistribute it and/or modify |
| 5 | + * it under the terms of the GNU General Public License as published by |
| 6 | + * the Free Software Foundation; either version 2 of the License, or |
| 7 | + * (at your option) any later version. |
| 8 | + * |
| 9 | + * This program is distributed in the hope that it will be useful, |
| 10 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | + * GNU General Public License for more details. |
| 13 | + * |
| 14 | + * You should have received a copy of the GNU General Public License |
| 15 | + * along with this program; if not, write to the Free Software |
| 16 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | + */ |
| 18 | +package ru.mystamps.web.feature.series.importing; |
| 19 | + |
| 20 | +import javax.validation.Constraint; |
| 21 | +import javax.validation.Payload; |
| 22 | +import java.lang.annotation.Documented; |
| 23 | +import java.lang.annotation.Retention; |
| 24 | +import java.lang.annotation.Target; |
| 25 | + |
| 26 | +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; |
| 27 | +import static java.lang.annotation.ElementType.FIELD; |
| 28 | +import static java.lang.annotation.ElementType.METHOD; |
| 29 | +import static java.lang.annotation.RetentionPolicy.RUNTIME; |
| 30 | + |
| 31 | +// @todo #690 Series import: add integration test to check that URL can be parsed |
| 32 | +// @todo #1027 Series sale import: add integration test to check that URL can be parsed |
| 33 | +/** |
| 34 | + * Validates that the URL can be parsed by one of the site parsers. |
| 35 | + */ |
| 36 | +@Target({ METHOD, FIELD, ANNOTATION_TYPE }) |
| 37 | +@Retention(RUNTIME) |
| 38 | +@Constraint(validatedBy = HasSiteParserValidator.class) |
| 39 | +@Documented |
| 40 | +public @interface HasSiteParser { |
| 41 | + String message() default "{ru.mystamps.web.feature.series.importing.HasSiteParser.message}"; |
| 42 | + Class<?>[] groups() default {}; |
| 43 | + Class<? extends Payload>[] payload() default {}; |
| 44 | +} |
0 commit comments