{"id":19792560,"url":"https://github.com/making/csng","last_synced_at":"2025-05-01T02:30:29.560Z","repository":{"id":57714896,"uuid":"253250947","full_name":"making/csng","owner":"making","description":"CSNG is an annotation processor that simply generates property names as constants.","archived":false,"fork":false,"pushed_at":"2020-04-06T13:59:37.000Z","size":144,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-04-06T07:43:11.524Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/making.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":"2020-04-05T14:13:39.000Z","updated_at":"2024-12-09T19:53:18.000Z","dependencies_parsed_at":"2022-09-02T22:11:12.486Z","dependency_job_id":null,"html_url":"https://github.com/making/csng","commit_stats":null,"previous_names":["making/tsng"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/making%2Fcsng","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/making%2Fcsng/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/making%2Fcsng/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/making%2Fcsng/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/making","download_url":"https://codeload.github.com/making/csng/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251812232,"owners_count":21647866,"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":[],"created_at":"2024-11-12T07:07:20.185Z","updated_at":"2025-05-01T02:30:29.297Z","avatar_url":"https://github.com/making.png","language":"Java","readme":"# CSNG (Compile Safe Name Generator)\n\n[![Apache 2.0](https://img.shields.io/github/license/making/csng.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/am.ik.csng/csng/badge.svg)](https://maven-badges.herokuapp.com/maven-central/am.ik.csng/csng) [![Javadocs](https://www.javadoc.io/badge/am.ik.csng/csng.svg)](https://www.javadoc.io/doc/am.ik.csng/csng) [![Actions Status](https://github.com/making/csng/workflows/CI/badge.svg)](https://github.com/making/csng/actions)\n\nCSNG is an annotation processor that simply generates property names as constants.\n\n## How to use\n\nFor Maven:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eam.ik.csng\u003c/groupId\u003e\n    \u003cartifactId\u003ecsng\u003c/artifactId\u003e\n    \u003cversion\u003e0.4.0\u003c/version\u003e\n    \u003coptional\u003etrue\u003c/optional\u003e\n\u003c/dependency\u003e\n```\n\nFor Gradle:\n\n```\nannotationProcessor 'am.ik.csng:csng:0.4.0'\n```\n\n## Examples\n\n### Java Beans\n\n```java\npackage test;\n\nimport am.ik.csng.CompileSafeName;\n\npublic class CarBean {\n    @CompileSafeName\n    private String name;\n    @CompileSafeName\n    private int gas;\n\n    public String getName() {\n        return this.name;\n    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n\n    public int getGas() {\n        return this.gas;\n    }\n\n    public void setGas(int gas) {\n        this.gas = gas;\n    }\n}\n```\n\ngenerates\n\n```java\npackage test;\n\npublic final class _CarBeanName {\n    public static final String LOWER_CAMEL = \"carBean\";\n    public static final String UPPER_CAMEL = \"CarBean\";\n    public static final String LOWER_UNDERSCORE = \"car_bean\";\n    public static final String UPPER_UNDERSCORE = \"CAR_BEAN\";\n\n    public static final class Name {\n        public static final String LOWER_CAMEL = \"name\";\n        public static final String UPPER_CAMEL = \"Name\";\n        public static final String LOWER_UNDERSCORE = \"name\";\n        public static final String UPPER_UNDERSCORE = \"NAME\";\n    }\n\n    public static final class Gas {\n        public static final String LOWER_CAMEL = \"gas\";\n        public static final String UPPER_CAMEL = \"Gas\";\n        public static final String LOWER_UNDERSCORE = \"gas\";\n        public static final String UPPER_UNDERSCORE = \"GAS\";\n    }\n}\n\n```\n\n### Constructor\n\n```java\npackage test;\n\nimport am.ik.csng.CompileSafeParameters;\n\npublic class Car {\n    private final String name;\n    private final int gas;\n\n    @CompileSafeParameters\n    public Car(String name, int gas) {\n        this.name = name;\n        this.gas = gas;\n    }\n\n    public String name() {\n        return this.name;\n    }\n\n    public int gas() {\n        return this.gas;\n    }\n}\n```\n\ngenerates\n\n```java\npackage test;\n\npublic final class _CarParameters {\n    public static final String LOWER_CAMEL = \"Car\";\n    public static final String UPPER_CAMEL = \"Car\";\n    public static final String LOWER_UNDERSCORE = \"Car\";\n    public static final String UPPER_UNDERSCORE = \"Car\";\n\n    public static final class Name {\n        public static final String LOWER_CAMEL = \"name\";\n        public static final String UPPER_CAMEL = \"Name\";\n        public static final String LOWER_UNDERSCORE = \"name\";\n        public static final String UPPER_UNDERSCORE = \"NAME\";\n    }\n\n    public static final class Gas {\n        public static final String LOWER_CAMEL = \"gas\";\n        public static final String UPPER_CAMEL = \"Gas\";\n        public static final String LOWER_UNDERSCORE = \"gas\";\n        public static final String UPPER_UNDERSCORE = \"GAS\";\n    }\n}\n```\n\n## Required\n\n* Java 8+\n\n## License\n\nLicensed under the Apache License, Version 2.0.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaking%2Fcsng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaking%2Fcsng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaking%2Fcsng/lists"}