]
George Gastaldi edited comment on ROASTER-72 at 7/8/15 4:28 PM:
----------------------------------------------------------------
Of course that would also mean we should add a parseUnit method in Roaster
was (Author: gastaldi):
Of course that would also mean we should add a parseUnit method in Roaster, as well
provide means to create one
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'.