{"id":17537235,"url":"https://github.com/annotationsro/java-annotation-mapper","last_synced_at":"2026-01-21T10:13:10.328Z","repository":{"id":57743005,"uuid":"193459611","full_name":"AnnotationSro/java-annotation-mapper","owner":"AnnotationSro","description":"JAM as Java Annotation Mapper is mapping at compile time without reflection!","archived":false,"fork":false,"pushed_at":"2024-02-02T22:43:24.000Z","size":572,"stargazers_count":1,"open_issues_count":10,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-13T03:18:58.771Z","etag":null,"topics":["java","mapper","maven"],"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/AnnotationSro.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":"2019-06-24T07:52:05.000Z","updated_at":"2022-01-09T02:56:02.000Z","dependencies_parsed_at":"2022-09-11T07:10:24.808Z","dependency_job_id":null,"html_url":"https://github.com/AnnotationSro/java-annotation-mapper","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnnotationSro%2Fjava-annotation-mapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnnotationSro%2Fjava-annotation-mapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnnotationSro%2Fjava-annotation-mapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnnotationSro%2Fjava-annotation-mapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnnotationSro","download_url":"https://codeload.github.com/AnnotationSro/java-annotation-mapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247551497,"owners_count":20957111,"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":["java","mapper","maven"],"created_at":"2024-10-20T20:06:17.656Z","updated_at":"2026-01-21T10:13:10.289Z","avatar_url":"https://github.com/AnnotationSro.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--                                                                           --\u003e\n\u003c!--  Copyright 2019 - Annotation,s.r.o.                                         --\u003e\n\u003c!--                                                                           --\u003e\n\u003c!--  Licensed under the Apache License, Version 2.0 (the \"License\");          --\u003e\n\u003c!--  you may not use this file except in compliance with the License.         --\u003e\n\u003c!--  You may obtain a copy of the License at                                  --\u003e\n\u003c!--                                                                           --\u003e\n\u003c!--           http://www.apache.org/licenses/LICENSE-2.0                      --\u003e\n\u003c!--                                                                           --\u003e\n\u003c!--  Unless required by applicable law or agreed to in writing, software      --\u003e\n\u003c!--  distributed under the License is distributed on an \"AS IS\" BASIS,        --\u003e\n\u003c!--  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --\u003e\n\u003c!--  See the License for the specific language governing permissions and      --\u003e\n\u003c!--  limitations under the License.                                           --\u003e\n\u003c!--                                                                           --\u003e\n\n## JAM as Java Annotation Mapper is mapping at compile time without reflection !\n\n# What is JAM ?\n\nJAM stands for ***Java Annotation Mapper*** is inspired by \nproject **SELMA** (visit: http://www.selma-java.org/).\n\nJAM library contains an Annotation Processor that generates effective Java code \nto handle the mapping from one object (or objects) to other at compile time. \nResult of this process is:\n  * efficiently generated Java class \n  * very fast code in runtime \n  * without other additional dependencies at runtime (only jam-common.jar ~ 9.5 KB) \n\n## Why JAM mapper is good to use\nJAM library:\n   * significantly reduces developer's time\n   * improvement quality of code\n   * improvement speed of development\n     * a lot of problems are resolved by mapper generator\n   * mapper is generated during compilation\n     * detected problem at compilation time\n     * runtime is very fast \n   * solving a lot of often problems as:\n     * problem with cyclic dependencies in runtime\n     * problem with object instances\n     * problem with shared context data (as cache of instances)\n     * problem with different but compatible types between internal and external sources (WebServices,JAXB,...)\n     * support for injection containers as CDI or Spring\n    \n\n## How to add it into project ?\n\nFirst add library *jam-processor* as a *provided* dependency and *jam-common* as a *compile* dependency to your build.\n```xml\n\u003cdependencies\u003e\n     \u003c!-- \n     last version for JDK v 11+  is 0.9.18\n     last version for JDK v 8-10 is 0.9.18-jdk8 \n     --\u003e\n     \u003cdependency\u003e\n         \u003cgroupId\u003esk.annotation.library.jam\u003c/groupId\u003e\n         \u003cartifactId\u003ejam-common\u003c/artifactId\u003e\n         \u003cversion\u003e${jam.version}\u003c/version\u003e\n     \u003c/dependency\u003e\n     \n     \u003cdependency\u003e\n         \u003cgroupId\u003esk.annotation.library.jam\u003c/groupId\u003e\n         \u003cartifactId\u003ejam-processor\u003c/artifactId\u003e\n         \u003cscope\u003eprovided\u003c/scope\u003e\n         \u003cversion\u003e${jam.version}\u003c/version\u003e\n     \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n## How to create a mapper?\nDefine *Mapper* interface (or abstract class) describing the mapping you want. Follow example is with Spring support:\n\n```java\n@Mapper\n@EnableSpring   // this is optional, generated interface is annotated for spring with @Component \npublic interface SimpleMapper {\n    \n    // Imutable mapping\n    OutBean map(InBean in);\n    \n    // Update graph\n    OutBean update(InBean in, @Return OutBean out);\n}\n```\n\n## How to use it?\n\nGetting mapper instance directly:\n```java\npublic class UsingMapper {\n\n    public void main(String[] args) {\n        SimpleMapper mapper = MapperUtil.getMapper(SimpleMapper.class);\n\n        // example with immutable mapping\n        OutBean res = mapper.map(in);\n    }\n}\n```\n\nUsing mapper in Spring bean:\n```java\n@Component\npublic class AnySpringService {\n    @Autowired\n    private SimpleMapper mapper;\n\n    public void example() {\n        // example with immutable mapping\n        OutBean res = mapper.map(in);\n    \n        // example with updating\n        OutBean dest = dao.getById(42);\n        OutBean res = mapper.update(in, dest);\n        // res is the updated bean dest with in values\n    }\n}\n```\n\n**Warning**: WEB, documentation, examples and new features are in progress.\n\nPlease, follow examples in jam-tests for learn features. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannotationsro%2Fjava-annotation-mapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fannotationsro%2Fjava-annotation-mapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannotationsro%2Fjava-annotation-mapper/lists"}