Book a Demo

Author Topic: Inherit From JDK Class  (Read 6093 times)

avexus_kms

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Inherit From JDK Class
« on: January 14, 2003, 04:27:18 pm »

How do I represent that a class I am defining is subclassing an existing class from the JDK?  For example, I want to create my custom Exception classes which will inherit from java.lang.Exception. Is there a way to tell EA where my JDK is installed so it can recognize these base classes (and interfaces, too) so that they can be referenced as parent classes, attribute types, and parameter types? The only way I can see right now is to define all the JDK classes I need myself but that is more work than I want to do.

TIA.


andyd

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
  • Hi
    • View Profile
Re: Inherit From JDK Class
« Reply #1 on: January 26, 2003, 04:03:34 pm »
Hi,
One way to deal with this is to unjar the source jar in the jdk and then import the classes that you want to work with into the EA model.

Be careful how much you import as the model can get quite large.

Andy.

avexus_kms

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: Inherit From JDK Class
« Reply #2 on: January 27, 2003, 08:09:44 am »
I had already tried that, but found no way in EA to do it. I could only find "Import Source Code", which doesn't work as the unjar'd files are, of course, .class files, not .java files. The online help gave no assistance. Any ideas on how to do this?

andyd

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
  • Hi
    • View Profile
Re: Inherit From JDK Class
« Reply #3 on: January 27, 2003, 08:56:54 am »
Your looking at the wrong file.  Sorry, its not the jar that you want it's a zip.  The file is called src.zip and is in the home directory of the jdk.  This contains the java source and not class files.

I have done this myself and know that it works.

Andy.

jkorman

  • EA User
  • **
  • Posts: 99
  • Karma: +0/-0
    • View Profile
Re: Inherit From JDK Class
« Reply #4 on: January 28, 2003, 02:05:57 pm »
When you import the jdk source you want it is better to
right click in the Project Browser and select

  Code Engineering | Import Source Directory

This will import the code and directories.

??? Has anyone done this and cleaned up the model similar
to the Rose Frameworks???

I've done this for the java.lang and java.util packages but
not much else.

Jim