{"action":"created","comment":{"url":"https://api.github.com/repos/RepreZen/SwagEdit/pulls/comments/74501200","id":74501200,"diff_hunk":"@@ -0,0 +1,150 @@\n+package com.reprezen.swagedit.model;\n+\n+import java.util.Collections;\n+import java.util.Set;\n+\n+import org.eclipse.jface.text.BadLocationException;\n+import org.eclipse.jface.text.IDocument;\n+import org.eclipse.jface.text.Position;\n+\n+import com.fasterxml.jackson.core.JsonLocation;\n+import com.fasterxml.jackson.core.JsonPointer;\n+import com.fasterxml.jackson.databind.JsonNode;\n+import com.google.common.base.Strings;\n+import com.google.common.collect.Iterables;\n+import com.reprezen.swagedit.json.JsonType;\n+import com.reprezen.swagedit.json.SchemaDefinition;\n+import com.reprezen.swagedit.json.SchemaDefinitionProvider;\n+\n+public abstract class AbstractNode {\n+\n+    private static SchemaDefinitionProvider provider = new SchemaDefinitionProvider();\n+\n+    private final JsonPointer pointer;\n+    private String property;\n+    private AbstractNode parent;\n+    private JsonType type;\n+    private JsonNode schema;\n+\n+    public final Set<SchemaDefinition> definitions;\n+\n+    private JsonLocation location;\n+\n+    private JsonLocation start;\n+\n+    private JsonLocation end;\n+\n+    AbstractNode(AbstractNode parent, JsonPointer ptr) {\n+        this(parent, ptr, null);\n+    }\n+\n+    AbstractNode(AbstractNode parent, JsonPointer ptr, JsonLocation location) {\n+        this.parent = parent;\n+        this.pointer = ptr;\n+        this.location = location;\n+        this.definitions = provider.getDefinitions(pointer(ptr));\n+        this.schema = definitions.isEmpty() ? null : Iterables.getFirst(definitions, null).definition;\n+        this.type = schema != null ? JsonType.valueOf(this.schema) : null;\n+    }\n+\n+    public AbstractNode get(int pos) {\n+        return null;\n+    }\n+\n+    public AbstractNode get(String property) {\n+        return null;\n+    }\n+\n+    public abstract boolean isObject();\n+\n+    public abstract boolean isArray();\n+\n+    public ObjectNode asObject() {\n+        return (ObjectNode) this;\n+    }\n+\n+    public ArrayNode asArray() {\n+        return (ArrayNode) this;\n+    }\n+\n+    public ValueNode asValue() {\n+        return (ValueNode) this;\n+    }\n+\n+    public JsonLocation getLocation() {\n+        return location;\n+    }\n+\n+    protected static String pointer(JsonPointer pointer) {\n+        return pointer.toString().replaceAll(\"/\", \":\").replaceAll(\"~1\", \"/\");\n+    }\n+\n+    public JsonPointer getPointer() {\n+        return pointer;\n+    }\n+\n+    public JsonType getType() {\n+        return type;\n+    }\n+\n+    public JsonNode getSchema() {\n+        return schema;\n+    }\n+\n+    public Set<SchemaDefinition> getDefinitions() {\n+        return definitions;\n+    }\n+\n+    public AbstractNode getParent() {\n+        return parent;\n+    }\n+\n+    public String getProperty() {\n+        return property;\n+    }\n+\n+    public void setProperty(String name) {\n+        this.property = name;\n+    }\n+\n+    public Iterable<AbstractNode> elements() {\n+        return Collections.emptyList();\n+    }\n+\n+    public abstract String getText();","path":"com.reprezen.swagedit/src/com/reprezen/swagedit/model/AbstractNode.java","position":114,"original_position":114,"commit_id":"d90ea00390076f38d982d68df1adb37623698b2e","original_commit_id":"7f6664671beadef4298933e2682f45a26e588e25","user":{"login":"tfesenko","id":644582,"avatar_url":"https://avatars.githubusercontent.com/u/644582?v=3","gravatar_id":"","url":"https://api.github.com/users/tfesenko","html_url":"https://github.com/tfesenko","followers_url":"https://api.github.com/users/tfesenko/followers","following_url":"https://api.github.com/users/tfesenko/following{/other_user}","gists_url":"https://api.github.com/users/tfesenko/gists{/gist_id}","starred_url":"https://api.github.com/users/tfesenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfesenko/subscriptions","organizations_url":"https://api.github.com/users/tfesenko/orgs","repos_url":"https://api.github.com/users/tfesenko/repos","events_url":"https://api.github.com/users/tfesenko/events{/privacy}","received_events_url":"https://api.github.com/users/tfesenko/received_events","type":"User","site_admin":false},"body":"I suggest to move this abstract method next to other abstract methods defined above to make it easier to apot all of them at once","created_at":"2016-08-11T20:55:10Z","updated_at":"2016-08-11T20:55:10Z","html_url":"https://github.com/RepreZen/SwagEdit/pull/178#discussion_r74501200","pull_request_url":"https://api.github.com/repos/RepreZen/SwagEdit/pulls/178","_links":{"self":{"href":"https://api.github.com/repos/RepreZen/SwagEdit/pulls/comments/74501200"},"html":{"href":"https://github.com/RepreZen/SwagEdit/pull/178#discussion_r74501200"},"pull_request":{"href":"https://api.github.com/repos/RepreZen/SwagEdit/pulls/178"}}},"pull_request":{"url":"https://api.github.com/repos/RepreZen/SwagEdit/pulls/178","id":80986272,"html_url":"https://github.com/RepreZen/SwagEdit/pull/178","diff_url":"https://github.com/RepreZen/SwagEdit/pull/178.diff","patch_url":"https://github.com/RepreZen/SwagEdit/pull/178.patch","issue_url":"https://api.github.com/repos/RepreZen/SwagEdit/issues/178","number":178,"state":"open","locked":false,"title":"#40 Implement Quick Outline: better labels","user":{"login":"ghillairet","id":148045,"avatar_url":"https://avatars.githubusercontent.com/u/148045?v=3","gravatar_id":"","url":"https://api.github.com/users/ghillairet","html_url":"https://github.com/ghillairet","followers_url":"https://api.github.com/users/ghillairet/followers","following_url":"https://api.github.com/users/ghillairet/following{/other_user}","gists_url":"https://api.github.com/users/ghillairet/gists{/gist_id}","starred_url":"https://api.github.com/users/ghillairet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghillairet/subscriptions","organizations_url":"https://api.github.com/users/ghillairet/orgs","repos_url":"https://api.github.com/users/ghillairet/repos","events_url":"https://api.github.com/users/ghillairet/events{/privacy}","received_events_url":"https://api.github.com/users/ghillairet/received_events","type":"User","site_admin":false},"body":"This PR extends the current quick outline with better labels(#40) and introduces a new outline that overrides the one provided by YEdit with content identical to the quick outline.\r\nThe (quick) outline uses the unified model to represent the content of swagger documents. \r\n\r\n","created_at":"2016-08-11T16:14:43Z","updated_at":"2016-08-11T20:55:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c230d642ae82b4111703f92f8313234e55efe10","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/RepreZen/SwagEdit/pulls/178/commits","review_comments_url":"https://api.github.com/repos/RepreZen/SwagEdit/pulls/178/comments","review_comment_url":"https://api.github.com/repos/RepreZen/SwagEdit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RepreZen/SwagEdit/issues/178/comments","statuses_url":"https://api.github.com/repos/RepreZen/SwagEdit/statuses/d90ea00390076f38d982d68df1adb37623698b2e","head":{"label":"RepreZen:task/40","ref":"task/40","sha":"d90ea00390076f38d982d68df1adb37623698b2e","user":{"login":"RepreZen","id":15205934,"avatar_url":"https://avatars.githubusercontent.com/u/15205934?v=3","gravatar_id":"","url":"https://api.github.com/users/RepreZen","html_url":"https://github.com/RepreZen","followers_url":"https://api.github.com/users/RepreZen/followers","following_url":"https://api.github.com/users/RepreZen/following{/other_user}","gists_url":"https://api.github.com/users/RepreZen/gists{/gist_id}","starred_url":"https://api.github.com/users/RepreZen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RepreZen/subscriptions","organizations_url":"https://api.github.com/users/RepreZen/orgs","repos_url":"https://api.github.com/users/RepreZen/repos","events_url":"https://api.github.com/users/RepreZen/events{/privacy}","received_events_url":"https://api.github.com/users/RepreZen/received_events","type":"Organization","site_admin":false},"repo":{"id":43460338,"name":"SwagEdit","full_name":"RepreZen/SwagEdit","owner":{"login":"RepreZen","id":15205934,"avatar_url":"https://avatars.githubusercontent.com/u/15205934?v=3","gravatar_id":"","url":"https://api.github.com/users/RepreZen","html_url":"https://github.com/RepreZen","followers_url":"https://api.github.com/users/RepreZen/followers","following_url":"https://api.github.com/users/RepreZen/following{/other_user}","gists_url":"https://api.github.com/users/RepreZen/gists{/gist_id}","starred_url":"https://api.github.com/users/RepreZen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RepreZen/subscriptions","organizations_url":"https://api.github.com/users/RepreZen/orgs","repos_url":"https://api.github.com/users/RepreZen/repos","events_url":"https://api.github.com/users/RepreZen/events{/privacy}","received_events_url":"https://api.github.com/users/RepreZen/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RepreZen/SwagEdit","description":"Eclipse Editor for Swagger API Description Language","fork":false,"url":"https://api.github.com/repos/RepreZen/SwagEdit","forks_url":"https://api.github.com/repos/RepreZen/SwagEdit/forks","keys_url":"https://api.github.com/repos/RepreZen/SwagEdit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RepreZen/SwagEdit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RepreZen/SwagEdit/teams","hooks_url":"https://api.github.com/repos/RepreZen/SwagEdit/hooks","issue_events_url":"https://api.github.com/repos/RepreZen/SwagEdit/issues/events{/number}","events_url":"https://api.github.com/repos/RepreZen/SwagEdit/events","assignees_url":"https://api.github.com/repos/RepreZen/SwagEdit/assignees{/user}","branches_url":"https://api.github.com/repos/RepreZen/SwagEdit/branches{/branch}","tags_url":"https://api.github.com/repos/RepreZen/SwagEdit/tags","blobs_url":"https://api.github.com/repos/RepreZen/SwagEdit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RepreZen/SwagEdit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RepreZen/SwagEdit/git/refs{/sha}","trees_url":"https://api.github.com/repos/RepreZen/SwagEdit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RepreZen/SwagEdit/statuses/{sha}","languages_url":"https://api.github.com/repos/RepreZen/SwagEdit/languages","stargazers_url":"https://api.github.com/repos/RepreZen/SwagEdit/stargazers","contributors_url":"https://api.github.com/repos/RepreZen/SwagEdit/contributors","subscribers_url":"https://api.github.com/repos/RepreZen/SwagEdit/subscribers","subscription_url":"https://api.github.com/repos/RepreZen/SwagEdit/subscription","commits_url":"https://api.github.com/repos/RepreZen/SwagEdit/commits{/sha}","git_commits_url":"https://api.github.com/repos/RepreZen/SwagEdit/git/commits{/sha}","comments_url":"https://api.github.com/repos/RepreZen/SwagEdit/comments{/number}","issue_comment_url":"https://api.github.com/repos/RepreZen/SwagEdit/issues/comments{/number}","contents_url":"https://api.github.com/repos/RepreZen/SwagEdit/contents/{+path}","compare_url":"https://api.github.com/repos/RepreZen/SwagEdit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RepreZen/SwagEdit/merges","archive_url":"https://api.github.com/repos/RepreZen/SwagEdit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RepreZen/SwagEdit/downloads","issues_url":"https://api.github.com/repos/RepreZen/SwagEdit/issues{/number}","pulls_url":"https://api.github.com/repos/RepreZen/SwagEdit/pulls{/number}","milestones_url":"https://api.github.com/repos/RepreZen/SwagEdit/milestones{/number}","notifications_url":"https://api.github.com/repos/RepreZen/SwagEdit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RepreZen/SwagEdit/labels{/name}","releases_url":"https://api.github.com/repos/RepreZen/SwagEdit/releases{/id}","deployments_url":"https://api.github.com/repos/RepreZen/SwagEdit/deployments","created_at":"2015-09-30T21:30:07Z","updated_at":"2016-07-29T13:34:33Z","pushed_at":"2016-08-11T20:19:50Z","git_url":"git://github.com/RepreZen/SwagEdit.git","ssh_url":"git@github.com:RepreZen/SwagEdit.git","clone_url":"https://github.com/RepreZen/SwagEdit.git","svn_url":"https://github.com/RepreZen/SwagEdit","homepage":null,"size":9479,"stargazers_count":8,"watchers_count":8,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":62,"forks":1,"open_issues":62,"watchers":8,"default_branch":"master"}},"base":{"label":"RepreZen:master","ref":"master","sha":"4f4abc448ec514ed3498af18f0ac0b3a550918fd","user":{"login":"RepreZen","id":15205934,"avatar_url":"https://avatars.githubusercontent.com/u/15205934?v=3","gravatar_id":"","url":"https://api.github.com/users/RepreZen","html_url":"https://github.com/RepreZen","followers_url":"https://api.github.com/users/RepreZen/followers","following_url":"https://api.github.com/users/RepreZen/following{/other_user}","gists_url":"https://api.github.com/users/RepreZen/gists{/gist_id}","starred_url":"https://api.github.com/users/RepreZen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RepreZen/subscriptions","organizations_url":"https://api.github.com/users/RepreZen/orgs","repos_url":"https://api.github.com/users/RepreZen/repos","events_url":"https://api.github.com/users/RepreZen/events{/privacy}","received_events_url":"https://api.github.com/users/RepreZen/received_events","type":"Organization","site_admin":false},"repo":{"id":43460338,"name":"SwagEdit","full_name":"RepreZen/SwagEdit","owner":{"login":"RepreZen","id":15205934,"avatar_url":"https://avatars.githubusercontent.com/u/15205934?v=3","gravatar_id":"","url":"https://api.github.com/users/RepreZen","html_url":"https://github.com/RepreZen","followers_url":"https://api.github.com/users/RepreZen/followers","following_url":"https://api.github.com/users/RepreZen/following{/other_user}","gists_url":"https://api.github.com/users/RepreZen/gists{/gist_id}","starred_url":"https://api.github.com/users/RepreZen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RepreZen/subscriptions","organizations_url":"https://api.github.com/users/RepreZen/orgs","repos_url":"https://api.github.com/users/RepreZen/repos","events_url":"https://api.github.com/users/RepreZen/events{/privacy}","received_events_url":"https://api.github.com/users/RepreZen/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RepreZen/SwagEdit","description":"Eclipse Editor for Swagger API Description Language","fork":false,"url":"https://api.github.com/repos/RepreZen/SwagEdit","forks_url":"https://api.github.com/repos/RepreZen/SwagEdit/forks","keys_url":"https://api.github.com/repos/RepreZen/SwagEdit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RepreZen/SwagEdit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RepreZen/SwagEdit/teams","hooks_url":"https://api.github.com/repos/RepreZen/SwagEdit/hooks","issue_events_url":"https://api.github.com/repos/RepreZen/SwagEdit/issues/events{/number}","events_url":"https://api.github.com/repos/RepreZen/SwagEdit/events","assignees_url":"https://api.github.com/repos/RepreZen/SwagEdit/assignees{/user}","branches_url":"https://api.github.com/repos/RepreZen/SwagEdit/branches{/branch}","tags_url":"https://api.github.com/repos/RepreZen/SwagEdit/tags","blobs_url":"https://api.github.com/repos/RepreZen/SwagEdit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RepreZen/SwagEdit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RepreZen/SwagEdit/git/refs{/sha}","trees_url":"https://api.github.com/repos/RepreZen/SwagEdit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RepreZen/SwagEdit/statuses/{sha}","languages_url":"https://api.github.com/repos/RepreZen/SwagEdit/languages","stargazers_url":"https://api.github.com/repos/RepreZen/SwagEdit/stargazers","contributors_url":"https://api.github.com/repos/RepreZen/SwagEdit/contributors","subscribers_url":"https://api.github.com/repos/RepreZen/SwagEdit/subscribers","subscription_url":"https://api.github.com/repos/RepreZen/SwagEdit/subscription","commits_url":"https://api.github.com/repos/RepreZen/SwagEdit/commits{/sha}","git_commits_url":"https://api.github.com/repos/RepreZen/SwagEdit/git/commits{/sha}","comments_url":"https://api.github.com/repos/RepreZen/SwagEdit/comments{/number}","issue_comment_url":"https://api.github.com/repos/RepreZen/SwagEdit/issues/comments{/number}","contents_url":"https://api.github.com/repos/RepreZen/SwagEdit/contents/{+path}","compare_url":"https://api.github.com/repos/RepreZen/SwagEdit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RepreZen/SwagEdit/merges","archive_url":"https://api.github.com/repos/RepreZen/SwagEdit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RepreZen/SwagEdit/downloads","issues_url":"https://api.github.com/repos/RepreZen/SwagEdit/issues{/number}","pulls_url":"https://api.github.com/repos/RepreZen/SwagEdit/pulls{/number}","milestones_url":"https://api.github.com/repos/RepreZen/SwagEdit/milestones{/number}","notifications_url":"https://api.github.com/repos/RepreZen/SwagEdit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RepreZen/SwagEdit/labels{/name}","releases_url":"https://api.github.com/repos/RepreZen/SwagEdit/releases{/id}","deployments_url":"https://api.github.com/repos/RepreZen/SwagEdit/deployments","created_at":"2015-09-30T21:30:07Z","updated_at":"2016-07-29T13:34:33Z","pushed_at":"2016-08-11T20:19:50Z","git_url":"git://github.com/RepreZen/SwagEdit.git","ssh_url":"git@github.com:RepreZen/SwagEdit.git","clone_url":"https://github.com/RepreZen/SwagEdit.git","svn_url":"https://github.com/RepreZen/SwagEdit","homepage":null,"size":9479,"stargazers_count":8,"watchers_count":8,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":62,"forks":1,"open_issues":62,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RepreZen/SwagEdit/pulls/178"},"html":{"href":"https://github.com/RepreZen/SwagEdit/pull/178"},"issue":{"href":"https://api.github.com/repos/RepreZen/SwagEdit/issues/178"},"comments":{"href":"https://api.github.com/repos/RepreZen/SwagEdit/issues/178/comments"},"review_comments":{"href":"https://api.github.com/repos/RepreZen/SwagEdit/pulls/178/comments"},"review_comment":{"href":"https://api.github.com/repos/RepreZen/SwagEdit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RepreZen/SwagEdit/pulls/178/commits"},"statuses":{"href":"https://api.github.com/repos/RepreZen/SwagEdit/statuses/d90ea00390076f38d982d68df1adb37623698b2e"}}}}
{"actor":{"display_login":"tfesenko"}}