{"id":32516439,"url":"https://github.com/dmfs/srcless","last_synced_at":"2026-07-11T07:31:48.044Z","repository":{"id":44361013,"uuid":"438075550","full_name":"dmfs/srcless","owner":"dmfs","description":"Generate code too trivial to write it down.","archived":false,"fork":false,"pushed_at":"2024-04-06T09:55:09.000Z","size":129,"stargazers_count":0,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T01:53:48.275Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmfs.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}},"created_at":"2021-12-14T01:15:58.000Z","updated_at":"2021-12-18T22:55:48.000Z","dependencies_parsed_at":"2024-04-06T10:31:53.555Z","dependency_job_id":null,"html_url":"https://github.com/dmfs/srcless","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/dmfs/srcless","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmfs%2Fsrcless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmfs%2Fsrcless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmfs%2Fsrcless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmfs%2Fsrcless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmfs","download_url":"https://codeload.github.com/dmfs/srcless/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmfs%2Fsrcless/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35355110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"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":"2025-10-28T01:53:36.781Z","updated_at":"2026-07-11T07:31:48.040Z","avatar_url":"https://github.com/dmfs.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build](https://github.com/dmfs/srcless/actions/workflows/main.yml/badge.svg?label=main)](https://github.com/dmfs/srcless/actions/workflows/main.yml)\n[![codecov](https://codecov.io/gh/dmfs/srcless/branch/main/graph/badge.svg)](https://codecov.io/gh/dmfs/srcless)\n[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/dmfs/srcless.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/dmfs/srcless/context:java)\n\n# srcless\n\nGenerate code too trivial to write it down.\n\n## @Composable\n\nAnnotation for interfaces that creates an abstract base class that merely delegates to\nanother instance of the same type.\n\n### Example\n\n```java\n/**\n * FooBar interface.\n */\n@Composable\npublic interface FooBar\u003cT\u003e\n{\n    void foo(T foo);\n\n    T bar(String bazz) throws IOException;\n}\n```\n\ngenerates\n\n```java\n/**\n *  FooBar interface.\n * Automatically generated class for composition.\n */\npublic abstract class FooBarComposition\u003cT\u003e implements FooBar\u003cT\u003e\n{\n    private final FooBar\u003cT\u003e mDelegate;\n\n\n    public FooBarComposition(FooBar\u003cT\u003e delegate)\n    {\n        mDelegate = delegate;\n    }\n\n\n    public final void foo(T foo)\n    {\n        mDelegate.foo(foo);\n    }\n\n\n    public final T bar(String bazz) throws IOException\n    {\n        return mDelegate.bar(bazz);\n    }\n}\n```\n\n## @StaticFactories, @StaticFactory\n\nAnnotation for classes/constructors that generates static factory methods for each public constructor.\n\n### Example\n\n```java\n\n@StaticFactories(\"Foo\")\npublic final class FactoryFoo\n{\n    public FactoryFoo(@Nonnull final String s)\n    {\n        this(s, 0);\n    }\n\n\n    public FactoryFoo(@Nonnull final String s, int i)\n    {\n    }\n}\n```\n\ngenerates\n\n```java\n/**\n * Automatically generated class with static factory methods.\n */\npublic final class Foo\n{\n    private Foo()\n    {\n        // no-instances constructor\n    }\n\n\n    public static FactoryFoo factoryFoo(@Nonnull final String s)\n    {\n        return new FactoryFoo(s);\n    }\n\n\n    public static FactoryFoo factoryFoo(@Nonnull final String s, int i)\n    {\n        return new FactoryFoo(s, i);\n    }\n}\n```\n\n## nullless\n\nThe nullless annotation processor doesn't process any annotations.\nIt processes all packages in the project and generates a\n`package-info.java` like this:\n\n```Java\n@NonNullByDefault\npackage\n\n\u003cpackagename\u003e\n\nimport org.eclipse.jdt.annotation.NonNullByDefault;\n```\n\nAs the name says this makes everything in a package `NonNull` by default.\n\nApplying the annotation processor like\n\n```groovy\nannotationProcessor 'org.dmfs:nullless-processors:0.3.0'\n```\n\nApplies the `@NonNullByDefault` annotation to all classes in the project.\n\nTo make this work you must also add a dependency on the respective eclipse annotation lib like so\n\n```groovy\nannotationProcessor 'org.dmfs:nullless-processors:0.3.0'\napi 'org.eclipse.jdt:org.eclipse.jdt.annotation:2.2.600'\n```\n\nBecause this applied automatically on all packages, it's not part of the scrless-processors artifact and has to be applied separately.\n\nNote that you still can annotate members, methods and parameters with\n`@NonNull` to override the default.\n\n## License\n\nCopyright 2023 dmfs GmbH\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmfs%2Fsrcless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmfs%2Fsrcless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmfs%2Fsrcless/lists"}