{"action":"created","comment":{"url":"https://api.github.com/repos/codice/ddf/pulls/comments/50003291","id":50003291,"diff_hunk":"@@ -0,0 +1,172 @@\n+/**\n+ * Copyright (c) Codice Foundation\n+ * <p>\n+ * This is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser\n+ * General Public License as published by the Free Software Foundation, either version 3 of the\n+ * License, or any later version.\n+ * <p>\n+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without\n+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n+ * Lesser General Public License for more details. A copy of the GNU Lesser General Public License\n+ * is distributed along with this program and can be found at\n+ * <http://www.gnu.org/licenses/lgpl.html>.\n+ */\n+package ddf.catalog.transformer.generic.xml.impl;\n+\n+import java.io.IOException;\n+import java.util.ArrayList;\n+import java.util.HashMap;\n+import java.util.List;\n+import java.util.Map;\n+\n+import org.xml.sax.Attributes;\n+import org.xml.sax.InputSource;\n+import org.xml.sax.Locator;\n+import org.xml.sax.SAXException;\n+import org.xml.sax.SAXParseException;\n+\n+import ddf.catalog.data.Attribute;\n+import ddf.catalog.data.Metacard;\n+import ddf.catalog.data.impl.AttributeImpl;\n+import ddf.catalog.transformer.generic.xml.SaxEventHandler;\n+\n+public class XMLSaxEventHandlerImpl implements SaxEventHandler {\n+\n+    private List<Attribute> attributes;\n+\n+    private Boolean stillInterested = true;\n+\n+    private String reading;\n+\n+    private StringBuffer stringBuffer;\n+\n+    private Map<String, String> xmlToMetacard;\n+\n+    @Override\n+    public List<Attribute> getAttributes() {\n+        return attributes;\n+    }\n+\n+    @Override\n+    public void setDocumentLocator(Locator locator) {\n+\n+    }\n+\n+    protected XMLSaxEventHandlerImpl() {\n+        xmlToMetacard = new HashMap<>();\n+        xmlToMetacard.put(\"title\", Metacard.TITLE);\n+        xmlToMetacard.put(\"point-of-contact\", Metacard.POINT_OF_CONTACT);\n+        xmlToMetacard.put(\"description\", Metacard.DESCRIPTION);\n+        xmlToMetacard.put(\"source\", Metacard.RESOURCE_URI);\n+    }\n+\n+    protected XMLSaxEventHandlerImpl(Map<String, String> xmlToMetacardMap) {\n+        this.xmlToMetacard = xmlToMetacardMap;\n+    }\n+\n+    @Override\n+    public void startDocument() {\n+        stringBuffer = new StringBuffer();","path":"catalog/transformer/catalog-transformer-generic-impl/src/main/java/ddf/catalog/transformer/generic/xml/impl/XMLSaxEventHandlerImpl.java","position":69,"original_position":69,"commit_id":"9bd05d29a6ad6394e8be3ecd4e45749c4e81c447","original_commit_id":"9bd05d29a6ad6394e8be3ecd4e45749c4e81c447","user":{"login":"pklinef","id":700518,"avatar_url":"https://avatars.githubusercontent.com/u/700518?v=3","gravatar_id":"","url":"https://api.github.com/users/pklinef","html_url":"https://github.com/pklinef","followers_url":"https://api.github.com/users/pklinef/followers","following_url":"https://api.github.com/users/pklinef/following{/other_user}","gists_url":"https://api.github.com/users/pklinef/gists{/gist_id}","starred_url":"https://api.github.com/users/pklinef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pklinef/subscriptions","organizations_url":"https://api.github.com/users/pklinef/orgs","repos_url":"https://api.github.com/users/pklinef/repos","events_url":"https://api.github.com/users/pklinef/events{/privacy}","received_events_url":"https://api.github.com/users/pklinef/received_events","type":"User","site_admin":false},"body":"Any reason you are using `StringBuffer` instead of `StringBuilder`?","created_at":"2016-01-18T14:24:11Z","updated_at":"2016-01-18T14:24:11Z","html_url":"https://github.com/codice/ddf/pull/457#discussion_r50003291","pull_request_url":"https://api.github.com/repos/codice/ddf/pulls/457","_links":{"self":{"href":"https://api.github.com/repos/codice/ddf/pulls/comments/50003291"},"html":{"href":"https://github.com/codice/ddf/pull/457#discussion_r50003291"},"pull_request":{"href":"https://api.github.com/repos/codice/ddf/pulls/457"}}},"pull_request":{"url":"https://api.github.com/repos/codice/ddf/pulls/457","id":55824263,"html_url":"https://github.com/codice/ddf/pull/457","diff_url":"https://github.com/codice/ddf/pull/457.diff","patch_url":"https://github.com/codice/ddf/pull/457.patch","issue_url":"https://api.github.com/repos/codice/ddf/issues/457","number":457,"state":"open","locked":false,"title":"DDF-1792 Initial commit with new XML transform api","user":{"login":"harrison-tarr","id":14062223,"avatar_url":"https://avatars.githubusercontent.com/u/14062223?v=3","gravatar_id":"","url":"https://api.github.com/users/harrison-tarr","html_url":"https://github.com/harrison-tarr","followers_url":"https://api.github.com/users/harrison-tarr/followers","following_url":"https://api.github.com/users/harrison-tarr/following{/other_user}","gists_url":"https://api.github.com/users/harrison-tarr/gists{/gist_id}","starred_url":"https://api.github.com/users/harrison-tarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harrison-tarr/subscriptions","organizations_url":"https://api.github.com/users/harrison-tarr/orgs","repos_url":"https://api.github.com/users/harrison-tarr/repos","events_url":"https://api.github.com/users/harrison-tarr/events{/privacy}","received_events_url":"https://api.github.com/users/harrison-tarr/received_events","type":"User","site_admin":false},"body":"DDF-1792 Implement a simple XML SaxEventHandler\r\nDDF-1792 Write test to confirm correct parse/transform\r\n\r\nThis is a pull request in progress, intended to get feedback as I develop.\r\n\r\n@michaelmenousek @coyotesqrl @djblue @pklinef @brendan-hofmann @AzGoalie @ahoffer","created_at":"2016-01-12T22:04:44Z","updated_at":"2016-01-18T14:24:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ca16ff9ec113091f114d6b006e3feecffd3c06f4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codice/ddf/pulls/457/commits","review_comments_url":"https://api.github.com/repos/codice/ddf/pulls/457/comments","review_comment_url":"https://api.github.com/repos/codice/ddf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codice/ddf/issues/457/comments","statuses_url":"https://api.github.com/repos/codice/ddf/statuses/9bd05d29a6ad6394e8be3ecd4e45749c4e81c447","head":{"label":"harrison-tarr:DDF-1792","ref":"DDF-1792","sha":"9bd05d29a6ad6394e8be3ecd4e45749c4e81c447","user":{"login":"harrison-tarr","id":14062223,"avatar_url":"https://avatars.githubusercontent.com/u/14062223?v=3","gravatar_id":"","url":"https://api.github.com/users/harrison-tarr","html_url":"https://github.com/harrison-tarr","followers_url":"https://api.github.com/users/harrison-tarr/followers","following_url":"https://api.github.com/users/harrison-tarr/following{/other_user}","gists_url":"https://api.github.com/users/harrison-tarr/gists{/gist_id}","starred_url":"https://api.github.com/users/harrison-tarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harrison-tarr/subscriptions","organizations_url":"https://api.github.com/users/harrison-tarr/orgs","repos_url":"https://api.github.com/users/harrison-tarr/repos","events_url":"https://api.github.com/users/harrison-tarr/events{/privacy}","received_events_url":"https://api.github.com/users/harrison-tarr/received_events","type":"User","site_admin":false},"repo":{"id":41703445,"name":"ddf","full_name":"harrison-tarr/ddf","owner":{"login":"harrison-tarr","id":14062223,"avatar_url":"https://avatars.githubusercontent.com/u/14062223?v=3","gravatar_id":"","url":"https://api.github.com/users/harrison-tarr","html_url":"https://github.com/harrison-tarr","followers_url":"https://api.github.com/users/harrison-tarr/followers","following_url":"https://api.github.com/users/harrison-tarr/following{/other_user}","gists_url":"https://api.github.com/users/harrison-tarr/gists{/gist_id}","starred_url":"https://api.github.com/users/harrison-tarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harrison-tarr/subscriptions","organizations_url":"https://api.github.com/users/harrison-tarr/orgs","repos_url":"https://api.github.com/users/harrison-tarr/repos","events_url":"https://api.github.com/users/harrison-tarr/events{/privacy}","received_events_url":"https://api.github.com/users/harrison-tarr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/harrison-tarr/ddf","description":"The Distributed Data Framework - Distribution, SDK, and Test","fork":true,"url":"https://api.github.com/repos/harrison-tarr/ddf","forks_url":"https://api.github.com/repos/harrison-tarr/ddf/forks","keys_url":"https://api.github.com/repos/harrison-tarr/ddf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/harrison-tarr/ddf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/harrison-tarr/ddf/teams","hooks_url":"https://api.github.com/repos/harrison-tarr/ddf/hooks","issue_events_url":"https://api.github.com/repos/harrison-tarr/ddf/issues/events{/number}","events_url":"https://api.github.com/repos/harrison-tarr/ddf/events","assignees_url":"https://api.github.com/repos/harrison-tarr/ddf/assignees{/user}","branches_url":"https://api.github.com/repos/harrison-tarr/ddf/branches{/branch}","tags_url":"https://api.github.com/repos/harrison-tarr/ddf/tags","blobs_url":"https://api.github.com/repos/harrison-tarr/ddf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/harrison-tarr/ddf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/harrison-tarr/ddf/git/refs{/sha}","trees_url":"https://api.github.com/repos/harrison-tarr/ddf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/harrison-tarr/ddf/statuses/{sha}","languages_url":"https://api.github.com/repos/harrison-tarr/ddf/languages","stargazers_url":"https://api.github.com/repos/harrison-tarr/ddf/stargazers","contributors_url":"https://api.github.com/repos/harrison-tarr/ddf/contributors","subscribers_url":"https://api.github.com/repos/harrison-tarr/ddf/subscribers","subscription_url":"https://api.github.com/repos/harrison-tarr/ddf/subscription","commits_url":"https://api.github.com/repos/harrison-tarr/ddf/commits{/sha}","git_commits_url":"https://api.github.com/repos/harrison-tarr/ddf/git/commits{/sha}","comments_url":"https://api.github.com/repos/harrison-tarr/ddf/comments{/number}","issue_comment_url":"https://api.github.com/repos/harrison-tarr/ddf/issues/comments{/number}","contents_url":"https://api.github.com/repos/harrison-tarr/ddf/contents/{+path}","compare_url":"https://api.github.com/repos/harrison-tarr/ddf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/harrison-tarr/ddf/merges","archive_url":"https://api.github.com/repos/harrison-tarr/ddf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/harrison-tarr/ddf/downloads","issues_url":"https://api.github.com/repos/harrison-tarr/ddf/issues{/number}","pulls_url":"https://api.github.com/repos/harrison-tarr/ddf/pulls{/number}","milestones_url":"https://api.github.com/repos/harrison-tarr/ddf/milestones{/number}","notifications_url":"https://api.github.com/repos/harrison-tarr/ddf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/harrison-tarr/ddf/labels{/name}","releases_url":"https://api.github.com/repos/harrison-tarr/ddf/releases{/id}","created_at":"2015-08-31T22:18:51Z","updated_at":"2015-08-31T22:19:01Z","pushed_at":"2016-01-14T18:14:19Z","git_url":"git://github.com/harrison-tarr/ddf.git","ssh_url":"git@github.com:harrison-tarr/ddf.git","clone_url":"https://github.com/harrison-tarr/ddf.git","svn_url":"https://github.com/harrison-tarr/ddf","homepage":"","size":126356,"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":"codice:master","ref":"master","sha":"ff6850856724a8cc9740dc7e28ec75cf0eaa355c","user":{"login":"codice","id":2386734,"avatar_url":"https://avatars.githubusercontent.com/u/2386734?v=3","gravatar_id":"","url":"https://api.github.com/users/codice","html_url":"https://github.com/codice","followers_url":"https://api.github.com/users/codice/followers","following_url":"https://api.github.com/users/codice/following{/other_user}","gists_url":"https://api.github.com/users/codice/gists{/gist_id}","starred_url":"https://api.github.com/users/codice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codice/subscriptions","organizations_url":"https://api.github.com/users/codice/orgs","repos_url":"https://api.github.com/users/codice/repos","events_url":"https://api.github.com/users/codice/events{/privacy}","received_events_url":"https://api.github.com/users/codice/received_events","type":"Organization","site_admin":false},"repo":{"id":15173563,"name":"ddf","full_name":"codice/ddf","owner":{"login":"codice","id":2386734,"avatar_url":"https://avatars.githubusercontent.com/u/2386734?v=3","gravatar_id":"","url":"https://api.github.com/users/codice","html_url":"https://github.com/codice","followers_url":"https://api.github.com/users/codice/followers","following_url":"https://api.github.com/users/codice/following{/other_user}","gists_url":"https://api.github.com/users/codice/gists{/gist_id}","starred_url":"https://api.github.com/users/codice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codice/subscriptions","organizations_url":"https://api.github.com/users/codice/orgs","repos_url":"https://api.github.com/users/codice/repos","events_url":"https://api.github.com/users/codice/events{/privacy}","received_events_url":"https://api.github.com/users/codice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codice/ddf","description":"The Distributed Data Framework - Federated Open Geospatial Consortium (OGC) filter powered metadata catalog with SAML Web SSO secured container","fork":false,"url":"https://api.github.com/repos/codice/ddf","forks_url":"https://api.github.com/repos/codice/ddf/forks","keys_url":"https://api.github.com/repos/codice/ddf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codice/ddf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codice/ddf/teams","hooks_url":"https://api.github.com/repos/codice/ddf/hooks","issue_events_url":"https://api.github.com/repos/codice/ddf/issues/events{/number}","events_url":"https://api.github.com/repos/codice/ddf/events","assignees_url":"https://api.github.com/repos/codice/ddf/assignees{/user}","branches_url":"https://api.github.com/repos/codice/ddf/branches{/branch}","tags_url":"https://api.github.com/repos/codice/ddf/tags","blobs_url":"https://api.github.com/repos/codice/ddf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codice/ddf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codice/ddf/git/refs{/sha}","trees_url":"https://api.github.com/repos/codice/ddf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codice/ddf/statuses/{sha}","languages_url":"https://api.github.com/repos/codice/ddf/languages","stargazers_url":"https://api.github.com/repos/codice/ddf/stargazers","contributors_url":"https://api.github.com/repos/codice/ddf/contributors","subscribers_url":"https://api.github.com/repos/codice/ddf/subscribers","subscription_url":"https://api.github.com/repos/codice/ddf/subscription","commits_url":"https://api.github.com/repos/codice/ddf/commits{/sha}","git_commits_url":"https://api.github.com/repos/codice/ddf/git/commits{/sha}","comments_url":"https://api.github.com/repos/codice/ddf/comments{/number}","issue_comment_url":"https://api.github.com/repos/codice/ddf/issues/comments{/number}","contents_url":"https://api.github.com/repos/codice/ddf/contents/{+path}","compare_url":"https://api.github.com/repos/codice/ddf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codice/ddf/merges","archive_url":"https://api.github.com/repos/codice/ddf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codice/ddf/downloads","issues_url":"https://api.github.com/repos/codice/ddf/issues{/number}","pulls_url":"https://api.github.com/repos/codice/ddf/pulls{/number}","milestones_url":"https://api.github.com/repos/codice/ddf/milestones{/number}","notifications_url":"https://api.github.com/repos/codice/ddf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codice/ddf/labels{/name}","releases_url":"https://api.github.com/repos/codice/ddf/releases{/id}","created_at":"2013-12-13T20:38:28Z","updated_at":"2016-01-17T06:18:36Z","pushed_at":"2016-01-15T18:10:48Z","git_url":"git://github.com/codice/ddf.git","ssh_url":"git@github.com:codice/ddf.git","clone_url":"https://github.com/codice/ddf.git","svn_url":"https://github.com/codice/ddf","homepage":"","size":134458,"stargazers_count":30,"watchers_count":30,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":66,"mirror_url":null,"open_issues_count":18,"forks":66,"open_issues":18,"watchers":30,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codice/ddf/pulls/457"},"html":{"href":"https://github.com/codice/ddf/pull/457"},"issue":{"href":"https://api.github.com/repos/codice/ddf/issues/457"},"comments":{"href":"https://api.github.com/repos/codice/ddf/issues/457/comments"},"review_comments":{"href":"https://api.github.com/repos/codice/ddf/pulls/457/comments"},"review_comment":{"href":"https://api.github.com/repos/codice/ddf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codice/ddf/pulls/457/commits"},"statuses":{"href":"https://api.github.com/repos/codice/ddf/statuses/9bd05d29a6ad6394e8be3ecd4e45749c4e81c447"}}}}