{"action":"created","comment":{"url":"https://api.github.com/repos/jersey/jersey/pulls/comments/48329942","id":48329942,"diff_hunk":"@@ -112,8 +114,46 @@ private void copyAttributes(final JettisonConfig jc) {\n      */\n     public static class MappedJettisonBuilder extends Builder {\n \n-        private MappedJettisonBuilder(final Notation notation) {\n-            super(notation);\n+        private List<String> serializeAsArray;\n+        private Map<String, String> xmlToJsonNamespaces;\n+        private List attributesAsElements;\n+        private List ignoredElements;\n+        private boolean supressAtAttributes;\n+        private String attributeKey;\n+        private boolean ignoreNamespaces;\n+        private boolean dropRootElement;\n+        private Set primitiveArrayKeys;\n+        private boolean writeNullAsString;\n+        private boolean readNullAsString;\n+        private boolean ignoreEmptyArrayValues;\n+        private boolean escapeForwardSlashAlways;\n+        private String jsonNamespaceSeparator;\n+\n+        private MappedJettisonBuilder() {\n+            super(Notation.MAPPED_JETTISON);\n+            copyAttributes(defaultInstance);\n+        }\n+\n+        private static final JettisonConfig.Mapped defaultInstance = new Mapped();\n+\n+\n+\n+        private void copyAttributes(final JettisonConfig.Mapped jc) {\n+            xmlToJsonNamespaces = new HashMap<>(jc.getXml2JsonNs());\n+            serializeAsArray = new LinkedList<>(jc.getArrayElements());","path":"media/json-jettison/src/main/java/org/glassfish/jersey/jettison/JettisonConfig.java","position":95,"original_position":95,"commit_id":"eaf13fb7e91594515b727af6737f1f9fb76ee255","original_commit_id":"eaf13fb7e91594515b727af6737f1f9fb76ee255","user":{"login":"shamoh","id":544355,"avatar_url":"https://avatars.githubusercontent.com/u/544355?v=3","gravatar_id":"","url":"https://api.github.com/users/shamoh","html_url":"https://github.com/shamoh","followers_url":"https://api.github.com/users/shamoh/followers","following_url":"https://api.github.com/users/shamoh/following{/other_user}","gists_url":"https://api.github.com/users/shamoh/gists{/gist_id}","starred_url":"https://api.github.com/users/shamoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shamoh/subscriptions","organizations_url":"https://api.github.com/users/shamoh/orgs","repos_url":"https://api.github.com/users/shamoh/repos","events_url":"https://api.github.com/users/shamoh/events{/privacy}","received_events_url":"https://api.github.com/users/shamoh/received_events","type":"User","site_admin":false},"body":"Can you use same name for the attribute?","created_at":"2015-12-23T08:58:34Z","updated_at":"2015-12-23T08:58:34Z","html_url":"https://github.com/jersey/jersey/pull/203#discussion_r48329942","pull_request_url":"https://api.github.com/repos/jersey/jersey/pulls/203","_links":{"self":{"href":"https://api.github.com/repos/jersey/jersey/pulls/comments/48329942"},"html":{"href":"https://github.com/jersey/jersey/pull/203#discussion_r48329942"},"pull_request":{"href":"https://api.github.com/repos/jersey/jersey/pulls/203"}}},"pull_request":{"url":"https://api.github.com/repos/jersey/jersey/pulls/203","id":53370935,"html_url":"https://github.com/jersey/jersey/pull/203","diff_url":"https://github.com/jersey/jersey/pull/203.diff","patch_url":"https://github.com/jersey/jersey/pull/203.patch","issue_url":"https://api.github.com/repos/jersey/jersey/issues/203","number":203,"state":"open","locked":false,"title":"Extended properties for MappedJettison wrapper","user":{"login":"gary-harpaz","id":6260714,"avatar_url":"https://avatars.githubusercontent.com/u/6260714?v=3","gravatar_id":"","url":"https://api.github.com/users/gary-harpaz","html_url":"https://github.com/gary-harpaz","followers_url":"https://api.github.com/users/gary-harpaz/followers","following_url":"https://api.github.com/users/gary-harpaz/following{/other_user}","gists_url":"https://api.github.com/users/gary-harpaz/gists{/gist_id}","starred_url":"https://api.github.com/users/gary-harpaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gary-harpaz/subscriptions","organizations_url":"https://api.github.com/users/gary-harpaz/orgs","repos_url":"https://api.github.com/users/gary-harpaz/repos","events_url":"https://api.github.com/users/gary-harpaz/events{/privacy}","received_events_url":"https://api.github.com/users/gary-harpaz/received_events","type":"User","site_admin":false},"body":"Hi,\r\n\r\nI would like to marshal JAXB JSON but without the root element wrapper as discussed in:\r\nhttp://stackoverflow.com/questions/18417466/jaxb-remove-xmlrootelement-wrapper/18421298#18421298\r\n\r\nI am using Jettison as my JAXB provider, unfortunately this is  not supported.\r\nI have extended the JettisonConfig wrapper to include more properties to make this possible. \r\nI am now able to unmarshal without the root element wrapper using a context resolver such as:  \r\n\r\n        public final class JaxbContextResolver implements ContextResolver<JAXBContext> {\r\n\r\n            private final JAXBContext context;\r\n            private final Set<Class<?>> types;\r\n            private final Class<?>[] cTypes = {Flights.class, FlightType.class, AircraftType.class};\r\n\r\n            public JaxbContextResolver() throws Exception {\r\n            \tSystem.out.println(\"Injected JaxbContextResolver\");\r\n                this.types = new HashSet<Class<?>>(Arrays.asList(cTypes));\r\n                //this.context = new JettisonJaxbContext(JettisonConfig.DEFAULT, cTypes);\r\n                this.context = new JettisonJaxbContext(JettisonConfig.mappedJettison().setDropRootElement(true).build(), cTypes);\r\n            }\r\n\r\n            @Override\r\n            public JAXBContext getContext(Class<?> objectType) {\r\n                return (types.contains(objectType)) ? context : null;\r\n            }\r\n        }","created_at":"2015-12-11T09:36:41Z","updated_at":"2015-12-23T08:58:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"326984460f3a5ade87cfdcd0c30e625447a6d907","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jersey/jersey/pulls/203/commits","review_comments_url":"https://api.github.com/repos/jersey/jersey/pulls/203/comments","review_comment_url":"https://api.github.com/repos/jersey/jersey/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jersey/jersey/issues/203/comments","statuses_url":"https://api.github.com/repos/jersey/jersey/statuses/eaf13fb7e91594515b727af6737f1f9fb76ee255","head":{"label":"gary-harpaz:2.x","ref":"2.x","sha":"eaf13fb7e91594515b727af6737f1f9fb76ee255","user":{"login":"gary-harpaz","id":6260714,"avatar_url":"https://avatars.githubusercontent.com/u/6260714?v=3","gravatar_id":"","url":"https://api.github.com/users/gary-harpaz","html_url":"https://github.com/gary-harpaz","followers_url":"https://api.github.com/users/gary-harpaz/followers","following_url":"https://api.github.com/users/gary-harpaz/following{/other_user}","gists_url":"https://api.github.com/users/gary-harpaz/gists{/gist_id}","starred_url":"https://api.github.com/users/gary-harpaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gary-harpaz/subscriptions","organizations_url":"https://api.github.com/users/gary-harpaz/orgs","repos_url":"https://api.github.com/users/gary-harpaz/repos","events_url":"https://api.github.com/users/gary-harpaz/events{/privacy}","received_events_url":"https://api.github.com/users/gary-harpaz/received_events","type":"User","site_admin":false},"repo":{"id":46789438,"name":"jersey","full_name":"gary-harpaz/jersey","owner":{"login":"gary-harpaz","id":6260714,"avatar_url":"https://avatars.githubusercontent.com/u/6260714?v=3","gravatar_id":"","url":"https://api.github.com/users/gary-harpaz","html_url":"https://github.com/gary-harpaz","followers_url":"https://api.github.com/users/gary-harpaz/followers","following_url":"https://api.github.com/users/gary-harpaz/following{/other_user}","gists_url":"https://api.github.com/users/gary-harpaz/gists{/gist_id}","starred_url":"https://api.github.com/users/gary-harpaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gary-harpaz/subscriptions","organizations_url":"https://api.github.com/users/gary-harpaz/orgs","repos_url":"https://api.github.com/users/gary-harpaz/repos","events_url":"https://api.github.com/users/gary-harpaz/events{/privacy}","received_events_url":"https://api.github.com/users/gary-harpaz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gary-harpaz/jersey","description":"This is an active mirror of Jersey 2.x workspace from http://jersey.java.net. Any changes made here are automatically propagated to java.net and vice versa. Forks and pull requests are welcome!","fork":true,"url":"https://api.github.com/repos/gary-harpaz/jersey","forks_url":"https://api.github.com/repos/gary-harpaz/jersey/forks","keys_url":"https://api.github.com/repos/gary-harpaz/jersey/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gary-harpaz/jersey/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gary-harpaz/jersey/teams","hooks_url":"https://api.github.com/repos/gary-harpaz/jersey/hooks","issue_events_url":"https://api.github.com/repos/gary-harpaz/jersey/issues/events{/number}","events_url":"https://api.github.com/repos/gary-harpaz/jersey/events","assignees_url":"https://api.github.com/repos/gary-harpaz/jersey/assignees{/user}","branches_url":"https://api.github.com/repos/gary-harpaz/jersey/branches{/branch}","tags_url":"https://api.github.com/repos/gary-harpaz/jersey/tags","blobs_url":"https://api.github.com/repos/gary-harpaz/jersey/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gary-harpaz/jersey/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gary-harpaz/jersey/git/refs{/sha}","trees_url":"https://api.github.com/repos/gary-harpaz/jersey/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gary-harpaz/jersey/statuses/{sha}","languages_url":"https://api.github.com/repos/gary-harpaz/jersey/languages","stargazers_url":"https://api.github.com/repos/gary-harpaz/jersey/stargazers","contributors_url":"https://api.github.com/repos/gary-harpaz/jersey/contributors","subscribers_url":"https://api.github.com/repos/gary-harpaz/jersey/subscribers","subscription_url":"https://api.github.com/repos/gary-harpaz/jersey/subscription","commits_url":"https://api.github.com/repos/gary-harpaz/jersey/commits{/sha}","git_commits_url":"https://api.github.com/repos/gary-harpaz/jersey/git/commits{/sha}","comments_url":"https://api.github.com/repos/gary-harpaz/jersey/comments{/number}","issue_comment_url":"https://api.github.com/repos/gary-harpaz/jersey/issues/comments{/number}","contents_url":"https://api.github.com/repos/gary-harpaz/jersey/contents/{+path}","compare_url":"https://api.github.com/repos/gary-harpaz/jersey/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gary-harpaz/jersey/merges","archive_url":"https://api.github.com/repos/gary-harpaz/jersey/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gary-harpaz/jersey/downloads","issues_url":"https://api.github.com/repos/gary-harpaz/jersey/issues{/number}","pulls_url":"https://api.github.com/repos/gary-harpaz/jersey/pulls{/number}","milestones_url":"https://api.github.com/repos/gary-harpaz/jersey/milestones{/number}","notifications_url":"https://api.github.com/repos/gary-harpaz/jersey/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gary-harpaz/jersey/labels{/name}","releases_url":"https://api.github.com/repos/gary-harpaz/jersey/releases{/id}","created_at":"2015-11-24T12:10:28Z","updated_at":"2015-11-24T12:10:43Z","pushed_at":"2015-12-11T09:13:01Z","git_url":"git://github.com/gary-harpaz/jersey.git","ssh_url":"git@github.com:gary-harpaz/jersey.git","clone_url":"https://github.com/gary-harpaz/jersey.git","svn_url":"https://github.com/gary-harpaz/jersey","homepage":"jersey.java.net","size":31757,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jersey:2.x","ref":"2.x","sha":"753254dc31b5f0c3beaf6ff960a31fe8d1c521ee","user":{"login":"jersey","id":399710,"avatar_url":"https://avatars.githubusercontent.com/u/399710?v=3","gravatar_id":"","url":"https://api.github.com/users/jersey","html_url":"https://github.com/jersey","followers_url":"https://api.github.com/users/jersey/followers","following_url":"https://api.github.com/users/jersey/following{/other_user}","gists_url":"https://api.github.com/users/jersey/gists{/gist_id}","starred_url":"https://api.github.com/users/jersey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jersey/subscriptions","organizations_url":"https://api.github.com/users/jersey/orgs","repos_url":"https://api.github.com/users/jersey/repos","events_url":"https://api.github.com/users/jersey/events{/privacy}","received_events_url":"https://api.github.com/users/jersey/received_events","type":"Organization","site_admin":false},"repo":{"id":4368712,"name":"jersey","full_name":"jersey/jersey","owner":{"login":"jersey","id":399710,"avatar_url":"https://avatars.githubusercontent.com/u/399710?v=3","gravatar_id":"","url":"https://api.github.com/users/jersey","html_url":"https://github.com/jersey","followers_url":"https://api.github.com/users/jersey/followers","following_url":"https://api.github.com/users/jersey/following{/other_user}","gists_url":"https://api.github.com/users/jersey/gists{/gist_id}","starred_url":"https://api.github.com/users/jersey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jersey/subscriptions","organizations_url":"https://api.github.com/users/jersey/orgs","repos_url":"https://api.github.com/users/jersey/repos","events_url":"https://api.github.com/users/jersey/events{/privacy}","received_events_url":"https://api.github.com/users/jersey/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jersey/jersey","description":"This is an active mirror of Jersey 2.x workspace from http://jersey.java.net. Any changes made here are automatically propagated to java.net and vice versa. Forks and pull requests are welcome!","fork":false,"url":"https://api.github.com/repos/jersey/jersey","forks_url":"https://api.github.com/repos/jersey/jersey/forks","keys_url":"https://api.github.com/repos/jersey/jersey/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jersey/jersey/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jersey/jersey/teams","hooks_url":"https://api.github.com/repos/jersey/jersey/hooks","issue_events_url":"https://api.github.com/repos/jersey/jersey/issues/events{/number}","events_url":"https://api.github.com/repos/jersey/jersey/events","assignees_url":"https://api.github.com/repos/jersey/jersey/assignees{/user}","branches_url":"https://api.github.com/repos/jersey/jersey/branches{/branch}","tags_url":"https://api.github.com/repos/jersey/jersey/tags","blobs_url":"https://api.github.com/repos/jersey/jersey/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jersey/jersey/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jersey/jersey/git/refs{/sha}","trees_url":"https://api.github.com/repos/jersey/jersey/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jersey/jersey/statuses/{sha}","languages_url":"https://api.github.com/repos/jersey/jersey/languages","stargazers_url":"https://api.github.com/repos/jersey/jersey/stargazers","contributors_url":"https://api.github.com/repos/jersey/jersey/contributors","subscribers_url":"https://api.github.com/repos/jersey/jersey/subscribers","subscription_url":"https://api.github.com/repos/jersey/jersey/subscription","commits_url":"https://api.github.com/repos/jersey/jersey/commits{/sha}","git_commits_url":"https://api.github.com/repos/jersey/jersey/git/commits{/sha}","comments_url":"https://api.github.com/repos/jersey/jersey/comments{/number}","issue_comment_url":"https://api.github.com/repos/jersey/jersey/issues/comments{/number}","contents_url":"https://api.github.com/repos/jersey/jersey/contents/{+path}","compare_url":"https://api.github.com/repos/jersey/jersey/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jersey/jersey/merges","archive_url":"https://api.github.com/repos/jersey/jersey/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jersey/jersey/downloads","issues_url":"https://api.github.com/repos/jersey/jersey/issues{/number}","pulls_url":"https://api.github.com/repos/jersey/jersey/pulls{/number}","milestones_url":"https://api.github.com/repos/jersey/jersey/milestones{/number}","notifications_url":"https://api.github.com/repos/jersey/jersey/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jersey/jersey/labels{/name}","releases_url":"https://api.github.com/repos/jersey/jersey/releases{/id}","created_at":"2012-05-18T11:38:25Z","updated_at":"2015-12-21T22:08:37Z","pushed_at":"2015-12-18T23:23:59Z","git_url":"git://github.com/jersey/jersey.git","ssh_url":"git@github.com:jersey/jersey.git","clone_url":"https://github.com/jersey/jersey.git","svn_url":"https://github.com/jersey/jersey","homepage":"jersey.java.net","size":33631,"stargazers_count":1146,"watchers_count":1146,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1381,"mirror_url":null,"open_issues_count":23,"forks":1381,"open_issues":23,"watchers":1146,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jersey/jersey/pulls/203"},"html":{"href":"https://github.com/jersey/jersey/pull/203"},"issue":{"href":"https://api.github.com/repos/jersey/jersey/issues/203"},"comments":{"href":"https://api.github.com/repos/jersey/jersey/issues/203/comments"},"review_comments":{"href":"https://api.github.com/repos/jersey/jersey/pulls/203/comments"},"review_comment":{"href":"https://api.github.com/repos/jersey/jersey/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jersey/jersey/pulls/203/commits"},"statuses":{"href":"https://api.github.com/repos/jersey/jersey/statuses/eaf13fb7e91594515b727af6737f1f9fb76ee255"}}}}