{"id":18820812,"url":"https://github.com/coder-acjhp/springmvc-maven-customannotations","last_synced_at":"2026-05-09T10:04:12.118Z","repository":{"id":131076658,"uuid":"89819695","full_name":"Coder-ACJHP/SpringMVC-Maven-CustomAnnotations","owner":"Coder-ACJHP","description":"Custom annotation","archived":false,"fork":false,"pushed_at":"2017-04-30T00:28:57.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-30T03:32:50.249Z","etag":null,"topics":["javax-annotation","javax-validation","maven","spring-mvc","web-app"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Coder-ACJHP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-30T00:02:31.000Z","updated_at":"2022-12-03T10:57:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"0f205d1e-dd30-49f1-a3eb-2ddb1b5c3259","html_url":"https://github.com/Coder-ACJHP/SpringMVC-Maven-CustomAnnotations","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coder-ACJHP%2FSpringMVC-Maven-CustomAnnotations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coder-ACJHP%2FSpringMVC-Maven-CustomAnnotations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coder-ACJHP%2FSpringMVC-Maven-CustomAnnotations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coder-ACJHP%2FSpringMVC-Maven-CustomAnnotations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Coder-ACJHP","download_url":"https://codeload.github.com/Coder-ACJHP/SpringMVC-Maven-CustomAnnotations/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239758831,"owners_count":19692034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javax-annotation","javax-validation","maven","spring-mvc","web-app"],"created_at":"2024-11-08T00:30:15.101Z","updated_at":"2026-05-09T10:04:12.034Z","avatar_url":"https://github.com/Coder-ACJHP.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Javax.validation (Custom annotations)\n\nIn this project we gonna create own validation annotation(s) and for example \nwe will use it in \u003cb\u003eSpring MVC \u0026amp; Maven\u003c/b\u003e web application.\n\nCheck this two classes : \n\n1 : \u003ca href=\"https://github.com/Coder-ACJHP/SpringMVCenterptice/blob/master/src/com/coder/spring/validation/CourseCode.java\"\u003eCourseCode\u003c/a\u003e\nIn this class we need to create \u003cbr\u003e @Annotation class and give it some rules like : @Constraint(\"tell him from which class will gate rules\"), \u003cbr\u003e\n@Target(\"tell to app where it can use it like {ElementType.METHOD//in method, ElementType.FIELD//in fields}\"), @Retention(\"tell to app what the policy like: RetentionPolicy.RUNTIME\")\n\n\u003ccode\u003e\n\n        // define default course code\n\tpublic String value() default \"CoderACJHP\";\n\t\n\t// define default error code\n\tpublic String message() default \"must start with CoderACJHP\";\n\t\n\t// define default grups\n\tpublic Class\u003c?\u003e[] groups() default {};\n\t\n\t// define default peyloads\n\tpublic Class\u003c? extends Payload\u003e[] payload() default {};\n  \n\u003c/code\u003e\n\n\u003cbr\u003e\n2: \u003ca href=\"https://github.com/Coder-ACJHP/SpringMVCenterptice/blob/master/src/com/coder/spring/validation/CourseCodeConstraintValidator.java\"\u003eCourseCodeConstraintValidator\u003c/a\u003e\u003cbr\u003e\n\u003cpre\u003e\nIn this class we need to create validation logic it's very basic, just at first make the \nclass implements ConstraintValidator interface and implemet all methods and override them as you want.\n\u003c/pre\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\u003clabel\u003eThat's it enjoy!\u003c/label\u003e\u003cbr\u003e\n\u003cb\u003e\u003ci\u003eThank you for reading this.\u003ci\u003e\u003cb\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoder-acjhp%2Fspringmvc-maven-customannotations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoder-acjhp%2Fspringmvc-maven-customannotations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoder-acjhp%2Fspringmvc-maven-customannotations/lists"}