gmuecke / reflections

Automatically exported from code.google.com/p/reflections
Do What The F*ck You Want To Public License
0 stars 0 forks source link

Configurable file extensions in AbstractScanner.acceptsInput(String) #136

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Currently the method "acceptsInput(String)" in "AbstractScanner" only accepts 
".class" extensions. This should be made configurable to support MetaAdapter 
implementations that are able to parse other types like ".java" files.

The best solution would be to ask the MetaAdapter:

public boolean acceptsInput(String file) {
    return getMetadataAdapter().acceptsInput(file);
}

Original issue reported on code.google.com by reg.goog...@future-invent.de on 2 Dec 2012 at 2:39

GoogleCodeExporter commented 8 years ago
Two additions: 1) Type of this issue should be "enhancement" (Didn't see that 
point when adding the issue) 2) If you like I can implement the change

Original comment by reg.goog...@future-invent.de on 2 Dec 2012 at 3:52

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
agree. submit a patch and I'll apply it. great.
this enhancement is in the context of using http://www.jamopp.org/, as 
mentioned in the google-code-reflections 
(https://groups.google.com/forum/?fromgroups=#!topic/google-code-reflections/t0m
SJzUXGoA). please provide some details on why would one use that library and 
what are the benefits.

Original comment by ronm...@gmail.com on 22 Dec 2012 at 5:48

GoogleCodeExporter commented 8 years ago
In contrast to the classic byte code engineering libraries, JaMoPP parses 
directly the Java source (class files are possible too) and creates an Ecore 
Metamodel from it. This means you have all the information available that is in 
the Java source code. 

I created a new meta adapter for reflections that uses JaMoPP to read the meta 
information: https://github.com/fuinorg/refmopp 

With the attached (Eclipse) patch it's possible to use this adapter out of the 
box. If you're interested we could also integrate it directly into reflections.

Original comment by reg.goog...@future-invent.de on 22 Dec 2012 at 8:54

Attachments:

GoogleCodeExporter commented 8 years ago
Of yourse it's also possible to modify the parsed Java source and write it then 
back to disk. This way you can do cool things like programmatic source code 
refactorings or more standard stuff like source code generation. 

Reflections would be used to find the parts in the code you want to do 
something with.

Original comment by reg.goog...@future-invent.de on 22 Dec 2012 at 9:21

GoogleCodeExporter commented 8 years ago
Any idea when the patch will be applied?

Original comment by reg.goog...@future-invent.de on 23 Jun 2013 at 1:51

GoogleCodeExporter commented 8 years ago
Pull request for the new GitHub repository is here: 
https://github.com/ronmamo/reflections/pull/1

Original comment by reg.goog...@future-invent.de on 28 Jun 2013 at 7:42

GoogleCodeExporter commented 8 years ago

Original comment by ronm...@gmail.com on 23 Nov 2013 at 12:27