{"action":"created","issue":{"url":"https://api.github.com/repos/javaparser/javaparser/issues/660","repository_url":"https://api.github.com/repos/javaparser/javaparser","labels_url":"https://api.github.com/repos/javaparser/javaparser/issues/660/labels{/name}","comments_url":"https://api.github.com/repos/javaparser/javaparser/issues/660/comments","events_url":"https://api.github.com/repos/javaparser/javaparser/issues/660/events","html_url":"https://github.com/javaparser/javaparser/issues/660","id":196388208,"number":660,"title":"ImportDeclaration to have getImportAsString method to get full import","user":{"login":"nishantsinha-5","id":4038289,"avatar_url":"https://avatars.githubusercontent.com/u/4038289?v=3","gravatar_id":"","url":"https://api.github.com/users/nishantsinha-5","html_url":"https://github.com/nishantsinha-5","followers_url":"https://api.github.com/users/nishantsinha-5/followers","following_url":"https://api.github.com/users/nishantsinha-5/following{/other_user}","gists_url":"https://api.github.com/users/nishantsinha-5/gists{/gist_id}","starred_url":"https://api.github.com/users/nishantsinha-5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nishantsinha-5/subscriptions","organizations_url":"https://api.github.com/users/nishantsinha-5/orgs","repos_url":"https://api.github.com/users/nishantsinha-5/repos","events_url":"https://api.github.com/users/nishantsinha-5/events{/privacy}","received_events_url":"https://api.github.com/users/nishantsinha-5/received_events","type":"User","site_admin":false},"labels":[{"id":182392530,"url":"https://api.github.com/repos/javaparser/javaparser/labels/Feature%20request","name":"Feature request","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/javaparser/javaparser/milestones/16","html_url":"https://github.com/javaparser/javaparser/milestone/16","labels_url":"https://api.github.com/repos/javaparser/javaparser/milestones/16/labels","id":1995677,"number":16,"title":"3.0.0","description":"","creator":{"login":"matozoid","id":55701,"avatar_url":"https://avatars.githubusercontent.com/u/55701?v=3","gravatar_id":"","url":"https://api.github.com/users/matozoid","html_url":"https://github.com/matozoid","followers_url":"https://api.github.com/users/matozoid/followers","following_url":"https://api.github.com/users/matozoid/following{/other_user}","gists_url":"https://api.github.com/users/matozoid/gists{/gist_id}","starred_url":"https://api.github.com/users/matozoid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matozoid/subscriptions","organizations_url":"https://api.github.com/users/matozoid/orgs","repos_url":"https://api.github.com/users/matozoid/repos","events_url":"https://api.github.com/users/matozoid/events{/privacy}","received_events_url":"https://api.github.com/users/matozoid/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":0,"state":"open","created_at":"2016-09-10T18:59:50Z","updated_at":"2016-12-19T11:34:45Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2016-12-19T11:11:42Z","updated_at":"2016-12-20T10:56:27Z","closed_at":null,"body":"`ImportDeclaration` class to have a `getImportAsString` method which will return fully qualified name of import irrespective of implementation of `ImportDeclaration`.\r\n\r\n`public abstract String getImportAsString(){ }`\r\n\r\n   E.g. \r\n    For code `import java.util.List;`\r\n    output: `java.util.List`\r\n    For code `import static java.lang.System.out;`\r\n    output: `java.lang.System.out`\r\n    For code `import java.util.*;`\r\n    output: `java.util.*`\r\n    For code `import static java.lang.System.*;`\r\n    output: `java.lang.System.*`\r\n"},"comment":{"url":"https://api.github.com/repos/javaparser/javaparser/issues/comments/268214390","html_url":"https://github.com/javaparser/javaparser/issues/660#issuecomment-268214390","issue_url":"https://api.github.com/repos/javaparser/javaparser/issues/660","id":268214390,"user":{"login":"nishantsinha-5","id":4038289,"avatar_url":"https://avatars.githubusercontent.com/u/4038289?v=3","gravatar_id":"","url":"https://api.github.com/users/nishantsinha-5","html_url":"https://github.com/nishantsinha-5","followers_url":"https://api.github.com/users/nishantsinha-5/followers","following_url":"https://api.github.com/users/nishantsinha-5/following{/other_user}","gists_url":"https://api.github.com/users/nishantsinha-5/gists{/gist_id}","starred_url":"https://api.github.com/users/nishantsinha-5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nishantsinha-5/subscriptions","organizations_url":"https://api.github.com/users/nishantsinha-5/orgs","repos_url":"https://api.github.com/users/nishantsinha-5/repos","events_url":"https://api.github.com/users/nishantsinha-5/events{/privacy}","received_events_url":"https://api.github.com/users/nishantsinha-5/received_events","type":"User","site_admin":false},"created_at":"2016-12-20T10:56:27Z","updated_at":"2016-12-20T10:56:27Z","body":"@ftomassetti is there any specific reason/logic behind using `Element`\r\n\r\n@matozoid \r\nYou are right,  * is not a part of qualified name, what are you suggesting !!\r\nI am not sure but then we can think of below implementation.\r\nfor code `java.util.*`\r\nShall we use use `java.util` as the value of `getImportAsString` and use `abstract boolean isAsterisk();` method to get asterisk info.\r\n\r\n> ~~\"Alright, maybe the most important question is: what do you want to use this for? Do you simply want to print it out? Because if you want to interpret it, using the info in the subclasses is much easier.\r\n\r\nLet me give information about what I am doing.\r\n\r\nI have created a project(one of many work) where I have a list of imports(in a file with change imports from and to) and I am parsing java file then comparing the value of `ImportDeclaration` to the import list, if found change the value to new import.\r\n\r\nNow I have to do heavy lifting to get those information from the `ImportDeclaration` in string format.\r\nI could use `toString` method but it has `import`, `;` and a trailing white-space with it.\r\n\r\nSame goes for parsing import using `JavaParser.parseImport()`, where user has to write whole import declaration then only it parses it.\r\n\r\nI would suggest if we can have `JavaParser.parseImport()` which will parse the import string and append other information.\r\ne.g.\r\ncode : `JavaParser.parseImport(\"java.util.List\")`\r\noutput : `import java.util.List;`\r\n\r\ncode : `JavaParser.parseImport(\"java.util.*\")`\r\noutput : `import java.util.*;`\r\n\r\n\r\n"}}
{"actor":{"display_login":"nishantsinha-5"}}