Is it possible to find all subclasses or implementing classes?

Hi, I want to provide a GUI which displays all classes which are subclasses of a class or are implementing a special interface. To avoid maintaining these lists by hand, I'm searching for a way to find out with a piece of code. So my first taught was to use the reflection API (java.lang.Class) but there is no such method available.
In most cases these classes are in the same package, so it would be enough to get all casses of a pacckage and to test them with instanceof.
Is there any way to do so?
Thanks a lot in advance.
Greetings Michael

Hi Pete,
Thanks for the reply. That's exactly what I've been looking for.
I hope Sun will add something like this to the normal j2se-.API.
Greetings Michael

Similar Messages

  • Is it possible to find all the documents for a serial number ?

    Hi all,
    I'm using materials with serial numbers in complaints.
    Is it possible to find all the documents for this serial number ?
    Is it possible to check if this serial number is allready in use in any document ?

    Hi Mengelkemier,
    I think you're posting in the wrong forum.  This forum is intended to be used to discuss virtualizing Exchange Server on the the vSphere platform.  The question you're asking seems to be a mobile device specific question.
    You would probably get better visibility posting on a forum dedicated to your particular device.  And for what it's worth, some devices will let you sync all of your email and others will only let you sync a certain amount.  It's dependent on the device you're using.
    Good luck in finding your answer.
    Matt

  • Is it possible to find all images below 300dpi in a document?

    Hi there, I'm hoping this is a quick question. I've had a look on google but to no avail.
    Is it possible to find all images within an indesign document that are below 300dpi. I've got a lot of images placed in a document, quite a lot were low res (not all, but a lot) just for quickness to begin with...but now I need to replace them with the high res for print, and theres LOADS so i don't really wanna do it manually.
    I know when you do preflight indesign will tell you if there are any images using RGB colour space, but will it do somehting similar with image quality?
    Mac OSX 10.5.8, InDesign CS3

    Okay, here is a fast one but it seems to do the job.
    Copy the text in the frame below into a plain text document using Notepad, Textedit (in plain text mode!), or -- safest -- InDesign's own ESTK Editor that comes installed with the package. Save as "ReportBadResolution.jsx" in your User Scripts folder (see also InDesignSecret's How to install scripts in InDesign).  Double-click to run.
    If nothing happens, all images are okay. If you get an error somewhere, you have used images in a way I did not foresee (and thus didn't script how to handle these); try to report what goes wrong where and on what sort of image, if possible.
    If the script does find anything wrong -- it checks for a minimum resolution of 300 dpi and, as a bonus, on badly scaled images -- it will create a new blank document and fill a text frame with the relevant information: image name, page, and x/y resolutions. It creates only one single page so if you get an 'overset text plus' at the bottom you have lots and lots of bad images ...
    Here's the script to copy:
    //DESCRIPTION:Report Bad Resolutions for a New Year
    // No Guarantees, Ltd. Use at your own risk.
    // Jongware, 05-Feb-2010
    // Minimum dpi allowed:
    var minimumValue = 300;
    // Alert when x/y scaling is off by this much percents:
    var percentageScaling = 1;
    var lowResList = new Array;
    for (aGraphic=0; aGraphic<app.activeDocument.allGraphics.length; aGraphic++)
    oneGraphic = app.activeDocument.allGraphics[aGraphic];
    try {
      xres = oneGraphic.effectivePpi[0];
      yres = oneGraphic.effectivePpi[1];
      if (xres < minimumValue || yres < minimumValue)
       lowResList.push (oneGraphic);
      else
       if (xres < yres)
        scaling = 100*yres/xres;
       else
        scaling = 100*xres/yres;
       if (scaling > 100+percentageScaling)
        lowResList.push (oneGraphic);
    } catch (_) {}
    if (lowResList.length > 0)
    doc = app.documents.add();
    frame = doc.textFrames.add({geometricBounds:[0,0,doc.documentPreferences.pageHeight, doc.documentPreferences.pageWidth]});
    txt = '';
    for (i=0; i<lowResList.length; i++)
      pg = ultimateParent (lowResList[i]);
      txt = txt+"File: "+lowResList[i].itemLink.name;
      if (pg.parent instanceof(MasterSpread))
       txt = txt+' on Master spread '+pg.name;
      else
       if (pg instanceof(Spread))
        txt = txt+' on clipboard of pg '+pg.pages[0].name;
        for (j=1; j<pg.pages.length; j++)
         txt += '-'+pg.pages[j].name;
       } else
        txt = txt+' on pg '+pg.name;
      txt = txt+' has xres: '+lowResList[i].effectivePpi[0]+', yres: '+lowResList[i].effectivePpi[1]+'\n';
    frame.contents = txt;
    } else
    alert ("No images have a resolution less than "+minimumValue+" dpi");
    function ultimateParent(obj)
    while (1)
      obj = obj.parent;
      if (obj.constructor.name == "Page")
       break;
      if (obj.constructor.name == "Character")
       obj = obj.parentTextFrames[0];
      if (obj.constructor.name == "Spread" || obj.constructor.name == "MasterSpread")
       break;
    return obj;

  • Right syntax to find all records of a class

    I want to find all records of a particular entity class available in DB. I find that the following query works fine when using Hibernate as JPA provider, but fails when using Glassfish's default (Toplink).
    SELECT p FROM com.mycompany.Person pAs per JPA spec, which is the correct form to refer to an entity class in queries? Is it the fully qualified name or only the simple name? If it is only the simple name, how do I manage rare cases where two different packages have classes with same name?

    Sorry for wasting users' time. A second look into the JPA spec answered it.
    For those coming across this problem, entity name of a class defaults to its unqualified class name. :)

  • Regular expression: multiple possible matches, find all?

    Hi, I'm looking over something I'm afraid, the solution to my problem will probably be simple :(
    Consider the input string "something aname bname something"
    I have a list of other strings that might occur in the string:
    "aname"
    "aname bname"
    I want to know if any of the strings in the list occurs in the input string, possibly both.
    For this, I created the pattern "(?i)(aname)|(aname bname)(?i)"
    With a Matcher, it will only match the "aname", while I want to find both the "aname" and the "aname bname".
    Reversing the pattern, "(?i)(aname bname)|(aname)(?i)", it will only find "aname bname", and not the single "aname".
    I cannot really create a very sofisticated pattern such as "(aname( bname)?)", since the list of strings comes from a database. Creating a very nice pattern by looking at the possible matcher strings before compiling the pattern is not really a clean solution.
    Again: what is my at-this-point-non-functional-brain missing? Thanx!

    Thanks for the link. Of course I have read the manual, I guess there is something wrong with my eyes because I don't immediatly see the answer. Last weekend I already ordered new glasses, but they take three to four weeks to deliver my new glasses. Could you in the mean time point me to the exact place I should look?
    In all seriousness, I already tried the Matcher. It's the pattern itself that causes it to match only the first alternative in the list of groups in that pattern. I did read the Pattern manual here.
    My test code:          String input = "something aname bname";
              String match1 = "aname";
              String match2 = "aname bname";
              String quotedPattern = "(?i)(" + Pattern.quote(match1) + ")|(" + Pattern.quote(match2) + ")";
              System.out.println(quotedPattern);
              Pattern p = Pattern.compile(quotedPattern);
              Matcher m = p.matcher(input);
              while (m.find()) {
                   for (int i = 0; i < m.groupCount() + 1; i++) {
                        System.out.println("Group " + i + ":\t" + m.group(i));
              }Outputs:
    (?i)(\Qaname\E)|(\Qaname bname\E)
    Group 0:     aname
    Group 1:     aname
    Group 2:     null
    The last matching group should also match in my opinion. If I turn the pattern around, i.e. first "aname bname" and then "aname", it will still only find "aname bname" and not "aname", which would also match.
    Thanks again

  • Is it possible to see all tables in sap

    Hi,
            I am learning abap and i am interested to know about all tables like Ekko, Ekpo, Eket, Mara, Marc....etc
            is there any possibility to find all these tables ...if any one knows kindly tell me.

    hi uday,
    this code will surely help you Tcode <b>SE85</b> just go through it and you will find all you need and if you want to where your tables are being used you can click where used icon on the screen.
    <b>SE85->ABAP Dictionary->database table</b>
    you can also find the fields as well as structures,
    hope this information will help you.
    don't forget to reward points,

  • Error while saving activity - it was not possible to save all objects

    Hi
    We are on ECC6 EHP4 and having just started to config EIC ERP, we have done some configuration and have referred to various SAP notes, the main note being 1052082 to set up case management.  We have managed to create an activity but on saving we get the following messages:
    Error whilce saving activity (message class HREIC_APPL - message number 246)
    Activity was saved
    It was not possible to save all objects successfully (message class CRM_BOL - message number 010)
    We are not sure how to correct this, we have searched and cannot find anything relating to these messages, I hope someone can be of assistance.
    many thanks
    Julie

    Hi Julie
    There are list of items that dont transport or need to be updated via manual configuration such as number ranges, surveys, email addresses and several others.
    Glad you figured out this one.
    Jarret

  • Calling a method of all subclasses.

    I have a very complicated problem:
    I need a series of classes that have almost everything in common. They differ only in two things: variable static String ID, which identifies this class, and a method modify() which is implemented by each class differently. Other than that, there are many other fields and methods that are needed for each class, but each class would handle these methods and fields equally.
    So i declared an abstract class where I declared all thing subclasses have in common and each individual class is a subclass of this abstract class. The two thing mentioned before are declared as follows:
    protected static String ID;
    public abstract void modify();
    Now I need three things:
    1) I need a list of IDs of all subclasses for a combo box. So since ID is static and protected and set to value only in the subclass, it can be referenced. This is done by a static method getId(), also declared in the abstract class. Now I do not know whether this ID is thus shared by all subclasses or each class has this ID unique. I need the latter.
    2) I need to fetch a class by its ID to instantiate it.
    3) I need to declare that each subclass must have a one-parameter constructor with one int parameter, so when I get to instantiating by getContructor().newInstance(Object[]) , the params will be compatible every time a new instance occurs, whatever the ID.
    I need this to ease my work. If I accomplish this, every time I would add a new subclass (which could be tens, maybe hundreds of them int the end) I need only to set ID and implement modify() and the new class would automatically register in the combobox and can be instatiated by its ID.
    Thank you for your help.

    Shagrat wrote:
    1) I need a list of IDs of all subclasses for a combo box. So since ID is static and protected and set to value only in the subclass, it can be referenced. This is done by a static method getId(), also declared in the abstract class. Now I do not know whether this ID is thus shared by all subclasses or each class has this ID unique. I need the latter.You could perhaps try it? It will turn out it's the former. There is no way to programmatically produce a unique ID per class from a superclass.
    2) I need to fetch a class by its ID to instantiate it.If you must, a Map of String (ID) vs Class<?> might be a starting point.
    3) I need to declare that each subclass must have a one-parameter constructor with one int parameter, so when I get to instantiating by getContructor().newInstance(Object[]) , the params will be compatible every time a new instance occurs, whatever the ID. There is no way to enforce constructor signatures at compile time.

  • I gave my iPhone 4s today in geneva apple store, the replaced it to a new one. Yesterday i made a synchronization that i cannot find today to synchronize the new iPhone. Is it possible to have all my iPhone content again ???

    I gave my iPhone 4s today in geneva apple store, the replaced it to a new one. Yesterday i made a synchronization that i cannot find today to synchronize the new iPhone. Is it possible to have all my iPhone content again ???

    yes i can see the old ones..... but all summer i synchonised my iphone.....
    where to find the backups, where else from itunes
    thanks

  • Is it possible for deleting all the apps from the appstore which are showing up in the apps not on my phone section. Before I was able to delete them from itunes but now I am not able to find that option.

    Is it possible for deleting all the apps from the appstore which are showing up in the apps not on my phone section. Before I was able to delete them from itunes but now I am not able to find that option.

    You can hide them via your computer's iTunes : iTunes Store: Hiding and unhiding purchases - Apple Support
    The 'x' might not show on their top left corner (it might be invisible), but clicking where it should be should hide the app.

  • Every since i upgraded to win8.1 its going on 3 week since i have been able to to use the 3d feature in cs6cc at all . i have done everthing possible cant find a good fix tried so many . its most aggrevating considering its a 30 day with 6 day left. have

    every since i upgraded to win8.1 its going on 3 week since i have been able to to use the 3d feature in cs6cc at all . i have done everthing possible cant find a good fix tried so many . its most aggrevating considering its a 30 day with 6 day left. have been able to do what i want. Why is this. worked just fine on windows 7. please help i am critical on going postal.

    Have you updated your video card driver from the GPU maker's website?
    The drivers that shipped with Win 8 are pretty out of date (and buggy).

  • I used to give my photo's keywords. Most of the time I have several photo's for the same keyword and it was possible to select all those photo's and give them the keyword in one move. Since of few weeks I can't do that anymore and I find it very annoying.

    I used to give my photo's keywords. Most of the time I have several photo's for the same keyword and it was possible to select all those photo's and give them the keyword in one move. Since of few weeks I can't do that anymore and it's very annoying. What can I do to get back to the former situation?

    . Since of few weeks I can't do that anymore and it's very annoying. What can I do to get back to the former situation?
    Check, if you have the "Primary Only" option enabled. Then keywords will only be applied to the "Primary Image":
    See:                  Keywords or ratings are applied only to one of the selected images - why?
    Uncheck the little square button with the "1".

  • Is it possible to delete all the apps that arn't on my ipod from iTunes?

    Hi i have many apps. And when i say many i mean 513 apps (i had atleast 700 at once but my 32gb ipod became full)
    I was just wondering if it is possible to select all of the apps that are not on my ipod because i have deleted them and then delete them from iTunes but still keep the files.
    I found one way were i would open up the list of apps in a new window, connect my ipod so it is not syncing and then scroll through the list on my ipod finding apps that dont have a tick them finding them in the apps library in the other windows and deleting them but this is taking AGES!
    Is there a quicker way of selecting them and pressing delete but still keeping the files because i have a backup problem and need to remove all of the apps and i cannot be bothered to write down the ones i have ticked and the ones i dont have ticked when i can just remove the ones that arn't ticked then untick them all backup my ipod add 50 apps then back up again and then 50 more etc.
    The reason i am backing up like this is because i have done it before because my backups for itunes always screw up and this fixed it last time but i had to go through the list of apps and select ones i want and ones i dont want.
    PLZ HELP ME IT WOULD SAVE ME ALOT OF TIME!!
    btw yes my ipod button is stuck i am thinking of using alcohol but i will have to talk to my dad before doing that

    It sounds like a remote erase was sent via 'Find My Mac', to check please go to www.icloud.com and login. Is there any data there?
    If it was a remote erase only someone who had the ID and password could have done it. And in that case the data is gone, it is not recoverable I'm afraid.

  • When you are pulling music from a hard drive and it says music can not be found, is there a way to stop it from doing that every time I play music from my computer? It used to find all music now it only finds 1 song at a time

    When pulling music from a harddrive and it say music can not be found, is there a way to stop this from happening every time I play music on my computer? It used to find all music when serching for song but now it only finds 1 at a time. I have over 2000 songs so I can't go through this every time.

    1) However I do not want to move my itunes Music onto the flash drive, only my Movies, and want to keep my music on my hard drive.
    Is this possible?
    Yes
    2) Do the MacBook Air's not have a separate program other than itunes that can play movies? If so, is there a program I can get to solve this problem? I went onto the App Store to see if there was something I could download, but all the apps were for creating DVD's, not simply playing them.
    If you can play the movies in iTunes, you should be able to open the movie files using Quicktime, which should already be on your system.  If you have already transferred the files to your flash drive, open the flash drive in Finder, and hold control when you click on the movie file (or right click if you have the enabled) and select Open With Quicktime Player.  This should play the movie directly from the flash drive. 
    If you want to set all .m4v files to open with Quicktime by just double clicking on the file, you can follow the steps here: http://www.tech-recipes.com/rx/2573/os_x_how_to_change_default_application_to_op en_file_type/
    3) If 1. & 2. questions are solvable, will it then be safe to delete the movies from my itunes?
    You can move the TV shows to your flash drive by dragging them from the iTunes window to your flash drive in Finder or the flash drive icon on the desktop.  When you are sure everything is transferred over to your external device, you can delete the movie from iTunes.  I recommend playing the videos from the flash drive first before deleting them in iTunes. 
    To delete the videos from iTunes, you can highlight them and press the delete key on your keyboard.  In the next prompt, you would want to move it to the trash so that it is deleted from your internal hard drive.  
    I hope that helps!

  • User being removed from Domain Admins...how to find all servers his account is being used.

    We have a user that is being removed from IT (more like being forcefully demoted) and our owner still finds him valuable in other departments. My challenge is to find all servers that he may be using his account locally on (as a service or added to a local
    admin group). It hasn't happened yet, but we need to be prepared to say we know all the servers his account is on when the owner demotes him.
    I'm hoping someone has an approach to this that doesn't include going through tons of Event Viewer Security logs. We do have System Center Configuration Manager and Operations Manager 2012 w/ SP1, but the guy that is responsible for those is the guy we are removing
    and none of us are aware on how to use the possible tools that those have. If you feel that those would do the trick then please point me to a "how to" and I'll try to learn on the fly. Otherwise I'll take any other suggestions.
    ~Rick

    Hi Rick,
    Based on my research, you can filter events logs based on user name and event ID:
    Advanced XML filtering in the Windows Event Viewer
    http://blogs.technet.com/b/askds/archive/2011/09/26/advanced-xml-filtering-in-the-windows-event-viewer.aspx
    Best Regards,
    Amy

Maybe you are looking for