re base code
[sdc.git] / openecomp-be / api / openecomp-sdc-rest-webapp / vendor-software-products-rest / vendor-software-products-rest-types / src / main / java / org / openecomp / sdcrests / vendorsoftwareproducts / types / validation / IsValidJson.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdcrests.vendorsoftwareproducts.types.validation;
22
23 /**
24  * @since July 13, 2016
25  */
26
27 import org.openecomp.sdcrests.common.RestConstants;
28
29 import javax.validation.Constraint;
30 import javax.validation.Payload;
31 import java.lang.annotation.Documented;
32 import java.lang.annotation.Retention;
33 import java.lang.annotation.Target;
34
35 import static java.lang.annotation.ElementType.*;
36 import static java.lang.annotation.RetentionPolicy.RUNTIME;
37
38 /**
39  * The interface Is valid json.
40  */
41 @Documented
42 @Constraint(validatedBy = CustomJsonValidator.class)
43 @Target({METHOD, FIELD, ANNOTATION_TYPE, PARAMETER, CONSTRUCTOR})
44 @Retention(RUNTIME)
45 public @interface IsValidJson {
46   /**
47    * The constant message.
48    */
49   String message = RestConstants.INVALID_JSON_ERROR_MESSAGE;
50
51   /**
52    * Message string.
53    *
54    * @return the string
55    */
56   String message() default RestConstants.INVALID_JSON_ERROR_MESSAGE;
57
58   /**
59    * Groups class [ ].
60    *
61    * @return the class [ ]
62    */
63   Class<?>[] groups() default {};
64
65   /**
66    * Payload class [ ].
67    *
68    * @return the class [ ]
69    */
70   Class<? extends Payload>[] payload() default {};
71 }
72
73