[SDC-29] Amdocs OnBoard 1707 initial commit.
[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 static java.lang.annotation.ElementType.ANNOTATION_TYPE;
28 import static java.lang.annotation.ElementType.CONSTRUCTOR;
29 import static java.lang.annotation.ElementType.FIELD;
30 import static java.lang.annotation.ElementType.METHOD;
31 import static java.lang.annotation.ElementType.PARAMETER;
32 import static java.lang.annotation.RetentionPolicy.RUNTIME;
33
34 import org.openecomp.sdcrests.common.RestConstants;
35
36 import java.lang.annotation.Documented;
37 import java.lang.annotation.Retention;
38 import java.lang.annotation.Target;
39 import javax.validation.Constraint;
40 import javax.validation.Payload;
41
42 /**
43  * The interface Is valid json.
44  */
45 @Documented
46 @Constraint(validatedBy = CustomJsonValidator.class)
47 @Target({METHOD, FIELD, ANNOTATION_TYPE, PARAMETER, CONSTRUCTOR})
48 @Retention(RUNTIME)
49 public @interface IsValidJson {
50   /**
51    * The constant message.
52    */
53   String message = RestConstants.INVALID_JSON_ERROR_MESSAGE;
54
55   /**
56    * Message string.
57    *
58    * @return the string
59    */
60   String message() default RestConstants.INVALID_JSON_ERROR_MESSAGE;
61
62   /**
63    * Groups class [ ].
64    *
65    * @return the class [ ]
66    */
67   Class<?>[] groups() default {};
68
69   /**
70    * Payload class [ ].
71    *
72    * @return the class [ ]
73    */
74   Class<? extends Payload>[] payload() default {};
75 }
76
77