[
https://issues.jboss.org/browse/ROASTER-72?page=com.atlassian.jira.plugin...
]
George Gastaldi commented on ROASTER-72:
----------------------------------------
Hi Shoji, thanks for your issue and your PR.
I think we should introduce a visitor pattern (acting as a callback) to solve this issue.
Something like {{void Roaster.parse(contents, visitor)}}.
I am not entirely happy with the solution proposed in the PR, as I believe that your
proposed changes will make the API harder to understand.
Thoughts are welcome.
Adds a new API to parse the multiple declarations of type in a file.
--------------------------------------------------------------------
Key: ROASTER-72
URL:
https://issues.jboss.org/browse/ROASTER-72
Project: Roaster
Issue Type: Feature Request
Components: API, JDT, Tests
Affects Versions: 2.14.0.Final
Environment: Java 8, Windows 8.1 64 bit, Eclipse mars 64bit
Reporter: Shoji Kuzukami
Fix For: 2.x Future
Although the java language permits multiple type declarations of top level in a java
file, the 'roaster' cannot support this function in the API level. Therefore, I
tentatively hack and create an API for the support of multiple declarations.
Please refine and refactor the API until the next release because I cannot devote more
efforts on this. The new API is initially marked as @Deprecated for such reasons.
--comments--
Adds a new API and data structure to parse the multiple declarations of
classes in a java file.
An instance of the 'JavaSourceUnit' represents a java source file which
contains multiple declarations of type.
An API named Roaster.parse2(String encoding, InputStream data) is
tentatively created to extract the JavaSourceUnit result.
Some tests for the new function are created at
'JavaClassMultiDeclsInAFile.java'.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)