• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can java reflect .java files...

 
Grim DeFoe
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi' i'm really interest in this topic, i'm really appreciate if somebody can help me..cos i'm really stuck in here...

My Problems are :
1. i want to ask about this, can Java reflect from .java file?
2. i'm using Eclipse IDE, i'm really interesting about how JTree or Package Explorer in Eclipse can always displaying update information about class structure? but .java files not compiled, how can? if Eclipse using reflection, .java files must be compiled first, correct me if i'm wrong?
The fact is Eclipse don't have to compiled .java files to get the update information about class structure and displaying in JTree or package Explorer...how implement like this?

what i mean like this :
ex : if i type int x = 100; (not only int, it could be anything else..) at the working files, JTree or Package Explorer in Eclipse can always update the information about class structure, but .java files not compiled..

i hope my question are easy to understand, i really need some help..

Thanks a lot..
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15354
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eclipse has its own built-in Java compiler, it parses your source code while you type it in, and compiles it whenever you save your source file.

The Java API does not have classes to analyze Java files. In Eclipse, the people who wrote Eclipse all wrote this themselves. Eclipse is not a trivial piece of software!
 
Srinivas Kalvala
Ranch Hand
Posts: 257
Firefox Browser Hibernate Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

The Eclipse, will not do javac compile on the source files. Eclipse got its own parser to parse the .java files. Remember, not only for java files, Eclispe got plugins for other format of the files too.

The best way to learn these thigns is, starting developing simple plugins for eclipse, you will get much information.

Thank you.

 
Grim DeFoe
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, thanks to both of you,that's gave me a lot of pictures..guess i got it now.. do you mean like javacc right? correct me if i'm wrong..

thanks...
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi "Mr. Manautopsy",

Welcome to JavaRanch!

We have a strict policy on display names, which must be a real-sounding first and last name with a space between. A title is not an acceptable substitute for a first name, and your last name sounds a bis suspicious to me as well.

Please go here and fix your display name up, pronto. Thanks, pardner!
 
Grim DeFoe
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi "Ernest Friedman-Hill"

Sorry about that, i already change my name, i hope it's ok now..

Thanks for telling me...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic