{"id":20168251,"url":"https://github.com/neziw/dependencyinjector","last_synced_at":"2025-10-05T01:52:22.860Z","repository":{"id":259100047,"uuid":"876313971","full_name":"neziw/DependencyInjector","owner":"neziw","description":"A lightweight and easy-to-use dependency injection framework in Java","archived":false,"fork":false,"pushed_at":"2025-09-29T16:50:36.000Z","size":229,"stargazers_count":4,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-29T18:38:55.655Z","etag":null,"topics":["dependencies","dependency-injection","dependencyinjection","di","gradle","java","java-reflection","java-reflection-api","maven","reflection","reflections"],"latest_commit_sha":null,"homepage":"","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/neziw.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-21T18:57:37.000Z","updated_at":"2025-06-06T01:53:11.000Z","dependencies_parsed_at":"2025-04-10T01:52:41.147Z","dependency_job_id":"7b3c9e5a-d3a0-4d57-bcf8-150c48929acb","html_url":"https://github.com/neziw/DependencyInjector","commit_stats":null,"previous_names":["neziw/dependencyinjector"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/neziw/DependencyInjector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neziw%2FDependencyInjector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neziw%2FDependencyInjector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neziw%2FDependencyInjector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neziw%2FDependencyInjector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neziw","download_url":"https://codeload.github.com/neziw/DependencyInjector/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neziw%2FDependencyInjector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278399611,"owners_count":25980331,"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-10-04T02:00:05.491Z","response_time":63,"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":["dependencies","dependency-injection","dependencyinjection","di","gradle","java","java-reflection","java-reflection-api","maven","reflection","reflections"],"created_at":"2024-11-14T01:07:01.903Z","updated_at":"2025-10-05T01:52:22.842Z","avatar_url":"https://github.com/neziw.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DependencyInjector\n\nA lightweight and easy-to-use dependency injection framework in Java, featuring constructor-based injection and automatic post-construction method invocation with `@Inject` and `@PostConstruct` annotations.\n\n### Example Usage:\n```java\nimport ovh.neziw.injector.Injector;\n\npublic final class MyApplication {\n\n    public static void main(final String[] args) {\n        final Injector injector = new Injector();\n        injector.bind(FirstService.class, new FirstService());\n        injector.bind(SecondService.class, new SecondService());\n\n        final MyClass myClass = injector.createInstance(MyClass.class);\n        myClass.sendMessages();\n    }\n}\n```\n\n```java\nimport ovh.neziw.injector.Inject;\nimport ovh.neziw.injector.PostConstruct;\n\npublic class MyClass {\n\n    private final FirstService firstService;\n    private final SecondService secondService;\n\n    @Inject\n    public MyClass(final FirstService firstService, final SecondService secondService) {\n        this.firstService = firstService;\n        this.secondService = secondService;\n    }\n\n    @PostConstruct\n    void init() {\n        System.out.println(\"Example PostConstruct method called\");\n    }\n\n    public void sendMessages() {\n        this.firstService.doSomething();\n        System.out.println(this.secondService.getSecondServiceMessage());\n    }\n}\n```\n\n```java\npublic class FirstService {\n\n    public void doSomething() {\n        System.out.println(\"Sending something from FirstService\");\n    }\n}\n\npublic class SecondService {\n\n    public String getSecondServiceMessage() {\n        return \"This is the second service message!\";\n    }\n}\n```\n\n**Output**:\n```\n\u003e Example PostConstruct method called\n\u003e Sending something from FirstService\n\u003e This is the second service message!\n```\n\n### Adding dependency\n\n**Maven:**\n```xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003eneziw-repo\u003c/id\u003e\n        \u003curl\u003ehttps://repo.neziw.ovh/releases\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003eovh.neziw\u003c/groupId\u003e\n        \u003cartifactId\u003eDependencyInjector\u003c/artifactId\u003e\n        \u003cversion\u003e1.0.0\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n**Gradle:**\n```groovy\nrepositories {\n    maven {\n        name \"neziw-repo\"\n        url \"https://repo.neziw.ovh/releases\"\n    }\n}\n\nimplementation \"ovh.neziw:DependencyInjector:1.0.0\"\n```\n\n---\nSpecial thanks to [JetBrains](https://www.jetbrains.com/products/) company for providing development tools used to develop this project.\n\n[\u003cimg src=\"https://user-images.githubusercontent.com/65517973/210912946-447a6b9a-2685-4796-9482-a44bffc727ce.png\" alt=\"JetBrains\" width=\"150\"\u003e](https://www.jetbrains.com)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneziw%2Fdependencyinjector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneziw%2Fdependencyinjector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneziw%2Fdependencyinjector/lists"}