Hi Guys! I'm not getting to list all subclasses of a class. I list the classes, my algorithm checks if each class has a subclass. If true, it was to list all subclasses. But this doesn´t happen, it seems to ignore the condition "if (essaClasse.hasSubClass). Can anyone help me? Bellow the code.
Debora (Rio de Janeiro - Brasil)
The full code:
asked 12 Apr '11, 17:38
You seem to calling
Is this deliberate? ...hard to tell since I don't know what data you have in your model, but you seem to be changing the namespace of the class? In that case, you should do so before the
...alternatively, instead of changing namespaces, you could just check each class to see if it corresponds with the
answered 12 Apr '11, 22:54
I didn't have your data file, so I created one and with just a few changes it seems to work. I think the big thing is that you did not have a null pointer check for variable cla.
Code is at: https://gist.github.com/916880
Output with the schema I used:
As @Signified says you can achieve the same thing without having to specify a new fully qualified URI for the class. This seems like test code, so I thought maybe you were doing with the fully qualified URI to show yourself how it works. But, if you just want to see classes with subclasses then a more succinct version would look like: