Book a Demo

Author Topic: find package names (java package)  (Read 4502 times)

domi55

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
find package names (java package)
« on: April 23, 2012, 06:12:28 pm »
Hi all.

I have the following project structure:



How can I determine the package name of Java Classes within my Add-In? For example for ClassB1:

Code: [Select]
pkg

and NOT

Code: [Select]
A.pkg
The "problem" is that pkg and A both have the type package (EA.Package). So basically my question is how I can distinguish between "model packages" and "code packages".
« Last Edit: April 23, 2012, 06:24:20 pm by domi55 »

stao

  • EA User
  • **
  • Posts: 137
  • Karma: +0/-0
    • View Profile
Re: find package names (java package)
« Reply #1 on: April 23, 2012, 07:10:20 pm »
model packages always have parent packages which have the parentID == 0  (root Nodes dont have any parents)  :-[ not the best method i guess.
perhaps there is another solution.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: find package names (java package)
« Reply #2 on: April 23, 2012, 07:47:28 pm »
You might consider to check the IsNamespace property of a package.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: find package names (java package)
« Reply #3 on: April 23, 2012, 09:35:38 pm »
I would opt for the Namespace solution as well.

Geert