{"id":24603781,"url":"https://github.com/annimon-tutorials/javac-plugin-demo","last_synced_at":"2025-07-31T00:40:34.418Z","repository":{"id":204035186,"uuid":"85867745","full_name":"annimon-tutorials/Javac-Plugin-Demo","owner":"annimon-tutorials","description":"Source code for tutorial","archived":false,"fork":false,"pushed_at":"2017-03-22T19:28:06.000Z","size":70,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-01T16:44:39.289Z","etag":null,"topics":["extension-methods","javac","operator-overloading","plugin"],"latest_commit_sha":null,"homepage":"https://annimon.com/article/2626","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/annimon-tutorials.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}},"created_at":"2017-03-22T19:26:35.000Z","updated_at":"2024-01-13T23:56:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"7b021183-5788-4d30-85c3-5bb9ae580e31","html_url":"https://github.com/annimon-tutorials/Javac-Plugin-Demo","commit_stats":null,"previous_names":["annimon-tutorials/javac-plugin-demo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/annimon-tutorials/Javac-Plugin-Demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annimon-tutorials%2FJavac-Plugin-Demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annimon-tutorials%2FJavac-Plugin-Demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annimon-tutorials%2FJavac-Plugin-Demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annimon-tutorials%2FJavac-Plugin-Demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/annimon-tutorials","download_url":"https://codeload.github.com/annimon-tutorials/Javac-Plugin-Demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annimon-tutorials%2FJavac-Plugin-Demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267967720,"owners_count":24173566,"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-07-30T02:00:09.044Z","response_time":70,"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":["extension-methods","javac","operator-overloading","plugin"],"created_at":"2025-01-24T15:16:12.854Z","updated_at":"2025-07-31T00:40:34.357Z","avatar_url":"https://github.com/annimon-tutorials.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Javac Plugin Demo\n\n## CharStat\n\nCalculates number of characters of the compiled source code.\n\n## MethodsCount\n\nCalculates methods count per source file and outputs overall methods count.\n\n## MapAccess\n\nAllows to access the `Map` with string literal key as the array:\n\n```java\nMap\u003cString, String\u003e map = new HashMap\u003c\u003e();\nmap[\"key\"] = \"ten\"; // map.put(\"key\", \"ten\")\nSystem.out.println(map[\"key\"]); // map.get(\"key\")\n```\n\n## OperatorOverloading\n\nOverloads `+ - * /` operators to map to `add subtract multiply divide` methods.\n\n```java\nBigInteger x1 = BigInteger.TEN;\nBigInteger x2 = BigInteger.valueOf(120);\nBigInteger x3 = x1 + x2;\n// BigInteger x3 = x1.add(x2);\nBigInteger x4 = BigInteger.valueOf(2) * x3;\n// BigInteger x4 = BigInteger.valueOf(2).multiply(x3);\nBigInteger x5 = x4 - x2 / x1 + x3;\n// BigInteger x5 = x4.subtract(x2.divide(x1)).add(x3);\n```\n\n## ExtensionMethods\n\nAllows to use extension methods. The extension method should be declared as `public static` in the same class.\n\n```java\npublic static IntStream filterNot(IntStream stream, IntPredicate predicate) {\n    return stream.filter(predicate.negate());\n}\n\npublic static \u003cT, R extends Comparable\u003c? super R\u003e\u003e Stream\u003cT\u003e sortBy(Stream\u003cT\u003e stream, Function\u003c? super T, ? extends R\u003e f) {\n    return stream.sorted((o1, o2) -\u003e f.apply(o1).compareTo(f.apply(o2)));\n}\n\napps.stream()\n        .filterNot(Application::isInstalled)\n        .sortBy(Application::getDownloadingTime())\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannimon-tutorials%2Fjavac-plugin-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fannimon-tutorials%2Fjavac-plugin-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannimon-tutorials%2Fjavac-plugin-demo/lists"}