{"id":17267422,"url":"https://github.com/calvin-l/sjforms","last_synced_at":"2025-08-23T06:33:31.586Z","repository":{"id":19529620,"uuid":"22777148","full_name":"Calvin-L/sjforms","owner":"Calvin-L","description":"A small declarative-style library for validating untrusted input in Java","archived":false,"fork":false,"pushed_at":"2014-08-12T21:27:45.000Z","size":172,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T11:14:03.050Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Calvin-L.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-09T02:39:47.000Z","updated_at":"2024-01-13T23:52:46.000Z","dependencies_parsed_at":"2022-08-24T03:30:37.278Z","dependency_job_id":null,"html_url":"https://github.com/Calvin-L/sjforms","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Calvin-L/sjforms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Calvin-L%2Fsjforms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Calvin-L%2Fsjforms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Calvin-L%2Fsjforms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Calvin-L%2Fsjforms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Calvin-L","download_url":"https://codeload.github.com/Calvin-L/sjforms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Calvin-L%2Fsjforms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271745677,"owners_count":24813521,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-15T08:10:36.351Z","updated_at":"2025-08-23T06:33:31.558Z","avatar_url":"https://github.com/Calvin-L.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SJForms (Simple Java Forms)\n\nThis is a small declarative-style library for validating untrusted input in Java. It is useful for checking HTTP request parameters, command-line parameters, etc.\n\nUsage is fairly straightforward. First declare the structure of your form (usually as static class members):\n\n    Field\u003cString\u003e INPUT_FIELD = Field.stringField(\"input\");\n    Field\u003cInteger\u003e LIMIT_FIELD = Field.intField(\"limit\").required();\n    Form FORM = new Form(INPUT_FIELD, LIMIT_FIELD);\n \nNext load some input and validate it:\n \n    // somehow acquire a Map\u003cString, String\u003e (from field names to input values) called inputMap\n \n    ParseResult parseResult;\n    try {\n      parseResult = FORM.parse(inputMap);\n    } catch (ValidationException e) {\n      System.err.println(\"Input validation failed with message: \" + e.getMessage());\n      return;\n    }\n\n    String input = parseResult.getParsedValue(INPUT_FIELD);\n    int limit = parseResult.getParsedValue(LIMIT_FIELD);\n\nIf the `Form`/`ParseResult` API is too heavy-handed for you, you can just use the `Field` objects to validate data directly:\n\n    // somehow acquire a String called limitString\n    \n    int limit;\n    try {\n      limit = LIMIT_FIELD.validate(limitString);\n    } catch (ValidationException e) {\n      System.err.println(\"Input validation failed with message: \" + e.getMessage());\n      return;\n    }\n\nThe library is totally threadsafe (i.e. the same `Form`s, `Field`s, and other classes can be used from multiple threads concurrently).\n\n## Building\n\nThis project uses the [Gradle](http://www.gradle.org/) build system. It was made using Gradle 2.0, but the build files are very simple and earlier/later versions of Gradle should work just fine. To build:\n\n    $ gradle build\n\nThis will generate jar files in build/libs and examples/build/libs. You can also generate javadoc with Gradle:\n\n    $ gradle javadoc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalvin-l%2Fsjforms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalvin-l%2Fsjforms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalvin-l%2Fsjforms/lists"}