{"id":19656122,"url":"https://github.com/daggerok/daggerok-context","last_synced_at":"2026-05-12T21:03:25.481Z","repository":{"id":57719687,"uuid":"123643086","full_name":"daggerok/daggerok-context","owner":"daggerok","description":"Simplest dependency injection library ever! Small and fast, supports java 1.5+, processing @Inject (and optionally @Singleton) annotation, JSR-330","archived":false,"fork":false,"pushed_at":"2018-09-06T20:47:34.000Z","size":259,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T02:18:52.586Z","etag":null,"topics":["application-configuration","application-context","bean","beans","cdi","dependency-injection","dependency-injection-container","inject","inversion-of-control","ioc","singleton"],"latest_commit_sha":null,"homepage":"https://bintray.com/bintray/jcenter?filterByPkgName=daggerok-context","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/daggerok.png","metadata":{"files":{"readme":"README.adoc","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":"2018-03-02T23:54:11.000Z","updated_at":"2018-09-06T20:47:36.000Z","dependencies_parsed_at":"2022-09-26T21:40:56.077Z","dependency_job_id":null,"html_url":"https://github.com/daggerok/daggerok-context","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/daggerok/daggerok-context","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daggerok%2Fdaggerok-context","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daggerok%2Fdaggerok-context/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daggerok%2Fdaggerok-context/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daggerok%2Fdaggerok-context/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daggerok","download_url":"https://codeload.github.com/daggerok/daggerok-context/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daggerok%2Fdaggerok-context/sbom","scorecard":{"id":316799,"data":{"date":"2025-08-11","repo":{"name":"github.com/daggerok/daggerok-context","commit":"deedf2d28a7a162b283a7694112ed7551992b94c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":0.8,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/23 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":0,"reason":"binaries present in source code","details":["Warn: binary detected: .mvn/wrapper/maven-wrapper.jar:1","Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1","Warn: binary detected: samples/bintray001/.mvn/wrapper/maven-wrapper.jar:1","Warn: binary detected: samples/bintray001/gradle/wrapper/gradle-wrapper.jar:1","Warn: binary detected: samples/bintray104/.mvn/wrapper/maven-wrapper.jar:1","Warn: binary detected: samples/bintray104/gradle/wrapper/gradle-wrapper.jar:1","Warn: binary detected: samples/central104/.mvn/wrapper/maven-wrapper.jar:1","Warn: binary detected: samples/central104/gradle/wrapper/gradle-wrapper.jar:1","Warn: binary detected: samples/jitpack001/.mvn/wrapper/maven-wrapper.jar:1","Warn: binary detected: samples/jitpack001/gradle/wrapper/gradle-wrapper.jar:1","Warn: binary detected: samples/jitpack104/.mvn/wrapper/maven-wrapper.jar:1","Warn: binary detected: samples/jitpack104/gradle/wrapper/gradle-wrapper.jar:1","Warn: binary detected: samples/jitpackmaster/.mvn/wrapper/maven-wrapper.jar:1","Warn: binary detected: samples/jitpackmaster/gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'","Warn: branch protection not enabled for branch 'release'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: samples/bintray001/.mvn/Dockerfile:1: pin your Docker image by updating openjdk:8u151-jre-alpine3.7 to openjdk:8u151-jre-alpine3.7@sha256:795d1c079217bdcbff740874b78ddea80d5df858b3999951a33871ee61de15ce","Warn: containerImage not pinned by hash: samples/bintray001/gradle/Dockerfile:1: pin your Docker image by updating openjdk:8u151-jre-alpine3.7 to openjdk:8u151-jre-alpine3.7@sha256:795d1c079217bdcbff740874b78ddea80d5df858b3999951a33871ee61de15ce","Warn: containerImage not pinned by hash: samples/bintray104/.mvn/Dockerfile:1: pin your Docker image by updating openjdk:8u151-jre-alpine3.7 to openjdk:8u151-jre-alpine3.7@sha256:795d1c079217bdcbff740874b78ddea80d5df858b3999951a33871ee61de15ce","Warn: containerImage not pinned by hash: samples/bintray104/gradle/Dockerfile:1: pin your Docker image by updating openjdk:8u151-jre-alpine3.7 to openjdk:8u151-jre-alpine3.7@sha256:795d1c079217bdcbff740874b78ddea80d5df858b3999951a33871ee61de15ce","Warn: containerImage not pinned by hash: samples/central104/.mvn/Dockerfile:1: pin your Docker image by updating openjdk:8u151-jre-alpine3.7 to openjdk:8u151-jre-alpine3.7@sha256:795d1c079217bdcbff740874b78ddea80d5df858b3999951a33871ee61de15ce","Warn: containerImage not pinned by hash: samples/central104/gradle/Dockerfile:1: pin your Docker image by updating openjdk:8u151-jre-alpine3.7 to openjdk:8u151-jre-alpine3.7@sha256:795d1c079217bdcbff740874b78ddea80d5df858b3999951a33871ee61de15ce","Warn: containerImage not pinned by hash: samples/jitpack001/.mvn/Dockerfile:1: pin your Docker image by updating openjdk:8u151-jre-alpine3.7 to openjdk:8u151-jre-alpine3.7@sha256:795d1c079217bdcbff740874b78ddea80d5df858b3999951a33871ee61de15ce","Warn: containerImage not pinned by hash: samples/jitpack001/gradle/Dockerfile:1: pin your Docker image by updating openjdk:8u151-jre-alpine3.7 to openjdk:8u151-jre-alpine3.7@sha256:795d1c079217bdcbff740874b78ddea80d5df858b3999951a33871ee61de15ce","Warn: containerImage not pinned by hash: samples/jitpack104/.mvn/Dockerfile:1: pin your Docker image by updating openjdk:8u151-jre-alpine3.7 to openjdk:8u151-jre-alpine3.7@sha256:795d1c079217bdcbff740874b78ddea80d5df858b3999951a33871ee61de15ce","Warn: containerImage not pinned by hash: samples/jitpack104/gradle/Dockerfile:1: pin your Docker image by updating openjdk:8u151-jre-alpine3.7 to openjdk:8u151-jre-alpine3.7@sha256:795d1c079217bdcbff740874b78ddea80d5df858b3999951a33871ee61de15ce","Warn: containerImage not pinned by hash: samples/jitpackmaster/.mvn/Dockerfile:1: pin your Docker image by updating openjdk:8u151-jre-alpine3.7 to openjdk:8u151-jre-alpine3.7@sha256:795d1c079217bdcbff740874b78ddea80d5df858b3999951a33871ee61de15ce","Warn: containerImage not pinned by hash: samples/jitpackmaster/gradle/Dockerfile:1: pin your Docker image by updating openjdk:8u151-jre-alpine3.7 to openjdk:8u151-jre-alpine3.7@sha256:795d1c079217bdcbff740874b78ddea80d5df858b3999951a33871ee61de15ce","Info:   0 out of  12 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-5mg8-w23w-74h3","Warn: Project is vulnerable to: GHSA-7g45-4rm6-3mm3","Warn: Project is vulnerable to: GHSA-mvr2-9pj6-7w5j","Warn: Project is vulnerable to: GHSA-vmq6-5m68-f53m","Warn: Project is vulnerable to: GHSA-668q-qrv7-99fm","Warn: Project is vulnerable to: GHSA-6v67-2wr5-gvf4","Warn: Project is vulnerable to: GHSA-pr98-23f8-jwxv"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T00:22:49.971Z","repository_id":57719687,"created_at":"2025-08-18T00:22:49.971Z","updated_at":"2025-08-18T00:22:49.971Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285519534,"owners_count":27185526,"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-11-20T02:00:05.334Z","response_time":54,"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":["application-configuration","application-context","bean","beans","cdi","dependency-injection","dependency-injection-container","inject","inversion-of-control","ioc","singleton"],"created_at":"2024-11-11T15:26:13.841Z","updated_at":"2025-11-20T22:04:15.758Z","avatar_url":"https://github.com/daggerok.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= daggerok-context java 1.5+\n:toc:\n:toc-placement!:\n\n//tag::content[]\nimage:https://travis-ci.org/daggerok/daggerok-context.svg?branch=master[\"Build Status\", link=\"https://travis-ci.org/daggerok/daggerok-context\"]\nimage:https://api.bintray.com/packages/daggerok/daggerok/daggerok-context/images/download.svg[link=\"https://bintray.com/bintray/jcenter?filterByPkgName=daggerok-context\"]\nimage:https://jitpack.io/v/daggerok/daggerok-context.svg[\"JitPack\", link=\"https://jitpack.io/#daggerok/daggerok-context\"]\nimage:https://maven-badges.herokuapp.com/maven-central/com.github.daggerok/daggerok-context/badge.svg?style=plastic[\"Maven Central\", link=\"https://maven-badges.herokuapp.com/maven-central/com.github.daggerok/daggerok-context\"]\n\ntoc::[]\n\n== description\nSimplest lightly dependency injection library for java ever!\nProcessing @Inject and optionally @Singleton annotations from JSR-330\nMinimal supported java version: 1.5\n\n== installation\n\nimage:https://www.bintray.com/docs/images/bintray_badge_color.png[\"daggerok-context\", link=\"https://bintray.com/daggerok/daggerok/daggerok-context?source=watch\"]\n\n.build.gradle\n[source,gradle]\n----\nrepositories {\n  jcenter()      // available in bintray\n  // or\n  mavenCentral() // also available in maven central\n}\n\ndependencies {\n  compile \"com.github.daggerok:daggerok-context:1.0.4\"\n}\n----\n\n//image:http://maven.apache.org/images/maven-logo-black-on-white.png[\"daggerok-context\", link=\"https://maven-badges.herokuapp.com/maven-central/com.github.daggerok/daggerok-context\"]\n//image:http://maven.apache.org/images/maven-logo-black-on-white.png[\"daggerok-context\", link=\"https://search.maven.org/beta/artifact/com.github.daggerok/daggerok-context/1.0.4/jar\"]\nimage:http://maven.apache.org/images/maven-logo-black-on-white.png[\"daggerok-context\", link=\"https://search.maven.org/artifact/com.github.daggerok/daggerok-context/1.0.4/jar\"]\n\n.pom.xml\n[source,xml]\n----\n\u003cdependencies\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.daggerok\u003c/groupId\u003e\n    \u003cartifactId\u003edaggerok-context\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.4\u003c/version\u003e\n  \u003c/dependency\u003e\n\u003c/dependencies\u003e\n\n\u003c!-- only for bintray use case: --\u003e\n\u003crepositories\u003e\n  \u003crepository\u003e\n    \u003cid\u003ejcentral\u003c/id\u003e\n    \u003curl\u003ehttps://jcenter.bintray.com\u003c/url\u003e\n  \u003c/repository\u003e\n\u003c/repositories\u003e\n----\n\n== usage\n.MyRepostory.java - let's say we have repository component (annotation @Singleton is optional)\n[source,java]\n----\n@Singleton\npublic class MyRepository {\n\n  public String repositoryMethod() {\n    return \"MyRepository.repositoryMethod\";\n  }\n}\n----\n\n.MyClient.java - we also have another component with auto injectior, i.e: creates new empty HashMap automatically if it's not exists using default constructor\n[source,java]\n----\npublic class MyClient {\n\n  private final HashMap\u003cString, Object\u003e config;\n\n  @Inject\n  public MyClient(HashMap\u003cString, Object\u003e config) {\n    this.config = config;\n  }\n\n  public String clientMethod() {\n    return \"MyClient.clientMethod\" + config.size();\n  }\n}\n----\n\n.MyService.java - lastly, we have service with two injectors MyRepository / MyClient Annotation @Inject is required. Class can have only one constructor with all injectors configuration\n[source,java]\n----\npublic class MyService {\n\n  private final MyClient myClient;\n  private final MyRepository myRepository;\n\n  @Inject\n  public MyService(MyClient myClient, MyRepository myRepository) {\n    this.myClient = myClient;\n    this.myRepository = myRepository;\n  }\n\n  public String serviceMethod() {\n    return myClient.clientMethod() + myRepository.repositoryMethod();\n  }\n}\n----\n\n.MyAppTest.class - and finally test application\n[source,java]\n----\npublic class MyAppTest {\n\n  @Test\n  public void test() {\n\n    DaggerokContext applicationContext = DaggerokContext.create(MyAppTest.class)\n                                                        .initialize();\n    /*\n      initialize() method will do:\n\n      1. scan everithyng in base package of MyAppTest\n      2. create MyRepository instance in applicationContext\n      3. using default constructor create HashMap instance in applicationContext\n      4. inject HashMap and create MyClient instance in applicationContext\n      5. inject MyRepository and MyClient and create MyService instance in applicationContext\n    */\n\n    MyService myService = applicationContext.getBean(MyService.class);\n    String actual = myService.serviceMethod();\n\n    assertTrue(actual.contains(\"MyClient.clinetMethod\"));\n    assertTrue(actual.contains(\"MyRepository.repositoryMethod\"));\n    assertTrue(actual.contains(\"0\"));\n\n    HashMap config = applicationContext.getBean(HashMap.class);\n    config.put(\"message\", \"hello\");\n    assertTrue(myService.serviceMethod().contains(\"1\"));\n  }\n}\n----\n\n== public API overview\n=== Entry point: create uninitialized context using:\n. `DaggerokContext#create()`\n. `DaggerokContext#create(Class...)`\n. `DaggerokContext#create(Package...)`\n. `DaggerokContext#create(String...)`\n\n.many ways create context\n[source,java]\n----\n// empty context with single DaggerokContext bean registered:\nDaggerokContext.create();\n\n// by base class:\nDaggerokContext.create(MyApp.class);\n\n// by base packages:\nDaggerokContext.create(MyApp.class.getPackage(), Package.getPackages());\n\n// create context by packages:\nDaggerokContext.create(\"my.app\", \"my.other.app\");\n\n// we are not recommend create context from empty package, but it's possible :)\nDaggerokContext.create(\"\");\n\n// we also do not recommend create context for all packages in classpath, and yes, it's possible too :)\nDaggerokContext.create(Package.getPackages());\n----\n\n=== User configurations:\n. `DaggerokContext#withBasePackageClasses(Class...)`\n. `DaggerokContext#withBasePackageNames(String...)`\n. `DaggerokContext#withBasePackages(Package...)`\n. `DaggerokContext#withComponents(Annotation)`\n. `DaggerokContext#withInjectors(Annotation)`\n. `DaggerokContext#failOnInjectNullRef(boolean)`\n. `DaggerokContext#failOnBeanCreationError(boolean)`\n. `DaggerokContext#failOnUnknownReflectionsErrors(boolean)`\n\n.create simple (empty) context and add base packages configurations for scan\n[source,java]\n----\nfinal DaggerokContext applicationContext = DaggerokContext.create();\n// ...\napplicationContext.withBasePackageNames(\"my.app\");\napplicationContext.withBasePackageClasses(my.app.Config);\napplicationContext.withBasePackages(Package.getPackage(\"my.other.app.pkg\"));\n----\n\n.set custom component annotation\n[source,java]\n----\napplicationContext.withComponents(Singleton.class);\n----\n\n.set custom injector annotation\n[source,java]\n----\napplicationContext.withInjectors(Inject.class);\n----\n\n.fail on inject null bean\n[source,java]\n----\napplicationContext.failOnInjectNullRef(false);\n----\n\n.fail on bean creation error Class.newInstance()\n[source,java]\n----\napplicationContext.failOnBeanCreationError(false);\n----\n\n.fail on unknown Reflections library errors\n[source,java]\n----\napplicationContext.failOnUnknownReflectionsErrors(false);\n----\n\n=== Manual beans registration:\n. `DaggerokContext#register(String, Object)`\n. `DaggerokContext#register(Class, Object)`\n\n.manually bean register\n[source,java]\n----\n// by class:\napplicationContext.register(MyRepostory.class, new MyRepository())\n                  .register(\"java.util.Map\", singletonMap(\"hello\", \"world\"))\n                  .register(String.class, \"Hello, World!\");\n\n// by name:\napplicationContext.register(\"my.app.MyBean\", new MyBean(\"custom bean initialization...\"))\n                  .register(\"java.lang.String\", \"Hey, y0!\");\n----\n\n=== Search, create and inject everything we can:\n. `DaggerokContext#initialize()`\n\n.minimal required configuration\n[source,java]\n----\nDaggerokContext.create(\"\")\n               .initialize();\n----\n\n.other possible configuration\n[source,java]\n----\nDaggerokContext applicationContext = DaggerokContext.create(String.class)\n                                                    .failOnInjectNullRef(true)\n                                                    .register(String.class, \"Hello, World!\")\n                                                    .initialize();\n\nSystem.out.println(applicationContext.getBean(String.class));\n----\n\n=== Get bean from context - could be used before initialize() if bean was previously manually added:\n. `DaggerokContext#getBean(Class)`\n. `DaggerokContext#getBean(String, Class)`\n. `DaggerokContext#getBean(String)`\n\n.build application context\n[source,java]\n----\n// get bean by class\nMyRepository myRepository = applicationContext.getBean(MyRepository.class);\nMap\u003cString, String\u003e map = applicationContext.getBean(Map.class);\nString string = applicationContext.getBean(String.class);\n\n// get named beans\nMap\u003cString, String\u003e map = applicationContext.getBean(\"java.util.Map\", Map.class);\nHashMap\u003cString, String\u003e myOtherMap = applicationContext.getBean(\"myOtherMap\", HashMap.class);\n\n// get named beans (unchecked)\nMap\u003cString, String\u003e map = applicationContext.getBean(\"java.util.Map\");\nHashMap\u003cString, String\u003e myOtherMap = applicationContext.getBean(\"myOtherMap\");\nString string = applicationContext.getBean(\"java.lan.String\");\nString oneMoreString = applicationContext.getBean(\"oneMoreString\");\n----\n\n== why?\n\n* no more magic!\n* no more xml!\n* no more weight dependencies!\n* no more evil field injections!\n* no more abstract modules!\n* no more plugins configurations!\n* no more annotation processing configurations!\n* no more custom annotations clones! use standards, use JSR-330!\n* no more specific build configurations! single dependency only!\n\n=== it's really simple\n\n* JSR-330: supports only @Inject\n* all class-based registration creates singletons\n* supports custom named beans registration\n\nIt's simple. Simple means fast, less bugs, more fun. It's doing one thing and doing it well\nlink:https://github.com/daggerok/daggerok-context/issues[...unless you found a bug :)]\n\n== other installation variants\n=== gradle bintray.daggerok\n.gradle setup (build.gradle)\n[source,gradle]\n----\nrepositories {\n  maven { url \"https://dl.bintray.com/daggerok/daggerok\" }\n}\n\ndependencies {\n  compile \"com.github.daggerok:daggerok-context:1.0.4\"\n}\n----\n=== gradle jitpack\n.gradle setup (build.gradle)\n[source,gradle]\n----\nrepositories {\n  maven { url \"https://jitpack.io\" }\n}\n\ndependencies {\n  compile \"com.github.daggerok:daggerok-context:1.0.4\"\n}\n----\n=== maven bintray/daggerok\n.maven setup (pom.xml)\n[source,xml]\n----\n\u003crepositories\u003e\n  \u003crepository\u003e\n    \u003cid\u003ebintray-daggerok-daggerok\u003c/id\u003e\n    \u003curl\u003ehttps://dl.bintray.com/daggerok/daggerok\u003c/url\u003e\n  \u003c/repository\u003e\n\u003c/repositories\u003e\n\n\u003cdependencies\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.daggerok\u003c/groupId\u003e\n    \u003cartifactId\u003edaggerok-context\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.4\u003c/version\u003e\n  \u003c/dependency\u003e\n\u003c/dependencies\u003e\n----\n=== maven jitpack\n.maven setup (pom.xml)\n[source,xml]\n----\n\u003crepositories\u003e\n  \u003crepository\u003e\n    \u003cid\u003ejitpack.io\u003c/id\u003e\n    \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n  \u003c/repository\u003e\n\u003c/repositories\u003e\n\n\u003cdependencies\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.daggerok\u003c/groupId\u003e\n    \u003cartifactId\u003edaggerok-context\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.4\u003c/version\u003e\n  \u003c/dependency\u003e\n\u003c/dependencies\u003e\n----\n\n== TODO\n* short public API description with examples or documentation\n* publish to mavenCentral\n\n== contribution\nFeel free extend and contribute to add more functionality like Named Qualifier.\nPersonally I'd like to keep it simple as possible.\nOn really big projects therese days you probably would like to use something like\nGuice, Dagger, CDI from JavaEE or Spring from spring-boot, or maybe even PicoContainer, who knows :))\n\n* link:./VERSIONS.adoc[versions]\n* link:./BINTRAY.adoc[bintray]\n* link:./JITPACK.adoc[JitPack]\n//end::content[]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaggerok%2Fdaggerok-context","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaggerok%2Fdaggerok-context","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaggerok%2Fdaggerok-context/lists"}