jQuery in Action, 3rd edition
The moose likes Java in General and the fly likes can java reflect .java files... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "can java reflect .java files..." Watch "can java reflect .java files..." New topic

can java reflect .java files...

Grim DeFoe

Joined: Aug 30, 2006
Posts: 11
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

Joined: Aug 16, 2005
Posts: 15092

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!

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Srinivas Kalvala
Ranch Hand

Joined: Oct 20, 2005
Posts: 257


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

Joined: Aug 30, 2006
Posts: 11
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..

Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

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!

[Jess in Action][AskingGoodQuestions]
Grim DeFoe

Joined: Aug 30, 2006
Posts: 11
Hi "Ernest Friedman-Hill"

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

Thanks for telling me...
I agree. Here's the link: http://aspose.com/file-tools
subject: can java reflect .java files...
It's not a secret anymore!