Book a Demo

Author Topic: java.lang Types in class Model  (Read 4248 times)

afquiros

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
java.lang Types in class Model
« on: February 25, 2009, 04:02:08 am »
Hello, first sorry for my English, I am new with EA. I want to create a class model, when I insert a class in diagram, I want to add atributes for it, but not appear java.lang Types like String, Integer, etc. How can I do this types appear? and How can I import a jar file to use the types of it?.

Thank you.
Good bye.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: java.lang Types in class Model
« Reply #1 on: February 25, 2009, 04:08:28 am »
You need to set the default language for your model, and perhaps for the new package.

Do this with the Tools | Options dialog (shortcut = Control-F9). Click Source Code Engineering on the left-side tree. Near the top of the dialog you will now see Default Language for Code Generation. Set the drop-down to Java.

Take a look at the packages that will hold your classes. Open the Properties dialog for each package, and ensure that the Language is set to Java.

To import a .jar file you need to use the Import Binary Module function of EA. You will find this in the EA help index under Import | Binary Module, Reverse Engineering (at least in EA 7.1).

HTH, David
No, you can't have it!

afquiros

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: java.lang Types in class Model
« Reply #2 on: February 25, 2009, 04:18:54 am »
Thank you very much, David.

Quote
You need to set the default language for your model, and perhaps for the new package.

Do this with the Tools | Options dialog (shortcut = Control-F9). Click Source Code Engineering on the left-side tree. Near the top of the dialog you will now see Default Language for Code Generation. Set the drop-down to Java.

Take a look at the packages that will hold your classes. Open the Properties dialog for each package, and ensure that the Language is set to Java.

To import a .jar file you need to use the Import Binary Module function of EA. You will find this in the EA help index under Import | Binary Module, Reverse Engineering (at least in EA 7.1).

HTH, David

afquiros

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: java.lang Types in class Model
« Reply #3 on: February 25, 2009, 04:33:06 am »
I have done import a jar file and I can use the class of the jar in my class model, but first not working. I select Java like Default Language for Code Generation and the languaje of all my packages is Java but not appear String, Integer, Float, Double, etc in types for attributes, any idea?.

Thank you.

Quote
You need to set the default language for your model, and perhaps for the new package.

Do this with the Tools | Options dialog (shortcut = Control-F9). Click Source Code Engineering on the left-side tree. Near the top of the dialog you will now see Default Language for Code Generation. Set the drop-down to Java.

Take a look at the packages that will hold your classes. Open the Properties dialog for each package, and ensure that the Language is set to Java.

To import a .jar file you need to use the Import Binary Module function of EA. You will find this in the EA help index under Import | Binary Module, Reverse Engineering (at least in EA 7.1).

HTH, David

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: java.lang Types in class Model
« Reply #4 on: February 25, 2009, 07:58:56 am »
OK, I think I see what you mean...

Look at the Settings | Code Datatypes dialog. That's how the menu navigation reads; the dialog itself is named Programming Languages Datatypes.

Use the Product Name dialog to select Java. You should see what EA recognizes are 'primitive' data types for Java. These are the basics only, with other types being built up from them. You will find several of these by importing the 'core' Java namespaces from the appropriate .jar files, after which you can reference the datatypes involved. [Also look up Namespace in the EA Help index, but that's not necessary to get going.]

You will note that there is no Integer data type (for instance), but there is an int entry. This is correct for Java. [Note also that capitalization is significant, reflecting the Java naming rules.]

You will char, which can be used in arrays to represent string data. You will also see float (once again pay attention to capitalization), double, and others.

Now click on each of the datatypes listed. Note that the Common Type text box reflects the 'common' data type that each entry maps to. You will find all the entries you mention other than String. [For char you will see Char listed. As above, this represents a single character; a string can be represented by an array of these, or other structures you will find in the .jar namespaces.]

HTH, David
No, you can't have it!

afquiros

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: java.lang Types in class Model
« Reply #5 on: February 25, 2009, 07:28:09 pm »
Thank you, again.

Quote
OK, I think I see what you mean...

Look at the Settings | Code Datatypes dialog. That's how the menu navigation reads; the dialog itself is named Programming Languages Datatypes.

Use the Product Name dialog to select Java. You should see what EA recognizes are 'primitive' data types for Java. These are the basics only, with other types being built up from them. You will find several of these by importing the 'core' Java namespaces from the appropriate .jar files, after which you can reference the datatypes involved. [Also look up Namespace in the EA Help index, but that's not necessary to get going.]

You will note that there is no Integer data type (for instance), but there is an int entry. This is correct for Java. [Note also that capitalization is significant, reflecting the Java naming rules.]

You will char, which can be used in arrays to represent string data. You will also see float (once again pay attention to capitalization), double, and others.

Now click on each of the datatypes listed. Note that the Common Type text box reflects the 'common' data type that each entry maps to. You will find all the entries you mention other than String. [For char you will see Char listed. As above, this represents a single character; a string can be represented by an array of these, or other structures you will find in the .jar namespaces.]

HTH, David

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: java.lang Types in class Model
« Reply #6 on: February 25, 2009, 11:52:35 pm »
But did you get it working?
No, you can't have it!